A civic-tech web application that empowers citizens to report waste, contribute to environmental cleanliness, and earn rewards β built as a front-end project using HTML, Bootstrap, Firebase, and AI image analysis.
- About the Project
- Target Users
- Live Demo
- UI Screens
- Tech Stack
- Project Structure
- Database Schema (Firebase)
- Installation & Setup
- Features
- Environment Variables
- Contributing
- License
The Waste Management System is a community-driven web platform designed to encourage citizens of Saudi Arabia to actively participate in keeping their cities clean. Users can:
- Report waste by uploading photos from their surroundings
- Earn coins for every valid waste image submission
- Redeem rewards (eco-bags and special offers) using their accumulated coins
- View geographic maps showing reported waste hotspots across multiple cities
- Manage their profiles and track contribution history
The platform leverages an AI-powered image recognition model to validate waste submissions and auto-classify waste types. It connects to Firebase for real-time authentication, data storage, and user management.
| User Type | Description |
|---|---|
| General Citizens | Residents who want to report waste and earn rewards for contributing to a cleaner environment |
| Environmental Volunteers | Active contributors who regularly upload waste images and track hotspot activity on the map |
| Municipality / Admins | Officials who monitor waste reports, geographic data, and platform activity (future scope) |
| Youth & Students | Young users motivated by the gamified coin & reward system to participate in sustainability campaigns |
Deployment URL: (Add your deployed link here β e.g., GitHub Pages, Vercel, Netlify)
[Waste-Management](https://waste-management-lemon-one.vercel.app/)
To deploy on GitHub Pages:
- Push the project to a GitHub repository
- Go to Settings β Pages
- Set the source branch to
mainand folder to/root - Your site will be live at
https://<your-username>.github.io/<repo-name>/
The landing page featuring:
- Hero section with a call-to-action button to upload waste photos
- About Us section explaining the platform's mission
- Geographic Map (Leaflet.js) showing waste report locations across cities in Saudi Arabia
- Services section showcasing recycling and waste trading capabilities
- Contact Us form powered by EmailJS
A dual-panel animated authentication page:
- Sign In panel for existing users (email + password)
- Sign Up panel for new user registration (name, email, password)
- Forgot Password link redirects to the reset flow
- Auth is handled via Firebase Authentication
- User enters their registered email
- If found, a form appears to set and confirm a new password
- Inline validation with error messages
The core feature of the platform:
- Displays the user's current coin balance
- File input to upload a waste image
- Image preview before submission
- On upload, user earns 10 coins per valid submission
- Quick-access button to the Rewards page
A full rewards hub:
- Coin & Bag Balance summary bar
- Shop Section β purchase eco bags using coins (Eco Bag: 50, Green Bag: 70, Classic Bag: 90 coins)
- Special Offers β time-limited deals (e.g., 20% off, free bags)
- My Bags β inventory of purchased/received bags
Displays the authenticated user's information:
- Profile photo, name, email, coin count
- Extended details: gender, phone, address, age, occupation
- Edit Profile button linking to the edit form
A form to update all user profile fields:
- Full name, email, profile image upload
- Gender, phone number, address, age, occupation
- Save Changes persists data to Firebase; Cancel returns to profile
| Layer | Technology |
|---|---|
| Markup | HTML5 |
| Styling | CSS3, Bootstrap 5.3 |
| Interactivity | Vanilla JavaScript (ES6 Modules) |
| Maps | Leaflet.js |
| Authentication | Firebase Authentication |
| Database | Firebase Firestore |
| File Storage | Firebase Storage |
| EmailJS | |
| Icons | Font Awesome 6.5 |
waste-management/
β
βββ index.html # Home page
β
βββ pages/
β βββ login.html # Login & Register
β βββ forgetpass.html # Password reset
β βββ upload.html # Waste image upload
β βββ reward.html # Rewards & shop
β βββ profile.html # User profile view
β βββ edit-profile.html # Edit profile form
β
βββ JS/
β βββ main.js # Navbar auth state, map init, contact form
β βββ login.js # Firebase login/register logic
β βββ forget.js # Password reset logic
β βββ upload.js # Image upload & coin award logic
β βββ reward.js # Rewards & shop logic
β βββ profile.js # Profile data rendering
β βββ editProfile.js # Profile update logic
β
βββ css/
β βββ style.css # Global styles
β βββ login.css # Login/Register page styles
β
βββ assets/
βββ images/
βββ waste.png
βββ service_1.png
βββ service_2.png
βββ service_3.png
βββ service_4.png
βββ service_5.png
Each document ID = Firebase Auth uid
{
"uid": "string",
"name": "string",
"email": "string",
"photoURL": "string (Firebase Storage URL)",
"gender": "Male | Female",
"phone": "string",
"address": "string",
"age": "number",
"job": "string",
"coins": "number",
"bags": "number",
"createdAt": "timestamp"
}Each document = one waste image submission
{
"userId": "string (ref to users)",
"imageURL": "string (Firebase Storage URL)",
"city": "string",
"latitude": "number",
"longitude": "number",
"coinsAwarded": 10,
"uploadedAt": "timestamp"
}Tracks shop purchases and redeemed offers
{
"userId": "string (ref to users)",
"itemName": "string",
"itemType": "bag | offer",
"coinsSpent": "number",
"status": "pending | received",
"redeemedAt": "timestamp"
}Stores contact form submissions
{
"name": "string",
"email": "string",
"message": "string",
"sentAt": "timestamp"
}- A modern web browser (Chrome, Firefox, Edge)
- A Firebase project (free tier is sufficient)
- A code editor (VS Code recommended)
- (Optional) Live Server VS Code extension for local development
git clone https://github.com/your-username/waste-management.git
cd waste-management- Go to https://console.firebase.google.com
- Click Add project and follow the setup wizard
- Enable the following services:
- Authentication β Email/Password provider
- Firestore Database β Start in test mode
- Storage β Start in test mode
- In your Firebase project, go to Project Settings β Your apps β Web app
- Register a new web app and copy the config object
- Create a file
JS/firebase-config.js(or update the existing one):
// JS/firebase-config.js
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.x.x/firebase-app.js";
import { getAuth } from "https://www.gstatic.com/firebasejs/10.x.x/firebase-auth.js";
import { getFirestore } from "https://www.gstatic.com/firebasejs/10.x.x/firebase-firestore.js";
import { getStorage } from "https://www.gstatic.com/firebasejs/10.x.x/firebase-storage.js";
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_PROJECT.firebaseapp.com",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_PROJECT.appspot.com",
messagingSenderId: "YOUR_SENDER_ID",
appId: "YOUR_APP_ID"
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export const db = getFirestore(app);
export const storage = getStorage(app);- Sign up at https://www.emailjs.com
- Create an Email Service and an Email Template
- In
JS/main.js, update the EmailJS initialization:
emailjs.init("YOUR_PUBLIC_KEY");
// And in the form handler:
emailjs.send("YOUR_SERVICE_ID", "YOUR_TEMPLATE_ID", templateParams);Option A β VS Code Live Server:
- Open the project folder in VS Code
- Right-click
index.htmlβ Open with Live Server
Option B β Python HTTP Server:
# Python 3
python -m http.server 8000
# Then open http://localhost:8000Option C β Node.js HTTP Server:
npx serve .
β οΈ Important: The project uses ES6 modules (type="module"). You must serve it via an HTTP server β openingindex.htmldirectly in a browser (file://) will cause CORS errors with Firebase imports.
| Feature | Status |
|---|---|
| User Registration & Login | β |
| Password Reset | β |
| Waste Image Upload | β |
| Coin Reward System | β |
| User Profile (view & edit) | β |
| Geographic Map (Leaflet.js) | β |
| Rewards Shop | β |
| Special Offers | β |
| Contact Form (EmailJS) | β |
| Responsive Design (Mobile) | β |
| AI Waste Classification | π Planned |
| Admin Dashboard | π Planned |
| Push Notifications | π Planned |
The geographic map currently includes waste report markers for the following cities in Saudi Arabia:
- Khamis Mushait
- Abha
- Al-Mansak
- Al-Badea
- King Khalid University area
- Al-Harir
- Al-Rasras
- Al-Safq
- King Faisal City
Contributions are welcome! To contribute:
- Fork the repository
- Create a new branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
Please make sure your code is clean, commented where necessary, and follows the existing file/folder structure.
Β© 2025 Waste Management System. All Rights Reserved.
Built with π to keep Saudi Arabia clean and green.