# mahishaarma/astrasafe architecture

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

- Interactive diagram: https://gitdiagram.com/mahishaarma/astrasafe
- Repository: https://github.com/mahishaarma/astrasafe

## Overview

AstraSafe is a travel-safety and community web app for women travelers. The main workflow moves from app entry and explorer verification into destination safety information and then into practical travel actions: transport, local connections, buddy plans, check-ins, and community support. The interface also provides emergency, privacy, offline-map, and personal-safety tools. App.tsx owns tab and modal orchestration; most feature components appear to manage their own UI state. The excerpts show a tourist-registration HTTP request, but do not expose server.ts routes or establish other backend wiring.

Main entry points: [`src/App.tsx`](https://github.com/mahishaarma/astrasafe/blob/main/src/App.tsx) (App orchestration), [`src/data/mockData.ts`](https://github.com/mahishaarma/astrasafe/blob/main/src/data/mockData.ts) (Travel sample data), [`src/components/DirectChatAndCallModal.tsx`](https://github.com/mahishaarma/astrasafe/blob/main/src/components/DirectChatAndCallModal.tsx) (Direct chat and calls), [`src/components/Navbar.tsx`](https://github.com/mahishaarma/astrasafe/blob/main/src/components/Navbar.tsx) (Navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App shell"]
  node_app["App orchestration<br/>[App.tsx]"]
  node_theme["Theme provider<br/>[ThemeContext.tsx]"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
  node_splash["Splash screen<br/>[SplashScreen.tsx]"]
  node_logo["Brand logo<br/>[AstraSafeLogo.tsx]"]
  node_data["Travel sample data<br/>[mockData.ts]"]
  node_server["HTTP server<br/>[server.ts]"]
end

subgraph group_safety["Safety tools"]
  node_onboarding["Explorer onboarding"]
  node_idcheck["ID verification"]
  node_privacy["Privacy settings"]
  node_destination["Destination intelligence"]
  node_score["Safety methodology"]
  node_offline["Offline maps"]
  node_emergency["Emergency directory"]
  node_sos["SOS<br/>[SOSModal.tsx]"]
  node_fakecall["Fake call<br/>[FakeCallModal.tsx]"]
  node_ai["AI safety companion"]
end

subgraph group_travel["Travel planning"]
  node_cab["Cab booking and guard"]
  node_cabmodal["Cab safety<br/>[CabSafetyModal.tsx]"]
  node_guides["Guides and peers"]
  node_plans["Buddy plans"]
  node_checkin["Tourist check-in"]
end

subgraph group_community["Community"]
  node_community["Community feed<br/>[CommunityFeed.tsx]"]
  node_chat["Direct chat and calls"]
end

node_traveler(("Traveler"))
node_registration_api{{"Registration endpoint"}}

node_traveler -->|"uses"| node_app
node_app -->|"shows"| node_splash
node_app -->|"renders"| node_navbar
node_app -->|"renders"| node_onboarding
node_app -->|"renders"| node_idcheck
node_app -->|"renders"| node_privacy
node_app -->|"renders"| node_destination
node_app -->|"renders"| node_cab
node_app -->|"renders"| node_guides
node_app -->|"renders"| node_checkin
node_app -->|"renders"| node_ai
node_app -->|"renders"| node_community
node_app -->|"renders"| node_plans
node_app -->|"renders"| node_chat
node_app -->|"renders"| node_sos
node_app -->|"renders"| node_offline
node_app -->|"renders"| node_emergency
node_app -->|"renders"| node_score
node_app -->|"renders"| node_cabmodal
node_app -->|"renders"| node_fakecall
node_app -->|"loads defaults"| node_data
node_traveler -->|"submits registration"| node_registration_api
node_registration_api -.->|"handled by"| node_server
node_traveler -->|"sets preference"| node_theme
node_app -->|"runs within"| node_theme
node_onboarding -->|"renders"| node_logo
node_navbar -->|"renders"| node_logo
node_cab -->|"loads bookings"| node_data
node_community -->|"loads feed data"| node_data
node_guides -.->|"opens conversation"| node_chat
node_plans -.->|"opens conversation"| node_chat

click node_app "https://github.com/mahishaarma/astrasafe/blob/main/src/App.tsx"
click node_theme "https://github.com/mahishaarma/astrasafe/blob/main/src/context/ThemeContext.tsx"
click node_navbar "https://github.com/mahishaarma/astrasafe/blob/main/src/components/Navbar.tsx"
click node_splash "https://github.com/mahishaarma/astrasafe/blob/main/src/components/SplashScreen.tsx"
click node_logo "https://github.com/mahishaarma/astrasafe/blob/main/src/components/AstraSafeLogo.tsx"
click node_onboarding "https://github.com/mahishaarma/astrasafe/blob/main/src/components/FemaleOnboardingModal.tsx"
click node_idcheck "https://github.com/mahishaarma/astrasafe/blob/main/src/components/IDVerificationModal.tsx"
click node_privacy "https://github.com/mahishaarma/astrasafe/blob/main/src/components/PrivacySettingsModal.tsx"
click node_destination "https://github.com/mahishaarma/astrasafe/blob/main/src/components/DestinationIntelligence.tsx"
click node_score "https://github.com/mahishaarma/astrasafe/blob/main/src/components/SafetyScoreMethodologyModal.tsx"
click node_offline "https://github.com/mahishaarma/astrasafe/blob/main/src/components/OfflineMapModal.tsx"
click node_emergency "https://github.com/mahishaarma/astrasafe/blob/main/src/components/EmergencyDirectoryModal.tsx"
click node_sos "https://github.com/mahishaarma/astrasafe/blob/main/src/components/SOSModal.tsx"
click node_fakecall "https://github.com/mahishaarma/astrasafe/blob/main/src/components/FakeCallModal.tsx"
click node_cab "https://github.com/mahishaarma/astrasafe/blob/main/src/components/CabBookingAndGuard.tsx"
click node_cabmodal "https://github.com/mahishaarma/astrasafe/blob/main/src/components/CabSafetyModal.tsx"
click node_guides "https://github.com/mahishaarma/astrasafe/blob/main/src/components/LocalGuidesAndPeers.tsx"
click node_plans "https://github.com/mahishaarma/astrasafe/blob/main/src/components/TravelBuddyPlans.tsx"
click node_checkin "https://github.com/mahishaarma/astrasafe/blob/main/src/components/TouristCheckInCard.tsx"
click node_ai "https://github.com/mahishaarma/astrasafe/blob/main/src/components/AISafetyCompanion.tsx"
click node_community "https://github.com/mahishaarma/astrasafe/blob/main/src/components/CommunityFeed.tsx"
click node_chat "https://github.com/mahishaarma/astrasafe/blob/main/src/components/DirectChatAndCallModal.tsx"
click node_data "https://github.com/mahishaarma/astrasafe/blob/main/src/data/mockData.ts"
click node_server "https://github.com/mahishaarma/astrasafe/blob/main/server.ts"

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_theme,node_navbar,node_splash,node_logo,node_data,node_server toneBlue
class node_onboarding,node_idcheck,node_privacy,node_destination,node_score,node_offline,node_emergency,node_sos,node_fakecall,node_ai toneAmber
class node_cab,node_cabmodal,node_guides,node_plans,node_checkin toneMint
class node_community,node_chat toneRose
class node_traveler,node_registration_api toneIndigo
```

## Components

### App shell

- [App orchestration](https://github.com/mahishaarma/astrasafe/blob/main/src/App.tsx): `src/App.tsx`
- [Theme provider](https://github.com/mahishaarma/astrasafe/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`
- [Navigation](https://github.com/mahishaarma/astrasafe/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`
- [Splash screen](https://github.com/mahishaarma/astrasafe/blob/main/src/components/SplashScreen.tsx): `src/components/SplashScreen.tsx`
- [Brand logo](https://github.com/mahishaarma/astrasafe/blob/main/src/components/AstraSafeLogo.tsx): `src/components/AstraSafeLogo.tsx`
- [Travel sample data](https://github.com/mahishaarma/astrasafe/blob/main/src/data/mockData.ts): `src/data/mockData.ts`
- [HTTP server](https://github.com/mahishaarma/astrasafe/blob/main/server.ts): `server.ts`

### Safety tools

- [Explorer onboarding](https://github.com/mahishaarma/astrasafe/blob/main/src/components/FemaleOnboardingModal.tsx): `src/components/FemaleOnboardingModal.tsx`
- [ID verification](https://github.com/mahishaarma/astrasafe/blob/main/src/components/IDVerificationModal.tsx): `src/components/IDVerificationModal.tsx`
- [Privacy settings](https://github.com/mahishaarma/astrasafe/blob/main/src/components/PrivacySettingsModal.tsx): `src/components/PrivacySettingsModal.tsx`
- [Destination intelligence](https://github.com/mahishaarma/astrasafe/blob/main/src/components/DestinationIntelligence.tsx): `src/components/DestinationIntelligence.tsx`
- [Safety methodology](https://github.com/mahishaarma/astrasafe/blob/main/src/components/SafetyScoreMethodologyModal.tsx): `src/components/SafetyScoreMethodologyModal.tsx`
- [Offline maps](https://github.com/mahishaarma/astrasafe/blob/main/src/components/OfflineMapModal.tsx): `src/components/OfflineMapModal.tsx`
- [Emergency directory](https://github.com/mahishaarma/astrasafe/blob/main/src/components/EmergencyDirectoryModal.tsx): `src/components/EmergencyDirectoryModal.tsx`
- [SOS](https://github.com/mahishaarma/astrasafe/blob/main/src/components/SOSModal.tsx): `src/components/SOSModal.tsx`
- [Fake call](https://github.com/mahishaarma/astrasafe/blob/main/src/components/FakeCallModal.tsx): `src/components/FakeCallModal.tsx`
- [AI safety companion](https://github.com/mahishaarma/astrasafe/blob/main/src/components/AISafetyCompanion.tsx): `src/components/AISafetyCompanion.tsx`

### Travel planning

- [Cab booking and guard](https://github.com/mahishaarma/astrasafe/blob/main/src/components/CabBookingAndGuard.tsx): `src/components/CabBookingAndGuard.tsx`
- [Cab safety](https://github.com/mahishaarma/astrasafe/blob/main/src/components/CabSafetyModal.tsx): `src/components/CabSafetyModal.tsx`
- [Guides and peers](https://github.com/mahishaarma/astrasafe/blob/main/src/components/LocalGuidesAndPeers.tsx): `src/components/LocalGuidesAndPeers.tsx`
- [Buddy plans](https://github.com/mahishaarma/astrasafe/blob/main/src/components/TravelBuddyPlans.tsx): `src/components/TravelBuddyPlans.tsx`
- [Tourist check-in](https://github.com/mahishaarma/astrasafe/blob/main/src/components/TouristCheckInCard.tsx): `src/components/TouristCheckInCard.tsx`

### Community

- [Community feed](https://github.com/mahishaarma/astrasafe/blob/main/src/components/CommunityFeed.tsx): `src/components/CommunityFeed.tsx`
- [Direct chat and calls](https://github.com/mahishaarma/astrasafe/blob/main/src/components/DirectChatAndCallModal.tsx): `src/components/DirectChatAndCallModal.tsx`

### Other components

- **Traveler**
- **Registration endpoint**

## Connections

- Traveler → App orchestration: uses (evidence: `src/App.tsx`)
- App orchestration → Splash screen: shows (evidence: `src/App.tsx`)
- App orchestration → Navigation: renders (evidence: `src/App.tsx`)
- App orchestration → Explorer onboarding: renders (evidence: `src/App.tsx`)
- App orchestration → ID verification: renders (evidence: `src/App.tsx`)
- App orchestration → Privacy settings: renders (evidence: `src/App.tsx`)
- App orchestration → Destination intelligence: renders (evidence: `src/App.tsx`)
- App orchestration → Cab booking and guard: renders (evidence: `src/App.tsx`)
- App orchestration → Guides and peers: renders (evidence: `src/App.tsx`)
- App orchestration → Tourist check-in: renders (evidence: `src/App.tsx`)
- App orchestration → AI safety companion: renders (evidence: `src/App.tsx`)
- App orchestration → Community feed: renders (evidence: `src/App.tsx`)
- App orchestration → Buddy plans: renders (evidence: `src/App.tsx`)
- App orchestration → Direct chat and calls: renders (evidence: `src/App.tsx`)
- App orchestration → SOS: renders (evidence: `src/App.tsx`)
- App orchestration → Offline maps: renders (evidence: `src/App.tsx`)
- App orchestration → Emergency directory: renders (evidence: `src/App.tsx`)
- App orchestration → Safety methodology: renders (evidence: `src/App.tsx`)
- App orchestration → Cab safety: renders (evidence: `src/App.tsx`)
- App orchestration → Fake call: renders (evidence: `src/App.tsx`)
- App orchestration → Travel sample data: loads defaults (evidence: `src/App.tsx`)
- Traveler → Registration endpoint: submits registration
- Registration endpoint → HTTP server: handled by
- Traveler → Theme provider: sets preference (evidence: `src/context/ThemeContext.tsx`)
- App orchestration → Theme provider: runs within (evidence: `src/main.tsx`)
- Explorer onboarding → Brand logo: renders (evidence: `src/components/FemaleOnboardingModal.tsx`)
- Navigation → Brand logo: renders (evidence: `src/components/Navbar.tsx`)
- Cab booking and guard → Travel sample data: loads bookings (evidence: `src/components/CabBookingAndGuard.tsx`)
- Community feed → Travel sample data: loads feed data (evidence: `src/components/CommunityFeed.tsx`)
- Guides and peers → Direct chat and calls: opens conversation
- Buddy plans → Direct chat and calls: opens conversation
