# rodri1988/evacuacion-pee architecture

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

- Interactive diagram: https://gitdiagram.com/rodri1988/evacuacion-pee
- Repository: https://github.com/rodri1988/evacuacion-pee

## Overview

PEE is a mobile evacuation-counting and incident-coordination web app. The main workflow is brigade staff using the interface to record counts at meeting points; the app synchronizes shared state through Firebase, presents command-post totals and missing-person observations, and can open a printable fire-service report. Shared timer and event-reset controls support incident coordination. The README also describes browser-local persistence and a nominative/RUT register. The sampled code confirms Firebase authentication and realtime operations, but does not expose all rendering or persistence details, so some capability links rely on README documentation.

Main entry points: [`index.html`](https://github.com/rodri1988/evacuacion-pee/blob/main/index.html) (Web interface), [`js/firebase-config.js`](https://github.com/rodri1988/evacuacion-pee/blob/main/js/firebase-config.js) (Firebase configuration), [`js/app.js`](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js) (PEE counter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_incident["Incident workflow"]
  node_counter["PEE counter<br/>[app.js]"]
  node_command["Command-post totals<br/>[app.js]"]
  node_observations["Missing-person register<br/>[app.js]"]
  node_nominative["Nominative / RUT<br/>[app.js]"]
  node_report["Fire-service report<br/>[app.js]"]
end

subgraph group_coordination["Coordination tools"]
  node_timer["Shared evacuation timer<br/>[app.js]"]
  node_event_reset["Event reset<br/>[app.js]"]
end

subgraph group_platform["App and services"]
  node_interface["Web interface<br/>[index.html]"]
  node_auth["Brigade authentication<br/>[app.js]"]
  node_sync["Realtime synchronization<br/>[app.js]"]
  node_firebase_config["Firebase configuration<br/>[firebase-config.js]"]
  node_firebase_auth["Firebase Auth"]
  node_firebase_db[("Firebase Realtime DB")]
  node_local_storage[("Browser persistence")]
end

node_staff(("Brigade staff"))

node_staff -->|"uses"| node_interface
node_interface -->|"records counts"| node_counter
node_interface -->|"views totals"| node_command
node_interface -->|"records names"| node_observations
node_interface -->|"records RUT"| node_nominative
node_interface -->|"prints report"| node_report
node_interface -.->|"controls timer"| node_timer
node_interface -.->|"resets event"| node_event_reset
node_auth -->|"signs in"| node_firebase_auth
node_sync -->|"subscribes and writes"| node_firebase_db
node_counter -->|"updates counts"| node_firebase_db
node_observations -->|"updates records"| node_firebase_db
node_command -.->|"reads shared state"| node_firebase_db
node_timer -.->|"writes shared timer"| node_firebase_db
node_event_reset -->|"clears event data"| node_firebase_db
node_firebase_config -.->|"configures app"| node_auth
node_firebase_config -.->|"configures app"| node_sync
node_interface -.->|"persists data"| node_local_storage

click node_interface "https://github.com/rodri1988/evacuacion-pee/blob/main/index.html"
click node_counter "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_command "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_observations "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_nominative "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_report "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_timer "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_event_reset "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_auth "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_sync "https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js"
click node_firebase_config "https://github.com/rodri1988/evacuacion-pee/blob/main/js/firebase-config.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_counter,node_command,node_observations,node_nominative,node_report toneBlue
class node_timer,node_event_reset toneAmber
class node_interface,node_auth,node_sync,node_firebase_config,node_firebase_auth,node_firebase_db,node_local_storage toneMint
class node_staff toneIndigo
```

## Components

### Incident workflow

- [PEE counter](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Command-post totals](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Missing-person register](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Nominative / RUT](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Fire-service report](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`

### Coordination tools

- [Shared evacuation timer](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Event reset](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`

### App and services

- [Web interface](https://github.com/rodri1988/evacuacion-pee/blob/main/index.html): `index.html`
- [Brigade authentication](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Realtime synchronization](https://github.com/rodri1988/evacuacion-pee/blob/main/js/app.js): `js/app.js`
- [Firebase configuration](https://github.com/rodri1988/evacuacion-pee/blob/main/js/firebase-config.js): `js/firebase-config.js`
- **Firebase Auth**
- **Firebase Realtime DB**
- **Browser persistence**

### Other components

- **Brigade staff**

## Connections

- Brigade staff → Web interface: uses (evidence: `README.md`)
- Web interface → PEE counter: records counts (evidence: `README.md`)
- Web interface → Command-post totals: views totals (evidence: `README.md`)
- Web interface → Missing-person register: records names (evidence: `README.md`)
- Web interface → Nominative / RUT: records RUT (evidence: `README.md`)
- Web interface → Fire-service report: prints report (evidence: `README.md`)
- Web interface → Shared evacuation timer: controls timer
- Web interface → Event reset: resets event
- Brigade authentication → Firebase Auth: signs in (evidence: `js/app.js`)
- Realtime synchronization → Firebase Realtime DB: subscribes and writes (evidence: `js/app.js`)
- PEE counter → Firebase Realtime DB: updates counts (evidence: `js/app.js`)
- Missing-person register → Firebase Realtime DB: updates records (evidence: `js/app.js`)
- Command-post totals → Firebase Realtime DB: reads shared state
- Shared evacuation timer → Firebase Realtime DB: writes shared timer
- Event reset → Firebase Realtime DB: clears event data (evidence: `js/app.js`)
- Firebase configuration → Brigade authentication: configures app (evidence: `js/app.js`)
- Firebase configuration → Realtime synchronization: configures app (evidence: `js/app.js`)
- Web interface → Browser persistence: persists data (evidence: `README.md`)
