How bilodhi356-ctrl/road-defect-reporting-routing-platform works
This is a KeRRA rural-road defect reporting and routing platform. Citizens submit defect details and GPS locations, receive a reference, and can track report status; staff authenticate to review, assign, update, comment on, and document repairs. Coordinators and administrators also have office-scoped analytics and staff-account management. The graph includes the browser entry points and key routing, persistence, and integration layers. Browser-to-API calls and email-provider wiring are not established by the sampled excerpts, so those links are omitted or marked unverified.
Main entry points: server.js HTTP server · reports.js Report API · staff.js Staff API · User.js Staff accounts
Components 22
Citizen reporting
- Report submission
report.js - Report tracking
track.js
Staff operations
- Staff login
login.js - Staff dashboard
dashboard.js - Dashboard entry
dashboard-entry.js
API and domain
- HTTP server
server.js - Authentication API
src/routes/auth.js - Report API
src/routes/reports.js - Staff API
src/routes/staff.js - Authentication checks
src/middleware/auth.js - Request limiting
src/middleware/rateLimit.js - Report validation
src/utils/validation.js - County routing
src/utils/routing.js
Data and integrations
- Report records
src/models/Report.js - Staff accounts
src/models/User.js - Database connection
src/db.js - MongoDB
- Image storage
src/services/storage.js - Cloudinary
- Citizen email updates
src/services/email.js - County boundary service
Other components
- Citizen
Connections 31
- HTTP server → Database connection: connects database
server.js - Database connection → MongoDB: connects to
src/db.js - HTTP server → Authentication API: mounts auth API
server.js - HTTP server → Report API: mounts report API
server.js - HTTP server → Staff API: mounts staff API
server.js - HTTP server → Request limiting: limits requests
server.js - HTTP server → County routing: loads boundaries
server.js - County routing → County boundary service: fetches boundaries
src/utils/routing.js - Authentication API → Staff accounts: looks up account
src/routes/auth.js - Report API → Authentication checks: checks staff access
src/routes/reports.js - Staff API → Authentication checks: checks staff access
src/routes/staff.js - Authentication checks → Staff accounts: loads account
src/middleware/auth.js - Report API → Report validation: validates input
src/routes/reports.js - Report API → County routing: routes location
src/routes/reports.js - Report API → Report records: reads and updates
src/routes/reports.js - Report API → Staff accounts: checks assignees
src/routes/reports.js - Staff API → Staff accounts: manages accounts
src/routes/staff.js - Staff API → Report records: aggregates reports
src/routes/staff.js - Report API → Image storage: uploads photos
src/routes/reports.js - Image storage → Cloudinary: uploads images
src/services/storage.js - Report API → Citizen email updates: sends updates
src/routes/reports.js - HTTP server → Report submission: serves script
server.js - HTTP server → Report tracking: serves script
server.js - HTTP server → Staff login: serves script
server.js - HTTP server → Staff dashboard: serves script
server.js - HTTP server → Dashboard entry: serves script
server.js - Citizen → Report submission: submits report
- Citizen → Report tracking: tracks report
- Staff login → Authentication API: requests login
- Staff dashboard → Report API: requests reports
- Staff dashboard → Staff API: requests staff data