EcoScan is a real-time, gamified community waste management platform. Citizens report local waste spots on an interactive map; volunteers claim and clean them up. Every submission is automatically verified by an AI vision model before points are awarded. A second AI pipeline cross-checks the reported GPS location against Google Maps Street View to detect fraudulent or misplaced reports.
| Feature | Description |
|---|---|
| πΊοΈ Interactive Map | Leaflet map with custom severity markers, Street & Satellite views |
| π₯ Snapchat-Style Heatmap | Toggle a heat overlay to see high-density waste zones at a glance |
| π€ AI Cleanup Verification | Groq Vision LLM compares before & after photos to approve or reject cleanups |
| π Location Image Check | AI cross-checks the uploaded image against Google Street View for the same coordinates |
| π― Severity Filter | Filter map markers by status (Reported / Active / Cleaned) or severity (High / Medium / Low) |
| π Gamified Leaderboard | Volunteers earn points per cleanup (Low = 10 / Medium = 25 / High = 50 pts) with badge tiers |
| π¨ 8 Visual Themes | Midnight Β· Matrix Β· Sunset Β· Ocean Β· Purple Β· Cherry Β· Arctic Β· Forest |
| π Live Refresh | One-click report refresh with spinning indicator and "last refreshed Xs ago" tooltip |
| π Stats Drawer | Analytics panel with reported / in-progress / cleaned breakdowns |
| π Multilingual UI | 5 languages supported: English, Hindi, Tamil, Marathi, Bengali with instant translation updates |
| π Toast Notifications | Contextual success / error / info toasts for all user actions |
| π Interactive 3D Globe | Draggable 3D globe landing page overlay that gives a real-time global context to the waste spots |
| π Real-Time WebSockets | New reports and status changes broadcast instantly to all connected users |
EcoScan uses a decoupled client-server architecture with real-time WebSocket synchronisation and two independent AI pipelines.
flowchart TB
subgraph Client ["Frontend β React 18 + Vite"]
UI[Professional Dark UI]
Map[Leaflet Interactive Map]
Heatmap[Snapchat Heatmap Layer]
WSClient[WebSocket Client]
end
subgraph Backend ["FastAPI β Python 3"]
Auth[Auth Handler]
Report[Report Controller]
WSMgr[WebSocket Manager]
AI_Cleanup[AI Cleanup Verifier]
AI_Location[AI Location Verifier]
end
subgraph External ["External Services"]
Neon[(Neon PostgreSQL / SQLite)]
Groq[Groq Vision API]
StreetView[Google Street View API]
end
UI -->|REST API| Backend
WSClient -->|Live Updates| WSMgr
WSMgr --> WSClient
Report --> Neon
Auth --> Neon
AI_Cleanup -->|Before & After Images| Groq
AI_Location -->|GPS Coords + Photo| Groq
AI_Location -->|Fetch Reference Image| StreetView
The top navigation bar is a strict 3-zone layout:
[ Logo ] βββ [ Map | Filter | Language | Theme | Refresh ] βββ [ Live Stats ]
- Every button has
hover:scale-110with smooth easing - Custom Tip tooltip component with arrow + fade-in animation
- Grouped buttons in pill containers with vertical dividers
All themes use CSS filter (hue-rotate + saturation + brightness) for a zero-overhead, instant colour transformation:
| Theme | Hue Shift | Mood |
|---|---|---|
| π Midnight | None | Default dark teal |
| π Matrix | +35Β° | Cyberpunk lime |
| π Sunset | +165Β° | Warm amber gold |
| π Ocean | +200Β° | Cool sky blue |
| π Purple | +260Β° | Deep violet |
| πΈ Cherry | +320Β° | Rose pink |
| βοΈ Arctic | +185Β° desaturated | Ice white-blue |
| π² Forest | +55Β° | Earthy olive |
- Collapsed rail: shows avatar, leaderboard icon, quick stats, logout
- Expanded: profile card Β· last report card Β· leaderboard shortcut Β· impact stats Β· badge tier progression
- Toggle:
PanelLeftClose / PanelLeftOpenicon embedded in the header row
- Volunteer uploads an "after" photo.
- Backend sends both before and after base64 images + location description to Groq Vision (
meta-llama/llama-4-scout-17b-16e-instruct). - Model returns structured JSON:
status(approved / rejected),confidence(0.0β1.0),summary. - On approval β points awarded, marker turns cleaned (slate); on rejection β
verification-failedstatus shown.
- When a citizen submits a report, the backend fetches a Google Street View static image for the GPS coordinates.
- Both the citizen's uploaded photo and the Street View reference are sent to Groq Vision.
- The model checks whether the uploaded photo plausibly matches the real-world location.
- Result stored in
loc_verification_status/loc_verification_confidence/loc_verification_summarycolumns.
| Column | Type | Notes |
|---|---|---|
id |
Integer PK | β |
name |
String | Display name |
email |
String | Unique |
password_hash |
String | PBKDF2-HMAC-SHA256 |
role |
String | citizen or volunteer |
auth_token |
String | Session token |
total_score |
Integer | Gamification points |
cleanup_count |
Integer | Verified cleanups |
report_count |
Integer | Reports submitted |
| Column | Type | Notes |
|---|---|---|
id |
Integer PK | β |
lat / lng |
Float | GPS coordinates |
severity |
String | low / medium / high |
status |
String | reported Β· in-progress Β· pending-review Β· cleaned Β· verification-failed |
desc |
String | Citizen description |
landmark |
String | Nearby reference |
image_data |
Text | Base64 before photo |
after_image_data |
Text | Base64 after photo |
reporter_id |
FK β Users | Who reported |
claimed_by_id |
FK β Users | Volunteer claiming |
verification_status |
String | Cleanup AI result |
verification_confidence |
Float | 0.0 β 1.0 |
verification_summary |
String | AI explanation |
loc_verification_status |
String | Location AI result |
loc_verification_confidence |
Float | 0.0 β 1.0 |
loc_verification_summary |
String | Location AI explanation |
To see the full lifecycle, create two accounts β one Citizen and one Volunteer.
- Register / Login as Citizen
- Click the
+FAB (bottom-right) - Choose severity, drop a pin on the map, upload a before photo, add description + landmark
- Submit β the marker broadcasts live to all connected users
- Login as Volunteer
- Click any reported marker β "Claim for Cleanup" (marker turns amber/pulsating)
- After cleaning: click marker β "Submit Proof", upload the after photo
- Groq Vision compares before & after photos
- Approved β spot marked Cleaned, volunteer awarded points, leaderboard updates instantly
- Rejected β status shows
verification-failedwith AI summary visible on the marker popup
- Toggle Heatmap View (top-right on map) to see waste density
- Use the Filter dropdown in the header to isolate High / Active / Cleaned markers
- Switch Visual Theme from the palette icon in the header
- Click Refresh (β») to pull the latest reports from the server
Two terminals required.
cd backend
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.py
# API runs on http://localhost:8000
# Swagger UI: http://localhost:8000/docscd frontend
npm install
npm run dev
# App runs on http://localhost:5174# Required β get your key at https://console.groq.com/
GROQ_API_KEY=your_groq_api_key_here
# Optional β defaults to local SQLite (ecoscan.db)
DATABASE_URL=postgresql://user:password@host/dbname
# Optional β enables Google Street View location verification
GOOGLE_MAPS_API_KEY=your_google_maps_key_here# Points the frontend to your deployed backend (optional in local dev)
VITE_API_BASE_URL=https://your-backend-api.com| Badge | Points Required | Icon |
|---|---|---|
| Eco Explorer | β₯ 50 pts | π± |
| Green Knight | β₯ 150 pts | βοΈ |
| Eco Champion | β₯ 300 pts | π |
Severity β points: Low = 10 Β· Medium = 25 Β· High = 50
This project is proprietary. All rights reserved by the EcoScan team.