How sanketsawant72/civic-sense works
CivicSense lets residents report and track civic issues while department staff and administrators manage them. The main workflow is photo/location-assisted reporting, duplicate-warning checks, optional AI photo verification, API persistence, and staff resolution. The graph uses the src/ frontend tree and Express/MongoDB services; the duplicate frontend/ tree is omitted. Some page and route internals were not sampled, so documented links are shown from the README and uncertain implementation details are left out.
Main entry points: App.jsx React application · complaints.js Complaint routes · index.js Express API · main.py AI verification API
Components 22
Citizen and staff app
- React application
src/App.jsx - Issue reporting
src/pages/ReportIssue.jsx - Complaint views
src/pages - Staff management
src/pages/admin - Department workspace
src/pages/department - Auth state
src/store/useAuthStore.js - Complaint state
src/store/useStore.js - API client
src/utils/api.js
Complaint operations
- Express API
server/index.js - Complaint routes
server/routes/complaints.js - Duplicate matching
server/utils/complaintSimilarity.js - Department routes
server/routes/departments.js - Complaint model
server/models/Complaint.js - Notification model
server/models/Notification.js - MongoDB
Identity and access
- Auth routes
server/routes/auth.js - JWT middleware
server/middleware/auth.js - User model
server/models/User.js
Photo verification
- AI verification API
ai-service/main.py - Civic image model
ai-service/civic_ml.py
Other components
- Resident or staff
- Gemini service
Connections 20
- Resident or staff → React application: uses
README.md - React application → Issue reporting: offers reporting
README.md - React application → Complaint views: offers tracking
README.md - React application → Staff management: offers admin tools
README.md - React application → Department workspace: offers department tools
README.md - Complaint state → API client: calls
src/store/useStore.js - API client → Express API: sends requests
README.md - Express API → Complaint routes: routes requests
- Complaint routes → Duplicate matching: checks matches
README.md - Complaint routes → Complaint model: persists complaints
README.md - Complaint model → MongoDB: reads and writes
README.md - Department routes → MongoDB: reads and writes
- Auth routes → User model: queries users
server/routes/auth.js - Auth routes → JWT middleware: uses protection
server/routes/auth.js - JWT middleware → User model: loads user
server/middleware/auth.js - User model → MongoDB: stores accounts
README.md - Express API → AI verification API: calls optional verifier
README.md - AI verification API → Civic image model: may load model
README.md - AI verification API → Gemini service: classifies images
README.md - Complaint routes → Notification model: may create notifications