How sonpari-codes/civicsonic works
Suraksha is a browser-based crime-reporting and mapping application with a FastAPI, spatial-data backend. The main workflow lets a user choose a location and submit a report, which the API stores as a geographic incident; the live map fetches incidents as GeoJSON and displays them. The repository also includes landing, login, home, and SOS interfaces. The SOS and authentication flows appear to be frontend-only in the sampled code; no alert dispatch or authentication service is evidenced.
Main entry points: main.py Crime API · LOGIN PAGE/script.js Login interface · database.py Database sessions · REPORT PAGE/script.js Report form and map
Components 12
Web experience
- Landing page
Suraksha/LANDING PAGE/script.js - Login interface
Suraksha/LOGIN PAGE/script.js - Home page
Suraksha/HOME PAGE/script.js - SOS interface
Suraksha/SOS EMERGENCY PAGE/script.js
Crime reporting
- Report form and map
Suraksha/REPORT PAGE/script.js - Live incident map
Suraksha/VIEW LIVE MAP PAGE/map.js
API and spatial data
- Crime API
main.py - Request and response schemas
schemas.py
Spatial storage
- Incident spatial model
model.py - Database sessions
database.py
Other components
- Visitor
- Supabase PostGIS
Connections 15
- Visitor → Landing page: opens
Suraksha/LANDING PAGE/script.js - Visitor → Login interface: opens
Suraksha/LOGIN PAGE/script.js - Login interface → Home page: navigates to
Suraksha/LOGIN PAGE/script.js - Login interface → Landing page: navigates to
Suraksha/LOGIN PAGE/script.js - Visitor → Home page: uses
Suraksha/HOME PAGE/script.js - Visitor → SOS interface: activates
Suraksha/SOS EMERGENCY PAGE/script.js - Visitor → Report form and map: submits incident
Suraksha/REPORT PAGE/script.js - Report form and map → Crime API: POSTs report
Suraksha/REPORT PAGE/script.js - Visitor → Live incident map: views incidents
Suraksha/VIEW LIVE MAP PAGE/map.js - Live incident map → Crime API: GETs GeoJSON
Suraksha/VIEW LIVE MAP PAGE/map.js - Crime API → Request and response schemas: accepts payload
main.py - Crime API → Incident spatial model: creates and queries
main.py - Crime API → Database sessions: opens sessions
main.py - Incident spatial model → Database sessions: uses base
model.py - Database sessions → Supabase PostGIS: configures connection
README.md