A cutting-edge waste management platform that transforms recycling into an engaging, rewarding experience through advanced technologies and user-centric design.
- AI-powered Material Identification: Upload images of waste items to receive detailed analysis on recyclability, material composition, and proper disposal methods
- Blockchain-enabled Waste Tracking: Monitor waste items from drop-off to recycling completion with a secure, transparent tracking system
- Smart Recycling Guidance: Get personalized instructions on how to properly prepare and recycle different types of materials
- Interactive Drop-off Map: Find nearby recycling centers and drop-off points with an interactive map
- Infrastructure Reporting: Report damaged waste management infrastructure through webcam photos
- Community Marketplace: List recyclable items for reuse in the community marketplace
- Municipality Integration: Direct routing of recyclable materials to municipal collection services
- Gamification & Rewards: Earn eco-points and achievements for responsible waste management
- Backend: Flask (Python 3.11)
- Database: PostgreSQL
- AI/ML: Google Gemini API, OpenCV, scikit-learn
- Frontend: HTML5, CSS3, JavaScript, Bootstrap 5
- Authentication: Flask-Login, Flask-Bcrypt
- Forms: Flask-WTF, WTForms
- Image Processing: Pillow, OpenCV
- Geospatial: OpenLayers for maps
- Python 3.9+ (3.11 recommended)
- PostgreSQL
- pip (Python package manager)
git clone https://github.com/yourusername/wasteworks.git
cd wasteworkspython -m venv venv
# On Windows
venv\Scripts\activate
# On macOS/Linux
source venv/bin/activatepip install -r dependencies.txt- Install PostgreSQL if you haven't already
- Create a new database:
createdb wasteworks
- Or use the included setup script:
chmod +x setup_database.sh ./setup_database.sh
Create a .env file in the project root with the following variables:
# Database Configuration
DATABASE_URL=postgresql://username:password@localhost:5432/wasteworks
# Flask Configuration
SESSION_SECRET=your_random_secret_key
FLASK_ENV=development
PYTHONUNBUFFERED=true
# Optional: AI API Keys
# OPENAI_API_KEY=your_openai_api_key
# ANTHROPIC_API_KEY=your_anthropic_api_key
python recreate_db.pypython main.pyThe application will be available at http://localhost:5000
If you prefer using Docker:
# Build the Docker image
docker build -t wasteworks .
# Run the container
docker run -p 5000:5000 --env-file .env wasteworksThe application uses several related models:
- User: Authentication, profile, and gamification data
- WasteItem: Uploaded waste items with AI analysis results
- DropLocation: Recycling centers and drop-off points
- WasteJourneyBlock: Blockchain-like tracking for waste journey
- Achievement: Gamification achievements and badges
- Reward: Points and rewards for user actions
- InfrastructureReport: Citizen reports of damaged infrastructure
The application provides the following main routes:
/: Home page and waste item upload/analysis/auth/register: User registration/auth/login: User login/auth/profile: User profile and statistics/marketplace: Community marketplace for recyclable items/municipality: Items routed to municipal collection/drop-points: Map of recycling drop-off locations/tracking: Blockchain-based waste journey tracking/infrastructure: Infrastructure reporting system
This application is configured for easy deployment on Render.com:
-
Fork or clone this repository to your GitHub account
-
Sign up for Render.com and connect your GitHub account
-
Create a new Web Service and select your repository
-
Use the following settings:
- Environment: Python
- Build Command:
pip install -r requirements-render.txt - Start Command:
gunicorn --bind 0.0.0.0:$PORT --workers=2 main:app
-
Add the following environment variables:
SESSION_SECRET: Generate a secure random stringFLASK_ENV: productionPYTHONUNBUFFERED: truePYTHON_VERSION: 3.11.8
-
Create a PostgreSQL database in Render:
- Go to Dashboard β New β PostgreSQL
- Link it to your web service (Render will automatically set the DATABASE_URL environment variable)
-
Deploy your application
- The application will automatically set up the database schema during the first deployment
- If needed, you can run database migrations through the Render shell
For database schema updates after deployment:
# For adding new columns to existing tables:
python update_db.py
# For completely resetting the database (warning: all data will be lost):
python recreate_db.pyContributions are welcome! Please feel free to submit a Pull Request or open issues for bugs and feature requests.
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature - Commit your changes:
git commit -m 'Add some amazing feature' - Push to the branch:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Project Link: https://github.com/yourusername/wasteworks