Skip to content

Latest commit

ย 

History

1,009 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

โ™ป๏ธ CleanSight

Report Waste. Coordinate Cleanup. Transform Communities.

License: MIT React TypeScript Node.js MongoDB Python

CleanSight is a comprehensive data-driven platform empowering citizens to report garbage issues, volunteers to take action, and municipalities to efficiently manage cleanup operations.


๐Ÿ“– About the Project

CleanSight bridges the gap between environmental awareness and actionable community effort. By combining a modern web interface, a robust backend, and custom machine learning models, the platform streamlines the entire lifecycle of local waste management โ€” from the moment a user snaps a photo to the final verified cleanup.

โœจ Core Features

  • ๐Ÿ“ธ Phase 1 AI Screening: MobileNetV2 binary classifier (TensorFlow/Keras) automatically verifies uploaded images as waste or non-waste.
  • ๐Ÿ”ฌ Phase 2 Category Classification: MobileNetV3-Small classifier (PyTorch) identifies waste type โ€” plastic, paper, glass, or mixed โ€” for confirmed waste images.
  • ๐Ÿ“Š ML Analytics Dashboard: Comprehensive monitoring of model performance, prediction confidence, review workload, and weak class identification.
  • ๐Ÿ“ Geolocation Tracking: Precise GPS tagging for every report so cleanup crews know exactly where to go.
  • ๐Ÿ‘ฅ Role-Based Workflows: Distinct interfaces and permissions for Citizens, Volunteers, Staff, and Admins.
  • ๐Ÿ”„ Admin Review Queues: Low-confidence ML predictions are flagged for human review before report acceptance.
  • โšก Real-Time Coordination: Connects on-the-ground volunteers with reported tasks dynamically.
  • ๐Ÿ“ˆ Impact Analytics: Dashboards displaying environmental impact metrics and community progress.

๐Ÿ“ธ Screenshots & UI Showcase

๐ŸŒ Landing & Authentication

1. Landing Page (Hero)

Landing Page 1

2. Platform Overview & Features

Landing Page 2

3. Get Started (Role Selection)

Get Started

4. Sign In Page

Sign In


๐Ÿ‘ค Citizen Portal & Report Workflow

5. Citizen Dashboard

Citizen Dashboard

6. Report Upload - Step 1 (Photo Selection)

Uploading Page 1

7. Report Upload - Step 2 (Location Tagging & Details)

Uploading Page 2

8. Report Upload - Step 3 (AI Verification & Submission)

Uploading Page 3


๐Ÿค Volunteer Portal

9. Volunteer Dashboard - Available Tasks

Volunteer Dashboard 1

10. Volunteer Dashboard - Cleanup Location Mapping

Volunteer Dashboard 2


๐Ÿ›ก๏ธ Admin Dashboard & ML Analytics

11. Admin System Overview & Metrics

Admin Dashboard 1

12. Report Moderation & Review Queue

Admin Dashboard 2

13. AI Model Performance Analytics

Admin Dashboard 3


๐Ÿ—๏ธ System Architecture

CleanSight/
โ”œโ”€โ”€ Frontend/               # React + TypeScript SPA (Vite)
โ”‚   โ”œโ”€โ”€ components/         # Reusable shadcn/ui components & layouts
โ”‚   โ”œโ”€โ”€ hooks/              # Custom React hooks (auth, analytics, queries)
โ”‚   โ”œโ”€โ”€ pages/              # Role-protected route views
โ”‚   โ””โ”€โ”€ lib/                # Firebase config, API clients, utilities
โ”‚
โ”œโ”€โ”€ Backend/                # Node.js + Express REST API
โ”‚   โ”œโ”€โ”€ routes/             # API endpoints (auth, reports, volunteers, ML)
โ”‚   โ”œโ”€โ”€ models/             # Mongoose/MongoDB schemas
โ”‚   โ”œโ”€โ”€ middleware/         # Firebase token verification & role guards
โ”‚   โ””โ”€โ”€ services/           # Business logic & analytics aggregations
โ”‚
โ””โ”€โ”€ ML/                     # Machine Learning Environment
    โ”œโ”€โ”€ service/            # Phase 1 FastAPI service (port 8000)
    โ”œโ”€โ”€ category_service/   # Phase 2 FastAPI service (port 8001)
    โ”œโ”€โ”€ dataset_binary/     # Waste vs. non-waste image dataset
    โ”œโ”€โ”€ dataset_category/   # Category dataset (plastic/paper/glass/mixed)
    โ”œโ”€โ”€ training/           # Model training pipelines
    โ”œโ”€โ”€ evaluation/         # Metric reporting (F1, confusion matrices)
    โ”œโ”€โ”€ inference/          # Standalone predict scripts
    โ””โ”€โ”€ models/             # Trained model artifacts (git-ignored)

