Clean Connect is an integrated, role-based cyber-physical platform designed to optimize municipal waste management. Originally conceptualized for the Smart India Hackathon, it seamlessly connects Citizens, Sanitation Workers, and Administrators into a unified, responsive ecosystem with strict SLA deadlines.
- Role-based PWA Framework: Unified platform that offers distinct Progressive Web App interfaces for Citizens, Workers, and Admins.
- Strict SLA Enforcement: A rigid 36-hour resolution window for citizen complaints, automatically managed and monitored.
- Geospatial Intelligence: Verification of GPS EXIF data from uploaded complaint images, displayed instantly on Leaflet-powered maps.
- Offline-First PWA & Real-time Notifications: Utilizes Firebase Cloud Messaging (FCM) Service Workers for offline capabilities and prompt job assignments.
- Telemetry & AI Auditing: Deep integration with the Telemetry API for asynchronous telemetry audits and AI-driven system health checks.
- Location Parsing & Verification: Extracting and validating EXIF metadata directly from base64 encoded photo uploads to verify the authenticity of a complaint's location.
- SLA Management (
SLAManager): Time-series monitoring that enforces the 36-hour resolution timeline and tags complaints as compliant or non-compliant. - Resilient AI Telemetry Client: A custom API client (
TelemetryClient) for telemetry streaming that implements token normalization, streaming Server-Sent Events (SSE) parsing, and robust error handling.
- Geospatial Boundaries: Enforcing strict mathematical constraints on GPS coordinates via Pydantic (
latitude: float = Field(..., ge=-90.0, le=90.0),longitude: float = Field(..., ge=-180.0, le=180.0)). - Time Delta Arithmetic: Calculating SLA deadlines dynamically (
deadline = now + timedelta(hours=36)). - Exponential Backoff with Jitter: Network retry logic for HTTP 429 Too Many Requests, calculating sleep time as
backoff + random.uniform(0.1, 0.5)and multiplyingbackoff *= 2.0.
- Telemetry API Credentials: Requires an OAuth credential/token file at
~/.config/opencode/telemetry-accounts.json. It securely extracts theaccess_tokento interact with Claude/Gemini telemetry endpoints. - Mappls API: Utilizes Mappls (MapmyIndia) APIs for precise map rendering, routing, and reverse geocoding location services.
- Firebase Configuration: Relies on FCM integration (
firebase-messaging-sw.js& Firebase SDK) to enable push notifications and offline caching.
Backend (Python/FastAPI):
fastapi- High performance async API frameworkpydantic(V2) - Data validation and settings management using python type annotationsurllib- Native HTTP request handling for the Telemetry Clientdatetime,time,random,json- Standard Python libraries for timing, math, and parsing- Mock Database State utilizing Python
DictandListobjects for rapid prototyping without overhead.
Frontend:
Vanilla JS,HTML5,CSS3- Featuring modern Glassmorphism aestheticsLeaflet.js- Open-source JavaScript library for mobile-friendly interactive mapsFirebase SDK (Compat 10.4.0)- For PWA service worker and messaging capabilities
- Setup a Python virtual environment (
python -m venv .venv). - Activate the environment.
- Install dependencies (
pip install fastapi uvicorn pydantic). - Run the API:
uvicorn backend.main:app --reload. - Serve the
frontend/directory using any local web server (e.g., Live Server orpython -m http.server).