# nextgen-tech-lab/waste-management-website architecture

> Architecture diagram of the GitHub repository nextgen-tech-lab/waste-management-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nextgen-tech-lab/waste-management-website
- Repository: https://github.com/nextgen-tech-lab/waste-management-website

## Overview

This is a citizen-and-administrator waste-management platform. Users authenticate, then discover bins, track collection vehicles, submit complaints, and access educational material; administrators oversee those operations and manage routes, fleet, complaints, bins, and content. The React app calls an Express API backed by MongoDB, with Socket.IO supporting live updates. The README documents several product capabilities whose implementation was not sampled; those relationships are marked unverified rather than inferred from module names.

Main entry points: [`frontend/src/App.jsx`](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/App.jsx) (App routing), [`backend/src/controllers/routeController.js`](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/controllers/routeController.js) (Route operations), [`backend/server.js`](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/server.js) (HTTP server), [`backend/src/socket/socketHandler.js`](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/socket/socketHandler.js) (Socket handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth["Authentication<br/>[AuthContext.jsx]"]
  node_public["Public features<br/>[BinsNearMe.jsx]"]
  node_tracking["Vehicle tracking"]
  node_complaints["Complaint interface"]
  node_education["Education interface"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.jsx]"]
  node_clientservices["API client<br/>[apiClient.js]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_routes["Route endpoints<br/>[routes.js]"]
end

subgraph group_domain["Waste operations"]
  node_routeops["Route operations<br/>[routeController.js]"]
  node_complaintops["Complaint operations"]
  node_otherops["Other API operations"]
  node_route_records[("Route records<br/>[Route.js]")]
  node_waste_records[("Waste records<br/>[Bin.js]")]
  node_complaint_records[("Complaint records<br/>[Complaint.js]")]
  node_vehicle_records[("Vehicle records<br/>[Vehicle.js]")]
  node_mongo[("MongoDB<br/>[database.js]")]
end

subgraph group_realtime["Live updates"]
  node_socket["Socket handler<br/>[socketHandler.js]"]
end

node_citizen(("Citizen"))
node_admin(("Administrator"))

node_citizen -.->|"uses"| node_app
node_admin -.->|"uses"| node_app
node_app -->|"provides context"| node_auth
node_app -->|"routes to"| node_public
node_app -->|"routes to"| node_tracking
node_app -->|"routes to"| node_complaints
node_app -->|"routes to"| node_education
node_app -->|"routes to"| node_adminui
node_auth -->|"calls"| node_clientservices
node_clientservices -.->|"sends API requests"| node_server
node_server -->|"connects"| node_mongo
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches"| node_routeops
node_routeops -->|"reads/writes"| node_route_records
node_routeops -->|"reads/writes"| node_waste_records
node_routeops -->|"reads/writes"| node_vehicle_records
node_complaintops -->|"reads/writes"| node_complaint_records
node_server -->|"initializes"| node_socket
node_socket -->|"updates"| node_vehicle_records
node_socket -->|"updates"| node_waste_records
node_socket -->|"updates"| node_complaint_records
node_public -.->|"uses waste services"| node_otherops
node_tracking -.->|"requests live routes"| node_routeops
node_complaints -.->|"submits and tracks"| node_complaintops
node_education -.->|"loads learning content"| node_otherops
node_adminui -.->|"manages routes"| node_routeops
node_adminui -.->|"manages complaints"| node_complaintops

click node_app "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/App.jsx"
click node_auth "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/context/AuthContext.jsx"
click node_public "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/BinsNearMe.jsx"
click node_tracking "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/VehicleTracking.jsx"
click node_complaints "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/ComplaintManagement.jsx"
click node_education "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/EducationCenter.jsx"
click node_adminui "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/AdminDashboard.jsx"
click node_clientservices "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/services/apiClient.js"
click node_server "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/server.js"
click node_routes "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/routes/routes.js"
click node_routeops "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/controllers/routeController.js"
click node_complaintops "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/controllers/complaintController.js"
click node_otherops "https://github.com/nextgen-tech-lab/waste-management-website/tree/main/backend/src/controllers"
click node_route_records "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Route.js"
click node_waste_records "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Bin.js"
click node_complaint_records "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Complaint.js"
click node_vehicle_records "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Vehicle.js"
click node_mongo "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/config/database.js"
click node_socket "https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/socket/socketHandler.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_auth,node_public,node_tracking,node_complaints,node_education,node_adminui,node_clientservices toneBlue
class node_server,node_routes toneAmber
class node_routeops,node_complaintops,node_otherops,node_route_records,node_waste_records,node_complaint_records,node_vehicle_records,node_mongo toneMint
class node_socket toneRose
class node_citizen,node_admin toneIndigo
```

## Components

### Web application

- [App routing](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Authentication](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Public features](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/BinsNearMe.jsx): `frontend/src/pages/BinsNearMe.jsx`
- [Vehicle tracking](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/VehicleTracking.jsx): `frontend/src/pages/VehicleTracking.jsx`
- [Complaint interface](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/ComplaintManagement.jsx): `frontend/src/pages/ComplaintManagement.jsx`
- [Education interface](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/EducationCenter.jsx): `frontend/src/pages/EducationCenter.jsx`
- [Admin dashboard](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/pages/AdminDashboard.jsx): `frontend/src/pages/AdminDashboard.jsx`
- [API client](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/frontend/src/services/apiClient.js): `frontend/src/services/apiClient.js`

### Backend API

- [HTTP server](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/server.js): `backend/server.js`
- [Route endpoints](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/routes/routes.js): `backend/src/routes/routes.js`

### Waste operations

- [Route operations](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/controllers/routeController.js): `backend/src/controllers/routeController.js`
- [Complaint operations](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/controllers/complaintController.js): `backend/src/controllers/complaintController.js`
- [Other API operations](https://github.com/nextgen-tech-lab/waste-management-website/tree/main/backend/src/controllers): `backend/src/controllers`
- [Route records](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Route.js): `backend/src/models/Route.js`
- [Waste records](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Bin.js): `backend/src/models/Bin.js`
- [Complaint records](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Complaint.js): `backend/src/models/Complaint.js`
- [Vehicle records](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/models/Vehicle.js): `backend/src/models/Vehicle.js`
- [MongoDB](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/config/database.js): `backend/config/database.js`

### Live updates

- [Socket handler](https://github.com/nextgen-tech-lab/waste-management-website/blob/main/backend/src/socket/socketHandler.js): `backend/src/socket/socketHandler.js`

### Other components

- **Citizen**
- **Administrator**

## Connections

- Citizen → App routing: uses
- Administrator → App routing: uses
- App routing → Authentication: provides context (evidence: `frontend/src/App.jsx`)
- App routing → Public features: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Vehicle tracking: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Complaint interface: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Education interface: routes to (evidence: `frontend/src/App.jsx`)
- App routing → Admin dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Authentication → API client: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- API client → HTTP server: sends API requests
- HTTP server → MongoDB: connects (evidence: `backend/server.js`)
- HTTP server → Route endpoints: mounts (evidence: `backend/server.js`)
- Route endpoints → Route operations: dispatches (evidence: `backend/src/routes/routes.js`)
- Route operations → Route records: reads/writes (evidence: `backend/src/controllers/routeController.js`)
- Route operations → Waste records: reads/writes (evidence: `backend/src/controllers/routeController.js`)
- Route operations → Vehicle records: reads/writes (evidence: `backend/src/controllers/routeController.js`)
- Complaint operations → Complaint records: reads/writes (evidence: `backend/src/controllers/complaintController.js`)
- HTTP server → Socket handler: initializes (evidence: `backend/server.js`)
- Socket handler → Vehicle records: updates (evidence: `backend/src/socket/socketHandler.js`)
- Socket handler → Waste records: updates (evidence: `backend/src/socket/socketHandler.js`)
- Socket handler → Complaint records: updates (evidence: `backend/src/socket/socketHandler.js`)
- Public features → Other API operations: uses waste services
- Vehicle tracking → Route operations: requests live routes
- Complaint interface → Complaint operations: submits and tracks
- Education interface → Other API operations: loads learning content
- Admin dashboard → Route operations: manages routes
- Admin dashboard → Complaint operations: manages complaints
