How pratikshark25/pothole_web works
Pothole Mapper is a role-based web app for commuters to report road damage and for municipal staff to track repairs. The main path runs from a commuter’s report through server-side image validation and location handling into a pothole record, which map and dashboard views expose for follow-up. Authentication, administrative user management, and commuter rewards are supporting capabilities. The README also describes cloud image storage and AI verification; the sampled upload code shows Roboflow validation, but does not establish cloud-storage integration. Edges to external services are limited to documented or excerpted behavior.
Main entry points: reportroute.js Report endpoints · App.jsx App routing · auth.js Auth endpoints · User.js User records
Components 25
Web experience
- App routing
client/src/App.jsx - Home page
client/src/components/HomePage.jsx - Report form
client/src/components/ReportPothole.jsx - Pothole map
client/src/components/PotholeMap.jsx - Commuter dashboard
client/src/components/Dashboard.jsx - Municipal dashboard
client/src/components/municipal/MunicipalDashboard.jsx - Admin dashboard
client/src/components/admin/AdminDashboard.jsx - Profile
client/src/components/Profile.jsx - Team page
client/src/components/TeamPage.jsx
Identity and access
- Auth state
client/src/context/AuthContext.jsx - Login and signup
client/src/components/auth/AuthModal.jsx - OTP recovery
client/src/components/auth/OTPInput.jsx - Password reset
client/src/components/auth/Reset.jsx - API configuration
client/src/config/api.js - Auth endpoints
server/routes/auth.js - Auth middleware
server/middleware/auth.js
Reporting and repairs
- Express server
server/server.js - Report endpoints
server/routes/reportroute.js - Roboflow detection
- Image GPS OCR
server/routes/reportroute.js
Data and rewards
- User records
server/models/User.js - Pothole records
server/models/Pothole.js - Reward calculations
server/utils/rewards.js - MongoDB
Other components
- Commuter
Connections 36
- Commuter → Home page: opens app
- App routing → Home page: routes to
client/src/App.jsx - App routing → Report form: routes to
client/src/App.jsx - App routing → Pothole map: routes to
client/src/App.jsx - App routing → Commuter dashboard: routes to
client/src/App.jsx - App routing → Municipal dashboard: routes to
client/src/App.jsx - App routing → Admin dashboard: routes to
client/src/App.jsx - App routing → Profile: routes to
client/src/App.jsx - App routing → Team page: routes to
client/src/App.jsx - Home page → Login and signup: opens
client/src/components/HomePage.jsx - Login and signup → Auth state: submits credentials
client/src/components/auth/AuthModal.jsx - Auth state → API configuration: uses API base
client/src/context/AuthContext.jsx - OTP recovery → API configuration: uses API base
client/src/config/api.js - Password reset → API configuration: uses API base
client/src/config/api.js - Auth state → Auth endpoints: calls auth API
client/src/context/AuthContext.jsx - Report form → Report endpoints: submits report
README.md - Pothole map → Report endpoints: fetches potholes
README.md - Commuter dashboard → Report endpoints: fetches reports
README.md - Municipal dashboard → Report endpoints: fetches repair data
README.md - Admin dashboard → Auth endpoints: manages users
server/routes/auth.js - Express server → Auth endpoints: mounts routes
server/server.js - Express server → Report endpoints: mounts routes
server/server.js - Express server → MongoDB: connects before serving
server/server.js - Report endpoints → Roboflow detection: validates image
server/routes/reportroute.js - Report endpoints → Image GPS OCR: extracts coordinates
server/routes/reportroute.js - Report endpoints → Pothole records: saves and queries
server/routes/reportroute.js - Report endpoints → User records: assigns staff
server/routes/reportroute.js - Report endpoints → Reward calculations: updates rewards
server/routes/reportroute.js - Auth endpoints → Auth middleware: guards admin routes
server/routes/auth.js - Auth middleware → User records: loads user
server/middleware/auth.js - Auth endpoints → User records: reads and writes
server/routes/auth.js - Auth endpoints → Reward calculations: calculates profile level
server/routes/auth.js - Pothole records → MongoDB: persists records
README.md - User records → MongoDB: persists accounts
README.md - Report endpoints → Roboflow detection: AI verification
README.md - Report endpoints → MongoDB: stores report image
README.md