# rachana80501/protego architecture

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

- Interactive diagram: https://gitdiagram.com/rachana80501/protego
- Repository: https://github.com/rachana80501/protego

## Overview

Protego appears to be a cross-platform personal-safety app: its screens cover account access, contacts, evidence, history, and voice SOS, with a separate backend server. The README describes this as an Expo Router app but does not document product behavior or frontend-to-backend wiring. The route and service relationships below are therefore dashed, unverified links inferred from filenames; unsampled source details are not assumed.

Main entry points: [`backend/server.js`](https://github.com/rachana80501/protego/blob/main/backend/server.js) (Backend service), [`src/app/explore.tsx`](https://github.com/rachana80501/protego/blob/main/src/app/explore.tsx) (Explore screen), [`src/components/ui/collapsible.tsx`](https://github.com/rachana80501/protego/blob/main/src/components/ui/collapsible.tsx) (Collapsible panel), [`src/hooks/use-theme.ts`](https://github.com/rachana80501/protego/blob/main/src/hooks/use-theme.ts) (Theme hook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_safety["Safety features"]
  node_home["Home screen<br/>[index.tsx]"]
  node_sos["Voice SOS<br/>[voice-sos.tsx]"]
  node_contacts["Contacts<br/>[contacts.tsx]"]
  node_evidence["Evidence<br/>[evidence.tsx]"]
  node_history["Incident history<br/>[history.tsx]"]
end

subgraph group_account["Account and settings"]
  node_login["Login<br/>[login.tsx]"]
  node_register["Registration<br/>[register.tsx]"]
  node_forgot["Forgot password"]
  node_password["Password<br/>[password.tsx]"]
  node_profile["Profile<br/>[profile.tsx]"]
  node_settings["Settings<br/>[settings.tsx]"]
end

subgraph group_navigation["App navigation"]
  node_layout["Root layout<br/>[_layout.tsx]"]
  node_explore["Explore screen<br/>[explore.tsx]"]
end

subgraph group_backend["Backend"]
  node_backend_server["Backend service<br/>[server.js]"]
end

subgraph group_shared["Shared UI"]
  node_themed_text["Themed text<br/>[themed-text.tsx]"]
  node_themed_view["Themed view<br/>[themed-view.tsx]"]
  node_collapsible["Collapsible panel<br/>[collapsible.tsx]"]
  node_theme["Theme tokens<br/>[theme.ts]"]
  node_theme_hook["Theme hook<br/>[use-theme.ts]"]
  node_external_link["External links<br/>[external-link.tsx]"]
  node_web_badge["Web badge<br/>[web-badge.tsx]"]
end

node_user(("User"))

node_user -.->|"opens app"| node_home
node_user -.->|"signs in"| node_login
node_user -.->|"creates account"| node_register
node_user -.->|"starts SOS"| node_sos
node_user -.->|"manages contacts"| node_contacts
node_user -.->|"views evidence"| node_evidence
node_user -.->|"views history"| node_history
node_user -.->|"views profile"| node_profile
node_user -.->|"changes settings"| node_settings
node_layout -.->|"routes to"| node_home
node_layout -.->|"routes to"| node_explore
node_home -.->|"may request data"| node_backend_server
node_sos -.->|"may send alert"| node_backend_server
node_contacts -.->|"may sync contacts"| node_backend_server
node_evidence -.->|"may submit evidence"| node_backend_server
node_history -.->|"may fetch records"| node_backend_server
node_login -.->|"may authenticate"| node_backend_server
node_register -.->|"may register"| node_backend_server
node_collapsible -->|"renders"| node_themed_text
node_collapsible -->|"renders"| node_themed_view
node_collapsible -->|"reads theme"| node_theme_hook
node_themed_text -->|"reads theme"| node_theme_hook
node_themed_view -->|"reads theme"| node_theme_hook
node_theme_hook -->|"selects colors"| node_theme
node_explore -->|"renders"| node_collapsible
node_explore -->|"renders"| node_external_link
node_explore -->|"renders"| node_web_badge
node_external_link -->|"opens external page"| node_user
node_web_badge -->|"renders"| node_themed_text
node_web_badge -->|"renders"| node_themed_view

click node_home "https://github.com/rachana80501/protego/blob/main/src/app/index.tsx"
click node_sos "https://github.com/rachana80501/protego/blob/main/src/app/voice-sos.tsx"
click node_contacts "https://github.com/rachana80501/protego/blob/main/src/app/contacts.tsx"
click node_evidence "https://github.com/rachana80501/protego/blob/main/src/app/evidence.tsx"
click node_history "https://github.com/rachana80501/protego/blob/main/src/app/history.tsx"
click node_login "https://github.com/rachana80501/protego/blob/main/src/app/login.tsx"
click node_register "https://github.com/rachana80501/protego/blob/main/src/app/register.tsx"
click node_forgot "https://github.com/rachana80501/protego/blob/main/src/app/forgot-password.tsx"
click node_password "https://github.com/rachana80501/protego/blob/main/src/app/password.tsx"
click node_profile "https://github.com/rachana80501/protego/blob/main/src/app/profile.tsx"
click node_settings "https://github.com/rachana80501/protego/blob/main/src/app/settings.tsx"
click node_layout "https://github.com/rachana80501/protego/blob/main/src/app/_layout.tsx"
click node_explore "https://github.com/rachana80501/protego/blob/main/src/app/explore.tsx"
click node_backend_server "https://github.com/rachana80501/protego/blob/main/backend/server.js"
click node_themed_text "https://github.com/rachana80501/protego/blob/main/src/components/themed-text.tsx"
click node_themed_view "https://github.com/rachana80501/protego/blob/main/src/components/themed-view.tsx"
click node_collapsible "https://github.com/rachana80501/protego/blob/main/src/components/ui/collapsible.tsx"
click node_theme "https://github.com/rachana80501/protego/blob/main/src/constants/theme.ts"
click node_theme_hook "https://github.com/rachana80501/protego/blob/main/src/hooks/use-theme.ts"
click node_external_link "https://github.com/rachana80501/protego/blob/main/src/components/external-link.tsx"
click node_web_badge "https://github.com/rachana80501/protego/blob/main/src/components/web-badge.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_home,node_sos,node_contacts,node_evidence,node_history,node_user toneBlue
class node_login,node_register,node_forgot,node_password,node_profile,node_settings toneAmber
class node_layout,node_explore toneMint
class node_backend_server toneRose
class node_themed_text,node_themed_view,node_collapsible,node_theme,node_theme_hook,node_external_link,node_web_badge toneIndigo
```

## Components

### Safety features

- [Home screen](https://github.com/rachana80501/protego/blob/main/src/app/index.tsx): `src/app/index.tsx`
- [Voice SOS](https://github.com/rachana80501/protego/blob/main/src/app/voice-sos.tsx): `src/app/voice-sos.tsx`
- [Contacts](https://github.com/rachana80501/protego/blob/main/src/app/contacts.tsx): `src/app/contacts.tsx`
- [Evidence](https://github.com/rachana80501/protego/blob/main/src/app/evidence.tsx): `src/app/evidence.tsx`
- [Incident history](https://github.com/rachana80501/protego/blob/main/src/app/history.tsx): `src/app/history.tsx`

### Account and settings

- [Login](https://github.com/rachana80501/protego/blob/main/src/app/login.tsx): `src/app/login.tsx`
- [Registration](https://github.com/rachana80501/protego/blob/main/src/app/register.tsx): `src/app/register.tsx`
- [Forgot password](https://github.com/rachana80501/protego/blob/main/src/app/forgot-password.tsx): `src/app/forgot-password.tsx`
- [Password](https://github.com/rachana80501/protego/blob/main/src/app/password.tsx): `src/app/password.tsx`
- [Profile](https://github.com/rachana80501/protego/blob/main/src/app/profile.tsx): `src/app/profile.tsx`
- [Settings](https://github.com/rachana80501/protego/blob/main/src/app/settings.tsx): `src/app/settings.tsx`

### App navigation

- [Root layout](https://github.com/rachana80501/protego/blob/main/src/app/_layout.tsx): `src/app/_layout.tsx`
- [Explore screen](https://github.com/rachana80501/protego/blob/main/src/app/explore.tsx): `src/app/explore.tsx`

### Backend

- [Backend service](https://github.com/rachana80501/protego/blob/main/backend/server.js): `backend/server.js`

### Shared UI

- [Themed text](https://github.com/rachana80501/protego/blob/main/src/components/themed-text.tsx): `src/components/themed-text.tsx`
- [Themed view](https://github.com/rachana80501/protego/blob/main/src/components/themed-view.tsx): `src/components/themed-view.tsx`
- [Collapsible panel](https://github.com/rachana80501/protego/blob/main/src/components/ui/collapsible.tsx): `src/components/ui/collapsible.tsx`
- [Theme tokens](https://github.com/rachana80501/protego/blob/main/src/constants/theme.ts): `src/constants/theme.ts`
- [Theme hook](https://github.com/rachana80501/protego/blob/main/src/hooks/use-theme.ts): `src/hooks/use-theme.ts`
- [External links](https://github.com/rachana80501/protego/blob/main/src/components/external-link.tsx): `src/components/external-link.tsx`
- [Web badge](https://github.com/rachana80501/protego/blob/main/src/components/web-badge.tsx): `src/components/web-badge.tsx`

### Other components

- **User**

## Connections

- User → Home screen: opens app
- User → Login: signs in
- User → Registration: creates account
- User → Voice SOS: starts SOS
- User → Contacts: manages contacts
- User → Evidence: views evidence
- User → Incident history: views history
- User → Profile: views profile
- User → Settings: changes settings
- Root layout → Home screen: routes to
- Root layout → Explore screen: routes to
- Home screen → Backend service: may request data
- Voice SOS → Backend service: may send alert
- Contacts → Backend service: may sync contacts
- Evidence → Backend service: may submit evidence
- Incident history → Backend service: may fetch records
- Login → Backend service: may authenticate
- Registration → Backend service: may register
- Collapsible panel → Themed text: renders (evidence: `src/components/ui/collapsible.tsx`)
- Collapsible panel → Themed view: renders (evidence: `src/components/ui/collapsible.tsx`)
- Collapsible panel → Theme hook: reads theme (evidence: `src/components/ui/collapsible.tsx`)
- Themed text → Theme hook: reads theme (evidence: `src/components/themed-text.tsx`)
- Themed view → Theme hook: reads theme (evidence: `src/components/themed-view.tsx`)
- Theme hook → Theme tokens: selects colors (evidence: `src/hooks/use-theme.ts`)
- Explore screen → Collapsible panel: renders (evidence: `src/app/explore.tsx`)
- Explore screen → External links: renders (evidence: `src/app/explore.tsx`)
- Explore screen → Web badge: renders (evidence: `src/app/explore.tsx`)
- External links → User: opens external page (evidence: `src/components/external-link.tsx`)
- Web badge → Themed text: renders (evidence: `src/components/web-badge.tsx`)
- Web badge → Themed view: renders (evidence: `src/components/web-badge.tsx`)
