# salveci2022/aurora_mulher_segura architecture

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

- Interactive diagram: https://gitdiagram.com/salveci2022/aurora_mulher_segura
- Repository: https://github.com/salveci2022/aurora_mulher_segura

## Overview

Aurora Mulher Segura is a Flask-based safety app. Its main workflow is a user holding the SOS button, optionally sharing GPS, and sending an alert for trusted contacts to view. Other documented capabilities include AI support, emergency guidance, safety planning, alert history/PDF export, administration, and offline PWA behavior. The excerpts show the SOS request and some Flask routes; several other feature links are based on README descriptions rather than inspected implementation.

Main entry points: [`app.py`](https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py) (Flask routes), [`static/js/panic.js`](https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/js/panic.js) (SOS and GPS), [`static/js/sw.js`](https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/js/sw.js) (Offline worker), [`templates/panel_admin.html`](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panel_admin.html) (Admin panel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sos["SOS Alerts"]
  node_panic_page["SOS page<br/>[panic_button.html]"]
  node_panic_js["SOS and GPS<br/>[panic.js]"]
  node_alert_api["Alert endpoint<br/>[app.py]"]
  node_alert_history["Alert history<br/>[historico.html]"]
  node_alert_store[("Alert records<br/>[app.py]")]
  node_pdf_export["PDF report<br/>[app.py]"]
end

subgraph group_access["Accounts &amp; Monitoring"]
  node_trusted_login["Trusted login<br/>[login_trusted.html]"]
  node_trusted_panel["Trusted panel<br/>[panel_trusted.html]"]
  node_admin_login["Admin login<br/>[login_admin.html]"]
  node_admin_panel["Admin panel<br/>[panel_admin.html]"]
  node_account_data[("User records<br/>[app.py]")]
end

subgraph group_support["Safety Support"]
  node_ai_chat["Aurora AI chat<br/>[aurora_ia.html]"]
  node_anthropic["Anthropic API"]
  node_help["Emergency guidance<br/>[ajuda.html]"]
  node_safety_plan["Safety plan"]
  node_quick_exit["Quick exit<br/>[saida_rapida.html]"]
end

subgraph group_platform["Web Platform"]
  node_app_server["Flask routes<br/>[app.py]"]
  node_service_worker["Offline worker<br/>[sw.js]"]
  node_offline_page["Offline page<br/>[offline.html]"]
  node_pwa_manifest["PWA manifest<br/>[manifest.json]"]
end

node_user(("Person at risk"))
node_trusted_user(("Trusted contact"))
node_admin_user(("Administrator"))

node_user -->|"opens"| node_panic_page
node_panic_page -.->|"loads script"| node_panic_js
node_panic_js -->|"posts alert"| node_alert_api
node_panic_js -->|"requests GPS"| node_user
node_alert_api -.->|"records alerts"| node_alert_store
node_app_server -->|"handles route"| node_alert_api
node_app_server -->|"renders page"| node_alert_history
node_app_server -.->|"renders login"| node_trusted_login
node_app_server -->|"renders panel"| node_trusted_panel
node_trusted_user -->|"signs in"| node_trusted_login
node_trusted_user -->|"views alerts"| node_trusted_panel
node_admin_user -->|"signs in"| node_admin_login
node_app_server -->|"renders login"| node_admin_login
node_app_server -.->|"serves panel"| node_admin_panel
node_app_server -.->|"reads users"| node_account_data
node_app_server -.->|"reads history"| node_alert_store
node_admin_user -->|"manages contacts"| node_admin_panel
node_admin_panel -.->|"exports report"| node_pdf_export
node_user -->|"requests support"| node_ai_chat
node_ai_chat -->|"queries Claude"| node_anthropic
node_user -->|"views guidance"| node_help
node_user -->|"plans safety"| node_safety_plan
node_user -->|"uses disguise"| node_quick_exit
node_service_worker -->|"falls back"| node_offline_page
node_service_worker -.->|"supports install"| node_pwa_manifest
node_app_server -.->|"serves app assets"| node_service_worker

click node_panic_page "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panic_button.html"
click node_panic_js "https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/js/panic.js"
click node_alert_api "https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py"
click node_alert_history "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/historico.html"
click node_alert_store "https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py"
click node_trusted_login "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/login_trusted.html"
click node_trusted_panel "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panel_trusted.html"
click node_admin_login "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/login_admin.html"
click node_admin_panel "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panel_admin.html"
click node_account_data "https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py"
click node_ai_chat "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/aurora_ia.html"
click node_help "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/ajuda.html"
click node_safety_plan "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/plano_seguranca.html"
click node_quick_exit "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/saida_rapida.html"
click node_app_server "https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py"
click node_service_worker "https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/js/sw.js"
click node_offline_page "https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/offline.html"
click node_pwa_manifest "https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/manifest.json"
click node_pdf_export "https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.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_panic_page,node_panic_js,node_alert_api,node_alert_history,node_alert_store,node_pdf_export toneBlue
class node_trusted_login,node_trusted_panel,node_admin_login,node_admin_panel,node_account_data toneAmber
class node_ai_chat,node_anthropic,node_help,node_safety_plan,node_quick_exit toneMint
class node_app_server,node_service_worker,node_offline_page,node_pwa_manifest toneRose
class node_user,node_trusted_user,node_admin_user toneIndigo
```

## Components

### SOS Alerts

- [SOS page](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panic_button.html): `templates/panic_button.html`
- [SOS and GPS](https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/js/panic.js): `static/js/panic.js`
- [Alert endpoint](https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py): `app.py`
- [Alert history](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/historico.html): `templates/historico.html`
- [Alert records](https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py): `app.py`
- [PDF report](https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py): `app.py`

### Accounts & Monitoring

- [Trusted login](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/login_trusted.html): `templates/login_trusted.html`
- [Trusted panel](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panel_trusted.html): `templates/panel_trusted.html`
- [Admin login](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/login_admin.html): `templates/login_admin.html`
- [Admin panel](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/panel_admin.html): `templates/panel_admin.html`
- [User records](https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py): `app.py`

### Safety Support

- [Aurora AI chat](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/aurora_ia.html): `templates/aurora_ia.html`
- **Anthropic API**
- [Emergency guidance](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/ajuda.html): `templates/ajuda.html`
- [Safety plan](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/plano_seguranca.html): `templates/plano_seguranca.html`
- [Quick exit](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/saida_rapida.html): `templates/saida_rapida.html`

### Web Platform

- [Flask routes](https://github.com/salveci2022/aurora_mulher_segura/blob/main/app.py): `app.py`
- [Offline worker](https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/js/sw.js): `static/js/sw.js`
- [Offline page](https://github.com/salveci2022/aurora_mulher_segura/blob/main/templates/offline.html): `templates/offline.html`
- [PWA manifest](https://github.com/salveci2022/aurora_mulher_segura/blob/main/static/manifest.json): `static/manifest.json`

### Other components

- **Person at risk**
- **Trusted contact**
- **Administrator**

## Connections

- Person at risk → SOS page: opens (evidence: `README.md`)
- SOS page → SOS and GPS: loads script
- SOS and GPS → Alert endpoint: posts alert (evidence: `static/js/panic.js`)
- SOS and GPS → Person at risk: requests GPS (evidence: `static/js/panic.js`)
- Alert endpoint → Alert records: records alerts (evidence: `app.py`)
- Flask routes → Alert endpoint: handles route (evidence: `app.py`)
- Flask routes → Alert history: renders page (evidence: `app.py`)
- Flask routes → Trusted login: renders login
- Flask routes → Trusted panel: renders panel (evidence: `app.py`)
- Trusted contact → Trusted login: signs in (evidence: `README.md`)
- Trusted contact → Trusted panel: views alerts (evidence: `README.md`)
- Administrator → Admin login: signs in (evidence: `README.md`)
- Flask routes → Admin login: renders login (evidence: `app.py`)
- Flask routes → Admin panel: serves panel
- Flask routes → User records: reads users (evidence: `app.py`)
- Flask routes → Alert records: reads history (evidence: `app.py`)
- Administrator → Admin panel: manages contacts (evidence: `README.md`)
- Admin panel → PDF report: exports report
- Person at risk → Aurora AI chat: requests support (evidence: `README.md`)
- Aurora AI chat → Anthropic API: queries Claude (evidence: `README.md`)
- Person at risk → Emergency guidance: views guidance (evidence: `README.md`)
- Person at risk → Safety plan: plans safety (evidence: `README.md`)
- Person at risk → Quick exit: uses disguise (evidence: `README.md`)
- Offline worker → Offline page: falls back (evidence: `static/js/sw.js`)
- Offline worker → PWA manifest: supports install
- Flask routes → Offline worker: serves app assets
