# refilwe15/gbv-front-react architecture

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

- Interactive diagram: https://gitdiagram.com/refilwe15/gbv-front-react
- Repository: https://github.com/refilwe15/gbv-front-react

## Overview

No TO GBV is a GBV support and incident-reporting app. A user can trigger an SOS from the welcome screen, which sends location and message details to the backend for logging and optional SMS; the welcome screen also uploads voice recordings for analysis and alerting. Signed-in capabilities include account access, incident reporting and review, community chat, a chatbot, and admin incident management. The backend adds incident classification and status updates. Some frontend screens and backend routes were not excerpted, so their connections are not inferred beyond documented registration and the shown SOS calls.

Main entry points: [`frontend/App.js`](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/App.js) (Navigation), [`backend/main.py`](https://github.com/refilwe15/gbv-front-react/blob/main/backend/main.py) (FastAPI App), [`backend/routes/incident_routes.py`](https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/incident_routes.py) (Incident Routes), [`backend/database.py`](https://github.com/refilwe15/gbv-front-react/blob/main/backend/database.py) (Database Access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Mobile App"]
  node_app["Navigation<br/>[App.js]"]
  node_greet["SOS Welcome<br/>[Greet.js]"]
  node_dashboard["User Dashboard<br/>[Dashboard.js]"]
end

subgraph group_identity["Accounts"]
  node_login["Login<br/>[Login.js]"]
  node_register["Registration<br/>[Register.js]"]
  node_auth_api["Auth Routes<br/>[auth_routes.py]"]
  node_user_api["User Routes<br/>[user_routes.py]"]
  node_storage["Local Storage<br/>[storage.js]"]
end

subgraph group_incidents["Incident Reporting"]
  node_report_form["Incident Submission<br/>[ReportIncident.js]"]
  node_reports["My Reports<br/>[Reports.js]"]
  node_report_detail["Report Details<br/>[ReportDetails.js]"]
  node_report_map["Incident Map<br/>[ReportsMap.js]"]
  node_incident_api["Incident Routes<br/>[incident_routes.py]"]
end

subgraph group_support["Safety And Support"]
  node_community["Community Chat<br/>[CommunityChat.js]"]
  node_chat_api["Chat Routes<br/>[chat_routes.py]"]
  node_chatbot["Chatbot Screen<br/>[ChatbotScreen.js]"]
  node_chatbot_api["Chatbot Route<br/>[chatbot_route.py]"]
  node_contact_setup["Emergency Contacts<br/>[ContactSetup.js]"]
  node_admin["Admin Dashboard<br/>[AdminDashboard.js]"]
end

subgraph group_server["Backend Services"]
  node_schemas["API Schemas<br/>[schemas.py]"]
  node_models["Data Models<br/>[models.py]"]
  node_database["Database Access<br/>[database.py]"]
  node_server_app["FastAPI App<br/>[main.py]"]
end

node_person(("App User"))
node_sms["Twilio SMS"]
node_classifier["Groq Classifier"]

node_person -->|"opens"| node_app
node_app -->|"routes to"| node_greet
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_report_form
node_app -->|"routes to"| node_reports
node_app -->|"routes to"| node_report_detail
node_app -->|"routes to"| node_report_map
node_app -->|"routes to"| node_contact_setup
node_app -->|"routes to"| node_community
node_app -->|"routes to"| node_chatbot
node_app -->|"routes to"| node_admin
node_person -.->|"triggers SOS"| node_greet
node_greet -->|"reads contact"| node_storage
node_greet -->|"posts SOS"| node_server_app
node_server_app -->|"sends alert"| node_sms
node_server_app -->|"creates tables"| node_database
node_server_app -->|"registers router"| node_auth_api
node_server_app -->|"registers router"| node_user_api
node_server_app -->|"registers router"| node_incident_api
node_server_app -->|"registers router"| node_chat_api
node_server_app -->|"registers router"| node_chatbot_api
node_auth_api -->|"queries users"| node_database
node_user_api -->|"queries users"| node_database
node_incident_api -->|"reads and writes"| node_database
node_chat_api -->|"reads and writes"| node_database
node_incident_api -->|"classifies reports"| node_classifier
node_incident_api -->|"uses response model"| node_schemas
node_chat_api -->|"uses message models"| node_schemas
node_models -->|"inherits Base"| node_database
node_report_form -.->|"submits report"| node_incident_api
node_reports -.->|"loads reports"| node_incident_api
node_admin -.->|"manages incidents"| node_incident_api
node_community -.->|"uses chat"| node_chat_api
node_chatbot -.->|"uses chatbot"| node_chatbot_api

click node_app "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/App.js"
click node_greet "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Greet.js"
click node_login "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Login.js"
click node_register "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Register.js"
click node_auth_api "https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/auth_routes.py"
click node_user_api "https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/user_routes.py"
click node_storage "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/utils/storage.js"
click node_dashboard "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Dashboard.js"
click node_report_form "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ReportIncident.js"
click node_reports "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Reports.js"
click node_report_detail "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ReportDetails.js"
click node_report_map "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ReportsMap.js"
click node_incident_api "https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/incident_routes.py"
click node_schemas "https://github.com/refilwe15/gbv-front-react/blob/main/backend/schemas.py"
click node_models "https://github.com/refilwe15/gbv-front-react/blob/main/backend/models.py"
click node_database "https://github.com/refilwe15/gbv-front-react/blob/main/backend/database.py"
click node_community "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/CommunityChat.js"
click node_chat_api "https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/chat_routes.py"
click node_chatbot "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ChatbotScreen.js"
click node_chatbot_api "https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/chatbot_route.py"
click node_contact_setup "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ContactSetup.js"
click node_admin "https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/AdminDashboard.js"
click node_server_app "https://github.com/refilwe15/gbv-front-react/blob/main/backend/main.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,node_greet,node_dashboard,node_person toneBlue
class node_login,node_register,node_auth_api,node_user_api,node_storage toneAmber
class node_report_form,node_reports,node_report_detail,node_report_map,node_incident_api toneMint
class node_community,node_chat_api,node_chatbot,node_chatbot_api,node_contact_setup,node_admin toneRose
class node_schemas,node_models,node_database,node_server_app,node_sms,node_classifier toneIndigo
```

## Components

### Mobile App

- [Navigation](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/App.js): `frontend/App.js`
- [SOS Welcome](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Greet.js): `frontend/components/Greet.js`
- [User Dashboard](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Dashboard.js): `frontend/components/Dashboard.js`

### Accounts

- [Login](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Login.js): `frontend/components/Login.js`
- [Registration](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Register.js): `frontend/components/Register.js`
- [Auth Routes](https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/auth_routes.py): `backend/routes/auth_routes.py`
- [User Routes](https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/user_routes.py): `backend/routes/user_routes.py`
- [Local Storage](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/utils/storage.js): `frontend/utils/storage.js`

### Incident Reporting

- [Incident Submission](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ReportIncident.js): `frontend/components/ReportIncident.js`
- [My Reports](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/Reports.js): `frontend/components/Reports.js`
- [Report Details](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ReportDetails.js): `frontend/components/ReportDetails.js`
- [Incident Map](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ReportsMap.js): `frontend/components/ReportsMap.js`
- [Incident Routes](https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/incident_routes.py): `backend/routes/incident_routes.py`

### Safety And Support

- [Community Chat](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/CommunityChat.js): `frontend/components/CommunityChat.js`
- [Chat Routes](https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/chat_routes.py): `backend/routes/chat_routes.py`
- [Chatbot Screen](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ChatbotScreen.js): `frontend/components/ChatbotScreen.js`
- [Chatbot Route](https://github.com/refilwe15/gbv-front-react/blob/main/backend/routes/chatbot_route.py): `backend/routes/chatbot_route.py`
- [Emergency Contacts](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/ContactSetup.js): `frontend/components/ContactSetup.js`
- [Admin Dashboard](https://github.com/refilwe15/gbv-front-react/blob/main/frontend/components/AdminDashboard.js): `frontend/components/AdminDashboard.js`

### Backend Services

- [API Schemas](https://github.com/refilwe15/gbv-front-react/blob/main/backend/schemas.py): `backend/schemas.py`
- [Data Models](https://github.com/refilwe15/gbv-front-react/blob/main/backend/models.py): `backend/models.py`
- [Database Access](https://github.com/refilwe15/gbv-front-react/blob/main/backend/database.py): `backend/database.py`
- [FastAPI App](https://github.com/refilwe15/gbv-front-react/blob/main/backend/main.py): `backend/main.py`

### Other components

- **App User**
- **Twilio SMS**
- **Groq Classifier**

## Connections

- App User → Navigation: opens (evidence: `frontend/App.js`)
- Navigation → SOS Welcome: routes to (evidence: `frontend/App.js`)
- Navigation → Login: routes to (evidence: `frontend/App.js`)
- Navigation → Registration: routes to (evidence: `frontend/App.js`)
- Navigation → User Dashboard: routes to (evidence: `frontend/App.js`)
- Navigation → Incident Submission: routes to (evidence: `frontend/App.js`)
- Navigation → My Reports: routes to (evidence: `frontend/App.js`)
- Navigation → Report Details: routes to (evidence: `frontend/App.js`)
- Navigation → Incident Map: routes to (evidence: `frontend/App.js`)
- Navigation → Emergency Contacts: routes to (evidence: `frontend/App.js`)
- Navigation → Community Chat: routes to (evidence: `frontend/App.js`)
- Navigation → Chatbot Screen: routes to (evidence: `frontend/App.js`)
- Navigation → Admin Dashboard: routes to (evidence: `frontend/App.js`)
- App User → SOS Welcome: triggers SOS
- SOS Welcome → Local Storage: reads contact (evidence: `frontend/components/Greet.js`)
- SOS Welcome → FastAPI App: posts SOS (evidence: `frontend/components/Greet.js`)
- FastAPI App → Twilio SMS: sends alert (evidence: `backend/main.py`)
- FastAPI App → Database Access: creates tables (evidence: `backend/main.py`)
- FastAPI App → Auth Routes: registers router (evidence: `backend/main.py`)
- FastAPI App → User Routes: registers router (evidence: `backend/main.py`)
- FastAPI App → Incident Routes: registers router (evidence: `backend/main.py`)
- FastAPI App → Chat Routes: registers router (evidence: `backend/main.py`)
- FastAPI App → Chatbot Route: registers router (evidence: `backend/main.py`)
- Auth Routes → Database Access: queries users (evidence: `backend/routes/auth_routes.py`)
- User Routes → Database Access: queries users (evidence: `backend/routes/user_routes.py`)
- Incident Routes → Database Access: reads and writes (evidence: `backend/routes/incident_routes.py`)
- Chat Routes → Database Access: reads and writes (evidence: `backend/routes/chat_routes.py`)
- Incident Routes → Groq Classifier: classifies reports (evidence: `backend/routes/incident_routes.py`)
- Incident Routes → API Schemas: uses response model (evidence: `backend/routes/incident_routes.py`)
- Chat Routes → API Schemas: uses message models (evidence: `backend/routes/chat_routes.py`)
- Data Models → Database Access: inherits Base (evidence: `backend/models.py`)
- Incident Submission → Incident Routes: submits report
- My Reports → Incident Routes: loads reports
- Admin Dashboard → Incident Routes: manages incidents
- Community Chat → Chat Routes: uses chat
- Chatbot Screen → Chatbot Route: uses chatbot
