# manikantatangi/women-safety-quantum-gdg architecture

> Architecture diagram of the GitHub repository manikantatangi/women-safety-quantum-gdg, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/manikantatangi/women-safety-quantum-gdg
- Repository: https://github.com/manikantatangi/women-safety-quantum-gdg

## Overview

This is a web-based emergency-response routing MVP: a user sends an SOS with live coordinates, the backend obtains alternative driving routes from OSRM, normalizes their ETAs, and asks a Cirq-based optimizer to select a route. The response includes police and victim locations plus route geometries; the frontend displays the chosen route and alternatives on a map. The README also describes safety information and emergency numbers in the interface. Those interface details are represented from the documented structure, while the sampled source does not show their implementation or any real police dispatch integration.

Main entry points: [`backend/main.py`](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py) (SOS handler), [`frontend/app.js`](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/app.js) (Location capture), [`backend/quantum.py`](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/quantum.py) (Quantum optimizer), [`frontend/index.html`](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html) (SOS interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_sos_ui["SOS interface<br/>[index.html]"]
  node_safety_info["Safety information<br/>[index.html]"]
  node_emergency_numbers["Emergency numbers<br/>[index.html]"]
  node_location_capture["Location capture<br/>[app.js]"]
  node_map_view["Route map<br/>[app.js]"]
end

subgraph group_backend["SOS backend"]
  node_sos_endpoint["SOS handler<br/>[main.py]"]
  node_station_estimate["Police location estimate<br/>[main.py]"]
  node_route_fetch["Route fetching<br/>[main.py]"]
  node_eta_normalize["ETA cost normalization<br/>[main.py]"]
  node_response_build["Response assembly<br/>[main.py]"]
end

subgraph group_optimization["Route optimization"]
  node_quantum_optimizer["Quantum optimizer<br/>[quantum.py]"]
end

subgraph group_integrations["External services"]
  node_browser_geo["Browser geolocation"]
  node_osrm["OSRM routing"]
  node_cirq_simulator["Cirq simulator"]
  node_leaflet["Leaflet mapping"]
  node_osm_tiles["OpenStreetMap tiles"]
end

node_user(("User"))

node_user -->|"presses SOS"| node_sos_ui
node_user -->|"views"| node_safety_info
node_user -->|"views"| node_emergency_numbers
node_sos_ui -->|"starts capture"| node_location_capture
node_location_capture -->|"requests coordinates"| node_browser_geo
node_browser_geo -->|"returns coordinates"| node_location_capture
node_location_capture -->|"posts coordinates"| node_sos_endpoint
node_sos_endpoint -->|"derives location"| node_station_estimate
node_sos_endpoint -->|"requests routes"| node_route_fetch
node_route_fetch -->|"requests alternatives"| node_osrm
node_osrm -->|"returns routes"| node_route_fetch
node_sos_endpoint -->|"normalizes ETAs"| node_eta_normalize
node_eta_normalize -->|"provides costs"| node_quantum_optimizer
node_quantum_optimizer -->|"runs circuit"| node_cirq_simulator
node_quantum_optimizer -->|"returns selection"| node_sos_endpoint
node_sos_endpoint -->|"assembles result"| node_response_build
node_response_build -->|"returns response"| node_location_capture
node_location_capture -->|"renders result"| node_map_view
node_map_view -->|"draws map"| node_leaflet
node_leaflet -->|"loads tiles"| node_osm_tiles

click node_sos_ui "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html"
click node_safety_info "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html"
click node_emergency_numbers "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html"
click node_location_capture "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/app.js"
click node_map_view "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/app.js"
click node_sos_endpoint "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py"
click node_station_estimate "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py"
click node_route_fetch "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py"
click node_eta_normalize "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py"
click node_response_build "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py"
click node_quantum_optimizer "https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/quantum.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_sos_ui,node_safety_info,node_emergency_numbers,node_location_capture,node_map_view,node_user toneBlue
class node_sos_endpoint,node_station_estimate,node_route_fetch,node_eta_normalize,node_response_build toneAmber
class node_quantum_optimizer toneMint
class node_browser_geo,node_osrm,node_cirq_simulator,node_leaflet,node_osm_tiles toneRose
```

## Components

### Web interface

- [SOS interface](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html): `frontend/index.html`
- [Safety information](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html): `frontend/index.html`
- [Emergency numbers](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/index.html): `frontend/index.html`
- [Location capture](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/app.js): `frontend/app.js`
- [Route map](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/frontend/app.js): `frontend/app.js`

### SOS backend

- [SOS handler](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py): `backend/main.py`
- [Police location estimate](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py): `backend/main.py`
- [Route fetching](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py): `backend/main.py`
- [ETA cost normalization](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py): `backend/main.py`
- [Response assembly](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/main.py): `backend/main.py`

### Route optimization

- [Quantum optimizer](https://github.com/manikantatangi/women-safety-quantum-gdg/blob/main/backend/quantum.py): `backend/quantum.py`

### External services

- **Browser geolocation**
- **OSRM routing**
- **Cirq simulator**
- **Leaflet mapping**
- **OpenStreetMap tiles**

### Other components

- **User**

## Connections

- User → SOS interface: presses SOS
- User → Safety information: views
- User → Emergency numbers: views
- SOS interface → Location capture: starts capture
- Location capture → Browser geolocation: requests coordinates
- Browser geolocation → Location capture: returns coordinates
- Location capture → SOS handler: posts coordinates
- SOS handler → Police location estimate: derives location
- SOS handler → Route fetching: requests routes
- Route fetching → OSRM routing: requests alternatives
- OSRM routing → Route fetching: returns routes
- SOS handler → ETA cost normalization: normalizes ETAs
- ETA cost normalization → Quantum optimizer: provides costs
- Quantum optimizer → Cirq simulator: runs circuit
- Quantum optimizer → SOS handler: returns selection
- SOS handler → Response assembly: assembles result
- Response assembly → Location capture: returns response
- Location capture → Route map: renders result
- Route map → Leaflet mapping: draws map
- Leaflet mapping → OpenStreetMap tiles: loads tiles
