# nehagowda06/app4her architecture

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

- Interactive diagram: https://gitdiagram.com/nehagowda06/app4her
- Repository: https://github.com/nehagowda06/app4her

## Overview

App4Her is a mobile personal-safety app. Users enter through Home and can activate Protection Mode, which coordinates emergency contact/dialer actions, runtime tracking, and nearby Safe Havens; other routes support incident logging, room/drink safety, location sharing, fake calls, and situation guidance. The graph includes the documented screen capabilities, but several screen and controller implementations were not sampled, so their internal connections are omitted. Edges reflect only visible calls or navigator registrations.

Main entry points: [`src/navigation/AppNavigator.tsx`](https://github.com/nehagowda06/app4her/blob/main/src/navigation/AppNavigator.tsx) (Screen navigator), [`src/controllers/protectionController.ts`](https://github.com/nehagowda06/app4her/blob/main/src/controllers/protectionController.ts) (Protection orchestration), [`src/controllers/safeHavenController.ts`](https://github.com/nehagowda06/app4her/blob/main/src/controllers/safeHavenController.ts) (Safe Haven handling), [`src/controllers/incidentController.ts`](https://github.com/nehagowda06/app4her/blob/main/src/controllers/incidentController.ts) (Incident handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app_entry["App entry<br/>[App.tsx]"]
  node_navigator["Screen navigator<br/>[AppNavigator.tsx]"]
  node_layout["App layout<br/>[AppLayout.tsx]"]
end

subgraph group_features["Safety features"]
  node_home["Home screen<br/>[HomeScreen.tsx]"]
  node_protection_screen["Protection mode"]
  node_room_drink["Room and drink checks"]
  node_situation_ai["Situation guidance"]
  node_safe_havens["Safe Haven finder"]
  node_incident_screens["Incident records"]
  node_location_screen["Location sharing"]
  node_other_tools["Other safety tools"]
  node_contacts["Trusted contacts"]
end

subgraph group_services["Safety services"]
  node_protection_controller["Protection orchestration"]
  node_incident_controller["Incident handling"]
  node_haven_controller["Safe Haven handling"]
  node_incident_service["Incident persistence<br/>[incidentService.ts]"]
  node_location_service["Location services<br/>[locationService.ts]"]
  node_alert_service["Emergency alerts<br/>[alertService.ts]"]
  node_runtime_service["Protection runtime"]
  node_haven_service["Safe Haven lookup"]
end

subgraph group_state["Shared state"]
  node_safety_store[("Safety state<br/>[useSafetyStore.ts]")]
end

node_user(("User"))
node_device{{"Device location and dialer"}}
node_sms{{"SMS service"}}
node_maps{{"Maps app"}}

node_user -->|"opens app"| node_app_entry
node_app_entry -->|"renders"| node_navigator
node_navigator -->|"registers"| node_home
node_navigator -->|"registers"| node_protection_screen
node_navigator -->|"registers"| node_room_drink
node_navigator -->|"registers"| node_situation_ai
node_navigator -->|"registers"| node_safe_havens
node_navigator -->|"registers"| node_incident_screens
node_navigator -->|"registers"| node_location_screen
node_navigator -->|"registers"| node_other_tools
node_home -->|"renders"| node_layout
node_home -->|"invokes"| node_protection_controller
node_protection_controller -->|"reads and updates"| node_safety_store
node_protection_controller -->|"loads havens"| node_haven_controller
node_protection_controller -->|"starts runtime"| node_runtime_service
node_protection_controller -->|"calls contacts"| node_alert_service
node_protection_controller -->|"invokes"| node_incident_controller
node_alert_service -.->|"opens dialer"| node_device
node_runtime_service -->|"uses location"| node_location_service
node_haven_controller -->|"gets location"| node_location_service
node_haven_controller -->|"fetches havens"| node_haven_service
node_haven_controller -->|"updates"| node_safety_store
node_haven_controller -.->|"opens directions"| node_maps
node_incident_controller -->|"loads and saves"| node_incident_service
node_incident_controller -->|"gets location"| node_location_service
node_incident_controller -->|"updates incidents"| node_safety_store
node_room_drink -->|"uses"| node_incident_controller
node_location_service -->|"requests location"| node_device
node_contacts -->|"route registered"| node_navigator

click node_app_entry "https://github.com/nehagowda06/app4her/blob/main/App.tsx"
click node_navigator "https://github.com/nehagowda06/app4her/blob/main/src/navigation/AppNavigator.tsx"
click node_home "https://github.com/nehagowda06/app4her/blob/main/src/screens/HomeScreen.tsx"
click node_protection_screen "https://github.com/nehagowda06/app4her/blob/main/src/screens/ProtectionModeScreen.tsx"
click node_room_drink "https://github.com/nehagowda06/app4her/tree/main/src/screens"
click node_situation_ai "https://github.com/nehagowda06/app4her/blob/main/src/screens/SituationAIScreen.tsx"
click node_safe_havens "https://github.com/nehagowda06/app4her/blob/main/src/screens/SafeHavenScreen.tsx"
click node_incident_screens "https://github.com/nehagowda06/app4her/tree/main/src/screens"
click node_location_screen "https://github.com/nehagowda06/app4her/blob/main/src/screens/LocationShareScreen.tsx"
click node_other_tools "https://github.com/nehagowda06/app4her/tree/main/src/screens"
click node_layout "https://github.com/nehagowda06/app4her/blob/main/src/components/AppLayout.tsx"
click node_protection_controller "https://github.com/nehagowda06/app4her/blob/main/src/controllers/protectionController.ts"
click node_incident_controller "https://github.com/nehagowda06/app4her/blob/main/src/controllers/incidentController.ts"
click node_haven_controller "https://github.com/nehagowda06/app4her/blob/main/src/controllers/safeHavenController.ts"
click node_incident_service "https://github.com/nehagowda06/app4her/blob/main/src/services/incidentService.ts"
click node_location_service "https://github.com/nehagowda06/app4her/blob/main/src/services/locationService.ts"
click node_alert_service "https://github.com/nehagowda06/app4her/blob/main/src/services/alertService.ts"
click node_runtime_service "https://github.com/nehagowda06/app4her/blob/main/src/services/protectionRuntimeService.ts"
click node_haven_service "https://github.com/nehagowda06/app4her/blob/main/src/services/safeHavenService.ts"
click node_safety_store "https://github.com/nehagowda06/app4her/blob/main/src/state/useSafetyStore.ts"
click node_contacts "https://github.com/nehagowda06/app4her/blob/main/src/screens/TrustedContactsScreen.tsx"

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_entry,node_navigator,node_layout,node_user toneBlue
class node_home,node_protection_screen,node_room_drink,node_situation_ai,node_safe_havens,node_incident_screens,node_location_screen,node_other_tools,node_contacts toneAmber
class node_protection_controller,node_incident_controller,node_haven_controller,node_incident_service,node_location_service,node_alert_service,node_runtime_service,node_haven_service toneMint
class node_safety_store toneRose
class node_device,node_sms,node_maps toneIndigo
```

## Components

### App shell

- [App entry](https://github.com/nehagowda06/app4her/blob/main/App.tsx): `App.tsx`
- [Screen navigator](https://github.com/nehagowda06/app4her/blob/main/src/navigation/AppNavigator.tsx): `src/navigation/AppNavigator.tsx`
- [App layout](https://github.com/nehagowda06/app4her/blob/main/src/components/AppLayout.tsx): `src/components/AppLayout.tsx`

### Safety features

- [Home screen](https://github.com/nehagowda06/app4her/blob/main/src/screens/HomeScreen.tsx): `src/screens/HomeScreen.tsx`
- [Protection mode](https://github.com/nehagowda06/app4her/blob/main/src/screens/ProtectionModeScreen.tsx): `src/screens/ProtectionModeScreen.tsx`
- [Room and drink checks](https://github.com/nehagowda06/app4her/tree/main/src/screens): `src/screens`
- [Situation guidance](https://github.com/nehagowda06/app4her/blob/main/src/screens/SituationAIScreen.tsx): `src/screens/SituationAIScreen.tsx`
- [Safe Haven finder](https://github.com/nehagowda06/app4her/blob/main/src/screens/SafeHavenScreen.tsx): `src/screens/SafeHavenScreen.tsx`
- [Incident records](https://github.com/nehagowda06/app4her/tree/main/src/screens): `src/screens`
- [Location sharing](https://github.com/nehagowda06/app4her/blob/main/src/screens/LocationShareScreen.tsx): `src/screens/LocationShareScreen.tsx`
- [Other safety tools](https://github.com/nehagowda06/app4her/tree/main/src/screens): `src/screens`
- [Trusted contacts](https://github.com/nehagowda06/app4her/blob/main/src/screens/TrustedContactsScreen.tsx): `src/screens/TrustedContactsScreen.tsx`

### Safety services

- [Protection orchestration](https://github.com/nehagowda06/app4her/blob/main/src/controllers/protectionController.ts): `src/controllers/protectionController.ts`
- [Incident handling](https://github.com/nehagowda06/app4her/blob/main/src/controllers/incidentController.ts): `src/controllers/incidentController.ts`
- [Safe Haven handling](https://github.com/nehagowda06/app4her/blob/main/src/controllers/safeHavenController.ts): `src/controllers/safeHavenController.ts`
- [Incident persistence](https://github.com/nehagowda06/app4her/blob/main/src/services/incidentService.ts): `src/services/incidentService.ts`
- [Location services](https://github.com/nehagowda06/app4her/blob/main/src/services/locationService.ts): `src/services/locationService.ts`
- [Emergency alerts](https://github.com/nehagowda06/app4her/blob/main/src/services/alertService.ts): `src/services/alertService.ts`
- [Protection runtime](https://github.com/nehagowda06/app4her/blob/main/src/services/protectionRuntimeService.ts): `src/services/protectionRuntimeService.ts`
- [Safe Haven lookup](https://github.com/nehagowda06/app4her/blob/main/src/services/safeHavenService.ts): `src/services/safeHavenService.ts`

### Shared state

- [Safety state](https://github.com/nehagowda06/app4her/blob/main/src/state/useSafetyStore.ts): `src/state/useSafetyStore.ts`

### Other components

- **User**
- **Device location and dialer**
- **SMS service**
- **Maps app**

## Connections

- User → App entry: opens app
- App entry → Screen navigator: renders (evidence: `App.tsx`)
- Screen navigator → Home screen: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Protection mode: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Room and drink checks: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Situation guidance: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Safe Haven finder: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Incident records: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Location sharing: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Screen navigator → Other safety tools: registers (evidence: `src/navigation/AppNavigator.tsx`)
- Home screen → App layout: renders (evidence: `src/screens/HomeScreen.tsx`)
- Home screen → Protection orchestration: invokes (evidence: `src/screens/HomeScreen.tsx`)
- Protection orchestration → Safety state: reads and updates (evidence: `src/controllers/protectionController.ts`)
- Protection orchestration → Safe Haven handling: loads havens (evidence: `src/controllers/protectionController.ts`)
- Protection orchestration → Protection runtime: starts runtime (evidence: `src/controllers/protectionController.ts`)
- Protection orchestration → Emergency alerts: calls contacts (evidence: `src/controllers/protectionController.ts`)
- Protection orchestration → Incident handling: invokes (evidence: `src/controllers/protectionController.ts`)
- Emergency alerts → Device location and dialer: opens dialer
- Protection runtime → Location services: uses location (evidence: `src/services/protectionRuntimeService.ts`)
- Safe Haven handling → Location services: gets location (evidence: `src/controllers/safeHavenController.ts`)
- Safe Haven handling → Safe Haven lookup: fetches havens (evidence: `src/controllers/safeHavenController.ts`)
- Safe Haven handling → Safety state: updates (evidence: `src/controllers/safeHavenController.ts`)
- Safe Haven handling → Maps app: opens directions
- Incident handling → Incident persistence: loads and saves (evidence: `src/controllers/incidentController.ts`)
- Incident handling → Location services: gets location (evidence: `src/controllers/incidentController.ts`)
- Incident handling → Safety state: updates incidents (evidence: `src/controllers/incidentController.ts`)
- Room and drink checks → Incident handling: uses (evidence: `src/screens/RoomSafetyScreen.tsx`)
- Location services → Device location and dialer: requests location (evidence: `src/services/locationService.ts`)
- Trusted contacts → Screen navigator: route registered (evidence: `src/navigation/AppNavigator.tsx`)