๐Ÿ› ๏ธ Tech Stack

Frontend:

  • React 18, Vite, TypeScript
  • Tailwind CSS, shadcn/ui, Framer Motion
  • React Router v6, Firebase Authentication

Backend:

  • Node.js, Express.js
  • MongoDB, Mongoose
  • Firebase Admin SDK, Role-Based Access Control (RBAC)

Machine Learning:

  • Phase 1: TensorFlow/Keras โ€” MobileNetV2 binary classifier
  • Phase 2: PyTorch โ€” MobileNetV3-Small category classifier
  • FastAPI for ML serving, Scikit-learn, Pillow, Matplotlib, Seaborn

๐Ÿš€ Local Development

Prerequisites

  • Node.js 18+ and pnpm (or npm)
  • Python 3.10+ (tested with 3.14 on Windows)
  • MongoDB (Atlas cloud or local)
  • Git

1. Clone and Install

git clone <repository-url>
cd CleanSight
pnpm install

2. Configure Environment Variables

# Frontend โ€” add your Firebase config
copy Frontend\.env.example Frontend\.env

# Backend โ€” add MongoDB URI + Firebase Admin credentials
copy Backend\.env.example Backend\.env

# ML Service โ€” optional, uses sensible defaults
copy ML\.env.example ML\.env

Edit each .env with your real credentials. Never commit .env files.

3. Set Up Python Environment (ML Service)

cd ML
py -3.11 -m venv venv            # TensorFlow 2.15 (Phase 1) needs Python 3.11 on Windows
.\venv\Scripts\Activate.ps1       # Windows PowerShell
pip install -r requirements_service.txt
cd ..

4. Start Services (4 Terminals)

# Terminal 1 โ€” Backend
cd Backend
npm run dev
# โ†’ http://localhost:5000

# Terminal 2 โ€” ML Phase 1 Service (binary classifier)
cd ML
.\venv\Scripts\Activate.ps1
python -m uvicorn service.main:app --host 0.0.0.0 --port 8000 --reload
# โ†’ http://localhost:8000

# Terminal 3 โ€” ML Phase 2 Category Service
cd ML
.\venv\Scripts\Activate.ps1
python -m uvicorn category_service.main:app --host 0.0.0.0 --port 8001 --reload
# โ†’ http://localhost:8001

# Terminal 4 โ€” Frontend
cd Frontend
pnpm dev
# โ†’ http://localhost:8080

5. Verify

Service URL Health Check
Frontend http://localhost:8080 Opens CleanSight landing page
Backend http://localhost:5000 http://localhost:5000/api/health
ML Phase 1 http://localhost:8000 http://localhost:8000/health
ML Phase 2 http://localhost:8001 http://localhost:8001/health

๐Ÿ“– Full setup guide: docs/LOCAL_DEPLOYMENT.md โœ… Pre-demo checklist: docs/QUICK_VERIFICATION_CHECKLIST.md

๐Ÿ”„ The Lifecycle of a Report

  1. Submission: A user captures an image and tags the location on the map.
  2. Phase 1 Screening: The ML binary model determines whether the image contains waste. Non-waste images are rejected early.
  3. Phase 2 Classification: Confirmed waste images are classified into a category (plastic, paper, glass, or mixed).
  4. Confidence Gating: High-confidence predictions are auto-accepted; low-confidence ones are queued for admin review.
  5. Dispatch: Verified reports appear on the community dashboard for volunteers to claim.
  6. Resolution: Volunteers execute the cleanup and log completion.
  7. Review & Analytics: Admins review outcomes; the analytics dashboard tracks community impact and model performance.

Developed by Sanuka Marasinghe

Building technology for cleaner, greener communities.

About

๐ŸšฎSmart waste reporting platform with AI-based image validation, location tracking, and community-driven cleanup coordinationโ€”designed to improve transparency, accountability, and response efficiency in waste management.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages