diff --git a/projects/smart-waste-management/README.md b/projects/smart-waste-management/README.md new file mode 100644 index 0000000..d43d6e2 --- /dev/null +++ b/projects/smart-waste-management/README.md @@ -0,0 +1,40 @@ +# Smart Waste Management Platform + +A standalone municipal waste management dashboard that runs purely in the browser (no backend required). Data is persisted in `localStorage` so the app works offline after first load. + +## Features + +- **Role-based access control** — switch between Admin, Waste Collector, and Citizen roles via the role switcher in the top-right of the header. Each role sees a different view of the same data: + - **Admin**: full read+write across all complaints (Resolve / Delete), all collection routes, including Route Reset on completed routes. + - **Waste Collector**: sees all complaints (Resolve / Delete), plus a "Mark Done" action on the routes assigned to them on the Schedule tab. + - **Citizen**: sees only their own complaints (read-only on others), reports new complaints with auto-attribution to their own `userId`, and views the full scheduled route list. +- **Dashboard** — role-aware summary cards (Open / Resolved / Reports Today / Active Routes for admin+collector or Total Reports for citizen), complaints-by-type bar chart, and recent complaints table (filtered to the role's visible scope). +- **Complaints** — full complaint list with status badges, location, description excerpt, and action buttons scoped by role. +- **Report Issue** — citizens file waste-related complaints (Overflowing Bins, Illegal Dumping, Missed Collection, Recycling Issue, Other); on submit the complaint's `reporter` is set to the active user's `userId` so the Citizen dashboard can filter to "my issues" only. +- **Collection Schedule** — zone-based pickup calendar (Zone A Downtown, Zone B Residential, Zone C Industrial). Collectors see a **Mark Done** button per route and a per-route completion timestamp; admins can also reset completed routes. +- **Toast notifications** — non-blocking bottom-right toasts confirm Submit Report / Route Complete / Role Switch actions. +- **Responsive** — stats grid auto-adapts to mobile (2 columns), header stays sticky, panels handle wide+ stretched tables via `overflow-x: auto`. + +## Usage + +Open `index.html` directly in a browser. No build step, no server, no dependencies. + +To reset the seeded data, run `localStorage.clear()` in the browser DevTools console, then refresh. + +## Technology + +Vanilla HTML + CSS + JavaScript (no frameworks, no CDN). Data is stored in the browser's `localStorage` under the `waste_platform` key. + +## Project structure + +``` +smart-waste-management/ +├── index.html # Single-file app (~340 lines: HTML + CSS + JS in one file) +├── project.json # BuildVerse metadata +└── README.md # This file +``` + +## Notes + +- This is a demo-grade implementation backed by `localStorage`: no auth tokens, no password hashing, no real network calls. Users are switched via the role switcher in the header — in a real deployment this would be a login screen backed by the server. +- The role switcher is a stand-in for the issue-spec's Authentication & Authorization module, and lets a single browser session switch between Admin / Waste Collector / Citizen views for demo purposes. diff --git a/projects/smart-waste-management/index.html b/projects/smart-waste-management/index.html new file mode 100644 index 0000000..8d26229 --- /dev/null +++ b/projects/smart-waste-management/index.html @@ -0,0 +1,361 @@ + + +
+ + +