How hrishabhkumarsingh/campus-safe works
Campus Safe is a campus emergency assistance and incident coordination platform with a public SOS experience and a role-based campus portal. The main workflow starts with an SOS alert or student complaint, routes it to appropriate staff, supports acknowledgement, assignment, updates and resolution, and delivers notifications and live incident changes. Admin capabilities include analytics, exports, user and routing configuration, escalation settings and audit review; simulations provide a separate practice workflow. The graph reflects documented capabilities and indexed imports; unsampled route details are not inferred.
Main entry points: index.js API and socket server · db.js PostgreSQL · App.jsx Client routing · incidents.js Incident operations
Components 24
Campus experiences
- Public SOS
client/src/pages/Home.jsx - Complaint reporting
client/src/pages/ReportIncident.jsx - Staff dashboard
client/src/pages/Dashboard.jsx - Incident list
client/src/components/IncidentList.jsx - Incident detail
client/src/pages/IncidentDetail.jsx - Notifications page
client/src/pages/Notifications.jsx - Safety guidance
client/src/pages/Safety.jsx - Client routing
client/src/App.jsx
Incident coordination
- API and socket server
server/src/index.js - Authentication
server/src/routes/auth.js - JWT and role checks
server/src/auth.js - SOS intake
server/src/routes/public.js - Incident operations
server/src/routes/incidents.js - Visibility and status rules
server/src/services.js - Persist and push
server/src/notify.js - Responders and notifications
server/src/routes/misc.js
Administration and practice
- Admin and analytics
server/src/routes/admin.js - Simulation workflow
server/src/routes/simulations.js
Shared platform
- Session and realtime
client/src/context.jsx - HTTP client
client/src/lib/api.js - Shared UI
client/src/components/ui.jsx - PostgreSQL
server/src/db.js
Other components
- Public reporter
- Portal user
Connections 41
- Public reporter → Public SOS: opens SOS
README.md - Portal user → Client routing: opens portal
README.md - Client routing → Public SOS: routes to
client/src/App.jsx - Client routing → Staff dashboard: routes to
client/src/App.jsx - Client routing → Incident detail: routes to
client/src/App.jsx - Client routing → Complaint reporting: routes to
client/src/App.jsx - Client routing → Notifications page: routes to
client/src/App.jsx - Client routing → Safety guidance: routes to
client/src/App.jsx - Staff dashboard → Incident list: renders
client/src/pages/Dashboard.jsx - Incident detail → Shared UI: uses
client/src/pages/IncidentDetail.jsx - Incident list → HTTP client: fetches incidents
client/src/components/IncidentList.jsx - Incident list → Session and realtime: subscribes to events
client/src/components/IncidentList.jsx - Public SOS → HTTP client: submits SOS
client/src/pages/Home.jsx - Complaint reporting → HTTP client: submits complaint
client/src/pages/ReportIncident.jsx - Incident detail → HTTP client: loads and updates
client/src/pages/IncidentDetail.jsx - Session and realtime → HTTP client: authenticates and loads notes
client/src/context.jsx - Session and realtime → API and socket server: connects by socket
client/src/context.jsx - Public SOS → API and socket server: calls backend
README.md - Complaint reporting → API and socket server: calls backend
README.md - API and socket server → Authentication: mounts
server/src/index.js - API and socket server → SOS intake: mounts
server/src/index.js - API and socket server → Incident operations: mounts
server/src/index.js - API and socket server → Responders and notifications: mounts
server/src/index.js - API and socket server → Admin and analytics: mounts
server/src/index.js - API and socket server → Simulation workflow: mounts
server/src/index.js - Authentication → PostgreSQL: queries
server/src/routes/auth.js - JWT and role checks → PostgreSQL: loads account
server/src/auth.js - SOS intake → PostgreSQL: stores alerts
server/src/routes/public.js - SOS intake → Visibility and status rules: uses incident rules
server/src/routes/public.js - Incident operations → PostgreSQL: queries and updates
server/src/routes/incidents.js - Incident operations → JWT and role checks: checks access
server/src/routes/incidents.js - Incident operations → Visibility and status rules: applies rules
server/src/routes/incidents.js - Incident operations → Persist and push: notifies team
server/src/routes/incidents.js - Visibility and status rules → PostgreSQL: reads and writes
server/src/services.js - Visibility and status rules → Persist and push: sends updates
server/src/services.js - Persist and push → PostgreSQL: persists notifications
server/src/notify.js - Responders and notifications → PostgreSQL: queries
server/src/routes/misc.js - Admin and analytics → PostgreSQL: queries and configures
server/src/routes/admin.js - Simulation workflow → PostgreSQL: records simulations
server/src/routes/simulations.js - API and socket server → Persist and push: configures socket delivery
server/src/index.js - API and socket server → PostgreSQL: runs escalation sweep
server/src/index.js