A smart barcode scanning application that provides real-time product information and sustainability insights. ScanCycle leverages computer vision and open data APIs to help users make informed purchasing and recycling decisions.
pip install -r requirements.txt cp .env.example .env
- Real-time Barcode Scanning: Uses Quagga2 library to scan EAN and UPC barcodes directly from your webcam
- Product Information: Retrieves comprehensive product details including:
- Product name and brands
- Nutrition scores (Nutri-Score)
- Packaging materials
- Recyclability Detection: Automatically determines if product packaging is recyclable based on material composition
- Open Data Integration: Powered by Open Food Facts API for reliable product information
- User-Friendly Interface: Clean, responsive web-based interface for seamless scanning experience
- Backend: Flask (Python)
- Frontend: HTML5, CSS, JavaScript
- Barcode Scanning: Quagga2 (JavaScript barcode scanner library)
- Data Source: Open Food Facts API
- Python 3.7 or higher
- Node.js and npm (for frontend dependencies)
- A modern web browser with webcam access
-
Clone the repository
git clone <repository-url> cd ScanCycle-HackCU-12-
-
Create a Python virtual environment
python -m venv .venv
-
Activate the virtual environment
- Windows:
.venv\Scripts\activate
- macOS/Linux:
source .venv/bin/activate
- Windows:
-
Install Python dependencies
pip install flask requests
-
Install JavaScript dependencies
npm install
-
Start the Flask server
python flask_app.py
-
Open your browser Navigate to
http://localhost:5000 -
Scan a barcode
- Grant camera permissions when prompted
- Position a barcode in front of your webcam
- The application will automatically detect and scan the barcode
-
View results
- Product information will be displayed in real-time
- Check the recyclability status of the packaging
- If the product isn't found, you can add it to the Open Food Facts database via the provided link
Serves the main application interface
Scans and retrieves product information for the specified barcode
Parameters:
barcode(string): The barcode code to scan (EAN or UPC)
Response:
{
"product-name": "Product Name",
"brands": "Brand Name",
"packaging": "Plastic, Paper",
"nutriscore_grade": "A"
}- EAN (European Article Number) - 13 digits
- UPC (Universal Product Code) - 12 digits
The application recognizes the following recyclable materials:
- PET (Polyethylene Terephthalate)
- HDPE (High-Density Polyethylene)
- Aluminium
- Steel
- Glass
- Paper
- Cardboard
ScanCycle-HackCU-12-/
├── flask_app.py # Flask backend application
├── templates/
│ └── index.html # Main HTML template
├── static/
│ ├── index.css # Stylesheet
│ └── index.js # Frontend JavaScript logic
├── package.json # JavaScript dependencies
└── README.md # Project documentation
- Flask - Web framework
- Requests - HTTP library for API calls
- Quagga2 - Real-time barcode scanner library
- Open Food Facts API - Product database
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a pull request or open an issue for any bugs or feature requests.
- Open Food Facts - Comprehensive open food database
- Quagga2 - Advanced barcode scanning library
- Built for HackCU 12