# mo7amedrabei14-cell/eoc-system architecture

> Architecture diagram of the GitHub repository mo7amedrabei14-cell/eoc-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mo7amedrabei14-cell/eoc-system
- Repository: https://github.com/mo7amedrabei14-cell/eoc-system

## Overview

This is an emergency-operations coordination application: staff sign in, then use a dashboard to work with missions and related operational records. The backend also provides user, volunteer, and branch management, with permission checks and PostgreSQL access; the monolithic API contains additional radar, weather, and local-news functionality. The graph distinguishes those domains and includes frontend health/error handling. README content was unavailable, and several core frontend modules were not sampled, so their internal behavior and most frontend-to-API links are not inferred.

Main entry points: [`main.py`](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/main.py) (Operations API), [`frontend/src/Login.jsx`](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/Login.jsx) (Sign in), [`dependencies.py`](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/dependencies.py) (Request dependencies), [`routers/missions.py`](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/missions.py) (Mission operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app_boot["App bootstrap<br/>[main.jsx]"]
  node_app_routes["App routes<br/>[App.jsx]"]
  node_login["Sign in<br/>[Login.jsx]"]
  node_dashboard["Operations dashboard<br/>[Dashboard.jsx]"]
  node_segment_inputs["Segment inputs<br/>[SegInputs.jsx]"]
  node_api_base["API base config<br/>[apiBase.js]"]
  node_health_ui["Server health UI<br/>[serverHealth.jsx]"]
  node_health_check["Health checks"]
  node_client_errors["Client error reporting"]
  node_workspace["Workspace state<br/>[workspace.js]"]
end

subgraph group_api["API and operations"]
  node_api["Operations API<br/>[main.py]"]
  node_missions["Mission operations<br/>[missions.py]"]
  node_users["User administration<br/>[users.py]"]
  node_volunteers["Volunteer registry<br/>[volunteers.py]"]
  node_branches["Branch directory<br/>[branches.py]"]
  node_realtime["Realtime events<br/>[realtime.py]"]
  node_audit["Audit logging<br/>[audit.py]"]
end

subgraph group_security["Identity and access"]
  node_request_access["Request dependencies<br/>[dependencies.py]"]
  node_auth["Authentication and permissions<br/>[auth.py]"]
end

subgraph group_persistence["Persistence"]
  node_db_access["Database connections<br/>[db.py]"]
  node_database[("PostgreSQL")]
end

node_operator(("Operations staff"))

node_operator -->|"signs in"| node_login
node_operator -->|"uses"| node_dashboard
node_app_boot -->|"loads"| node_app_routes
node_app_routes -->|"routes to"| node_login
node_app_routes -->|"routes to"| node_dashboard
node_login -->|"requests token"| node_api
node_login -->|"uses base"| node_api_base
node_login -->|"renders"| node_health_ui
node_login -->|"checks health"| node_health_check
node_health_ui -->|"uses"| node_health_check
node_health_check -->|"uses base"| node_api_base
node_app_boot -->|"installs reporting"| node_client_errors
node_api -->|"routes to"| node_missions
node_api -->|"routes to"| node_users
node_api -->|"routes to"| node_volunteers
node_api -->|"routes to"| node_branches
node_api -->|"uses"| node_realtime
node_api -->|"uses"| node_audit
node_api -->|"uses"| node_db_access
node_missions -->|"depends on"| node_request_access
node_users -->|"depends on"| node_request_access
node_volunteers -->|"depends on"| node_request_access
node_branches -->|"depends on"| node_request_access
node_missions -->|"records actions"| node_audit
node_request_access -->|"checks identity"| node_auth
node_request_access -->|"gets connection"| node_db_access
node_auth -->|"queries"| node_db_access
node_missions -->|"reads and writes"| node_database
node_users -->|"reads and writes"| node_database
node_volunteers -->|"reads and writes"| node_database
node_branches -->|"reads"| node_database
node_db_access -.->|"connects"| node_database

click node_app_boot "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/main.jsx"
click node_app_routes "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/App.jsx"
click node_login "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/Login.jsx"
click node_dashboard "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/Dashboard.jsx"
click node_segment_inputs "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/SegInputs.jsx"
click node_api_base "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/apiBase.js"
click node_health_ui "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/serverHealth.jsx"
click node_health_check "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/serverHealthCore.js"
click node_client_errors "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/clientErrorReport.js"
click node_workspace "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/workspace.js"
click node_api "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/main.py"
click node_missions "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/missions.py"
click node_users "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/users.py"
click node_volunteers "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/volunteers.py"
click node_branches "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/branches.py"
click node_realtime "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/realtime.py"
click node_audit "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/audit.py"
click node_request_access "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/dependencies.py"
click node_auth "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/auth.py"
click node_db_access "https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/db.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_app_boot,node_app_routes,node_login,node_dashboard,node_segment_inputs,node_api_base,node_health_ui,node_health_check,node_client_errors,node_workspace toneBlue
class node_api,node_missions,node_users,node_volunteers,node_branches,node_realtime,node_audit toneAmber
class node_request_access,node_auth toneMint
class node_db_access,node_database toneRose
class node_operator toneIndigo
```

## Components

### Web application

- [App bootstrap](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [App routes](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Sign in](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/Login.jsx): `frontend/src/Login.jsx`
- [Operations dashboard](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/Dashboard.jsx): `frontend/src/Dashboard.jsx`
- [Segment inputs](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/SegInputs.jsx): `frontend/src/SegInputs.jsx`
- [API base config](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/apiBase.js): `frontend/src/apiBase.js`
- [Server health UI](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/serverHealth.jsx): `frontend/src/serverHealth.jsx`
- [Health checks](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/serverHealthCore.js): `frontend/src/serverHealthCore.js`
- [Client error reporting](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/clientErrorReport.js): `frontend/src/clientErrorReport.js`
- [Workspace state](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/frontend/src/workspace.js): `frontend/src/workspace.js`

### API and operations

- [Operations API](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/main.py): `main.py`
- [Mission operations](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/missions.py): `routers/missions.py`
- [User administration](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/users.py): `routers/users.py`
- [Volunteer registry](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/volunteers.py): `routers/volunteers.py`
- [Branch directory](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/routers/branches.py): `routers/branches.py`
- [Realtime events](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/realtime.py): `realtime.py`
- [Audit logging](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/audit.py): `audit.py`

### Identity and access

- [Request dependencies](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/dependencies.py): `dependencies.py`
- [Authentication and permissions](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/auth.py): `auth.py`

### Persistence

- [Database connections](https://github.com/mo7amedrabei14-cell/eoc-system/blob/main/db.py): `db.py`
- **PostgreSQL**

### Other components

- **Operations staff**

## Connections

- Operations staff → Sign in: signs in (evidence: `frontend/src/Login.jsx`)
- Operations staff → Operations dashboard: uses
- App bootstrap → App routes: loads (evidence: `frontend/src/main.jsx`)
- App routes → Sign in: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Operations dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Sign in → Operations API: requests token (evidence: `frontend/src/Login.jsx`)
- Sign in → API base config: uses base (evidence: `frontend/src/Login.jsx`)
- Sign in → Server health UI: renders (evidence: `frontend/src/Login.jsx`)
- Sign in → Health checks: checks health (evidence: `frontend/src/Login.jsx`)
- Server health UI → Health checks: uses (evidence: `frontend/src/serverHealth.jsx`)
- Health checks → API base config: uses base (evidence: `frontend/src/serverHealthCore.js`)
- App bootstrap → Client error reporting: installs reporting (evidence: `frontend/src/main.jsx`)
- Operations API → Mission operations: routes to (evidence: `main.py`)
- Operations API → User administration: routes to (evidence: `main.py`)
- Operations API → Volunteer registry: routes to (evidence: `main.py`)
- Operations API → Branch directory: routes to (evidence: `main.py`)
- Operations API → Realtime events: uses (evidence: `main.py`)
- Operations API → Audit logging: uses (evidence: `main.py`)
- Operations API → Database connections: uses (evidence: `main.py`)
- Mission operations → Request dependencies: depends on (evidence: `routers/missions.py`)
- User administration → Request dependencies: depends on (evidence: `routers/users.py`)
- Volunteer registry → Request dependencies: depends on (evidence: `routers/volunteers.py`)
- Branch directory → Request dependencies: depends on (evidence: `routers/branches.py`)
- Mission operations → Audit logging: records actions (evidence: `routers/missions.py`)
- Request dependencies → Authentication and permissions: checks identity (evidence: `dependencies.py`)
- Request dependencies → Database connections: gets connection (evidence: `dependencies.py`)
- Authentication and permissions → Database connections: queries (evidence: `auth.py`)
- Mission operations → PostgreSQL: reads and writes (evidence: `routers/missions.py`)
- User administration → PostgreSQL: reads and writes (evidence: `routers/users.py`)
- Volunteer registry → PostgreSQL: reads and writes (evidence: `routers/volunteers.py`)
- Branch directory → PostgreSQL: reads (evidence: `routers/branches.py`)
- Database connections → PostgreSQL: connects
