# daddypigpapa/emergency_callup architecture

> Architecture diagram of the GitHub repository daddypigpapa/emergency_callup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/daddypigpapa/emergency_callup
- Repository: https://github.com/daddypigpapa/emergency_callup

## Overview

This is a browser-based emergency personnel mobilization and location-tracking system. Administrators prepare rosters, mission areas and team plans, open an incident, notify responders by SMS, monitor GPS progress and arrival, change assignments, then close the incident and export attendance records. Field personnel log in, view their assignment and map, and share location during an active incident. The graph reflects README-documented workflows and the sampled server wiring; several domain implementations were not excerpted, so uncertain internal links are omitted.

Main entry points: [`internal/httpapi/server.go`](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/server.go) (HTTP server), [`internal/httpapi/admin_incident.go`](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_incident.go) (Incident operations), [`internal/incident/store.go`](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/incident/store.go) (Incident and assignments), [`web/f/f.js`](https://github.com/daddypigpapa/emergency_callup/blob/main/web/f/f.js) (Field screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["Web clients"]
  node_admin_ui["Admin console<br/>[a.js]"]
  node_setup_ui["Setup screens<br/>[setup.js]"]
  node_field_ui["Field screen<br/>[f.js]"]
  node_field_map["Field map<br/>[map.js]"]
  node_grid_logic["Grid utilities<br/>[grid.js]"]
end

subgraph group_api["HTTP and access"]
  node_http_server["HTTP server<br/>[server.go]"]
  node_admin_access["Admin authentication<br/>[admin_auth.go]"]
  node_member_access["Member authentication<br/>[member_auth.go]"]
end

subgraph group_operations["Incident operations"]
  node_roster["Roster management<br/>[store.go]"]
  node_areas["Mission areas<br/>[store.go]"]
  node_team_plans["Team plans<br/>[plan.go]"]
  node_incident_api["Incident operations<br/>[admin_incident.go]"]
  node_incident_state["Incident and assignments<br/>[store.go]"]
  node_location_tracking["Location and arrival<br/>[tracker.go]"]
  node_sms_service["SMS preparation<br/>[service.go]"]
  node_reports["Incident reports<br/>[admin_report.go]"]
end

subgraph group_platform["Persistence and integrations"]
  node_database[("SQLite database<br/>[store.go]")]
  node_audit["Audit log<br/>[audit.go]"]
  node_backup["Database backup<br/>[backup.go]"]
  node_sms_provider["SMS provider<br/>[http_provider.go]"]
  node_geo_service["VWorld geocoding<br/>[vworld.go]"]
end

node_administrator(("Administrator"))
node_responder(("Field responder"))

node_administrator -->|"uses"| node_admin_ui
node_responder -->|"uses"| node_field_ui
node_admin_ui -->|"requests"| node_http_server
node_setup_ui -->|"calls setup APIs"| node_http_server
node_field_ui -->|"calls field APIs"| node_http_server
node_field_ui -->|"renders map"| node_field_map
node_field_map -->|"uses grid logic"| node_grid_logic
node_http_server -->|"routes admin login"| node_admin_access
node_http_server -->|"routes member login"| node_member_access
node_http_server -->|"constructs store"| node_roster
node_http_server -->|"constructs store"| node_areas
node_http_server -->|"constructs store"| node_team_plans
node_http_server -->|"constructs store"| node_incident_state
node_administrator -->|"maintains setup"| node_setup_ui
node_administrator -->|"opens and manages"| node_incident_api
node_incident_api -->|"creates assignments"| node_incident_state
node_incident_api -->|"monitors progress"| node_location_tracking
node_responder -->|"shares GPS"| node_location_tracking
node_incident_api -->|"prepares messages"| node_sms_service
node_sms_service -->|"sends messages"| node_sms_provider
node_administrator -->|"downloads records"| node_reports
node_http_server -->|"wires persistence"| node_database
node_http_server -->|"serves geocoding"| node_geo_service
node_incident_state -->|"reads area plans"| node_areas
node_incident_state -->|"loads team plan"| node_team_plans
node_incident_api -->|"records sensitive actions"| node_audit
node_http_server -->|"backs up on closure"| node_backup

click node_admin_ui "https://github.com/daddypigpapa/emergency_callup/blob/main/web/a/a.js"
click node_setup_ui "https://github.com/daddypigpapa/emergency_callup/blob/main/web/a/setup.js"
click node_field_ui "https://github.com/daddypigpapa/emergency_callup/blob/main/web/f/f.js"
click node_field_map "https://github.com/daddypigpapa/emergency_callup/blob/main/web/shared/map.js"
click node_http_server "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/server.go"
click node_admin_access "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_auth.go"
click node_member_access "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/member_auth.go"
click node_roster "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/roster/store.go"
click node_areas "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/area/store.go"
click node_team_plans "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/incident/plan.go"
click node_incident_api "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_incident.go"
click node_incident_state "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/incident/store.go"
click node_location_tracking "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/tracker/tracker.go"
click node_sms_service "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/sms/service.go"
click node_reports "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_report.go"
click node_database "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/store/store.go"
click node_audit "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/audit/audit.go"
click node_backup "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/store/backup.go"
click node_sms_provider "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/sms/http_provider.go"
click node_geo_service "https://github.com/daddypigpapa/emergency_callup/blob/main/internal/geo/vworld.go"
click node_grid_logic "https://github.com/daddypigpapa/emergency_callup/blob/main/web/shared/grid.js"

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_admin_ui,node_setup_ui,node_field_ui,node_field_map,node_grid_logic toneBlue
class node_http_server,node_admin_access,node_member_access toneAmber
class node_roster,node_areas,node_team_plans,node_incident_api,node_incident_state,node_location_tracking,node_sms_service,node_reports toneMint
class node_database,node_audit,node_backup,node_sms_provider,node_geo_service toneRose
class node_administrator,node_responder toneIndigo
```

## Components

### Web clients

- [Admin console](https://github.com/daddypigpapa/emergency_callup/blob/main/web/a/a.js): `web/a/a.js`
- [Setup screens](https://github.com/daddypigpapa/emergency_callup/blob/main/web/a/setup.js): `web/a/setup.js`
- [Field screen](https://github.com/daddypigpapa/emergency_callup/blob/main/web/f/f.js): `web/f/f.js`
- [Field map](https://github.com/daddypigpapa/emergency_callup/blob/main/web/shared/map.js): `web/shared/map.js`
- [Grid utilities](https://github.com/daddypigpapa/emergency_callup/blob/main/web/shared/grid.js): `web/shared/grid.js`

### HTTP and access

- [HTTP server](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/server.go): `internal/httpapi/server.go`
- [Admin authentication](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_auth.go): `internal/httpapi/admin_auth.go`
- [Member authentication](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/member_auth.go): `internal/httpapi/member_auth.go`

### Incident operations

- [Roster management](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/roster/store.go): `internal/roster/store.go`
- [Mission areas](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/area/store.go): `internal/area/store.go`
- [Team plans](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/incident/plan.go): `internal/incident/plan.go`
- [Incident operations](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_incident.go): `internal/httpapi/admin_incident.go`
- [Incident and assignments](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/incident/store.go): `internal/incident/store.go`
- [Location and arrival](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/tracker/tracker.go): `internal/tracker/tracker.go`
- [SMS preparation](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/sms/service.go): `internal/sms/service.go`
- [Incident reports](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/httpapi/admin_report.go): `internal/httpapi/admin_report.go`

### Persistence and integrations

- [SQLite database](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/store/store.go): `internal/store/store.go`
- [Audit log](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/audit/audit.go): `internal/audit/audit.go`
- [Database backup](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/store/backup.go): `internal/store/backup.go`
- [SMS provider](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/sms/http_provider.go): `internal/sms/http_provider.go`
- [VWorld geocoding](https://github.com/daddypigpapa/emergency_callup/blob/main/internal/geo/vworld.go): `internal/geo/vworld.go`

### Other components

- **Administrator**
- **Field responder**

## Connections

- Administrator → Admin console: uses
- Field responder → Field screen: uses
- Admin console → HTTP server: requests
- Setup screens → HTTP server: calls setup APIs (evidence: `web/a/setup.js`)
- Field screen → HTTP server: calls field APIs (evidence: `web/f/f.js`)
- Field screen → Field map: renders map (evidence: `web/f/f.js`)
- Field map → Grid utilities: uses grid logic (evidence: `web/shared/map.js`)
- HTTP server → Admin authentication: routes admin login (evidence: `internal/httpapi/server.go`)
- HTTP server → Member authentication: routes member login (evidence: `internal/httpapi/server.go`)
- HTTP server → Roster management: constructs store (evidence: `internal/httpapi/server.go`)
- HTTP server → Mission areas: constructs store (evidence: `internal/httpapi/server.go`)
- HTTP server → Team plans: constructs store (evidence: `internal/httpapi/server.go`)
- HTTP server → Incident and assignments: constructs store (evidence: `internal/httpapi/server.go`)
- Administrator → Setup screens: maintains setup
- Administrator → Incident operations: opens and manages
- Incident operations → Incident and assignments: creates assignments
- Incident operations → Location and arrival: monitors progress
- Field responder → Location and arrival: shares GPS
- Incident operations → SMS preparation: prepares messages
- SMS preparation → SMS provider: sends messages (evidence: `internal/sms/service.go`)
- Administrator → Incident reports: downloads records
- HTTP server → SQLite database: wires persistence (evidence: `internal/httpapi/server.go`)
- HTTP server → VWorld geocoding: serves geocoding (evidence: `internal/httpapi/server.go`)
- Incident and assignments → Mission areas: reads area plans (evidence: `internal/incident/store.go`)
- Incident and assignments → Team plans: loads team plan (evidence: `internal/incident/store.go`)
- Incident operations → Audit log: records sensitive actions
- HTTP server → Database backup: backs up on closure (evidence: `internal/httpapi/server.go`)
