# poojanellore/sheroute architecture

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

- Interactive diagram: https://gitdiagram.com/poojanellore/sheroute
- Repository: https://github.com/poojanellore/sheroute

## Overview

SheRoute is an Android safety app; its screen and component names indicate a user journey around routes, risk, and safety tools, with AI chat as a separate capability. The supplied excerpts contain no app source, and the README only documents local setup and a Gemini API key. Accordingly, component-to-component relationships below are dashed and unverified; the workflow and capability nodes are based on the repository tree, not inspected implementation.

Main entry points: [`app/src/main/java/com/example/viewmodel/SheRouteViewModel.kt`](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/viewmodel/SheRouteViewModel.kt) (App state), [`app/src/main/java/com/example/ui/screens/RoutesScreen.kt`](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/RoutesScreen.kt) (Routes), [`app/src/main/java/com/example/ui/screens/SafetyMapScreen.kt`](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SafetyMapScreen.kt) (Safety map), [`app/src/main/java/com/example/ui/screens/HomeScreen.kt`](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/HomeScreen.kt) (Home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app_flow["App flow"]
  node_activity["App entry<br/>[MainActivity.kt]"]
  node_viewmodel["App state"]
  node_front["Welcome screen"]
  node_home["Home<br/>[HomeScreen.kt]"]
end

subgraph group_safety_features["Safety features"]
  node_routes["Routes<br/>[RoutesScreen.kt]"]
  node_map["Safety map<br/>[SafetyMapScreen.kt]"]
  node_risk_dialog["Risk explanation"]
  node_risk_badge["Risk indicator<br/>[RiskLevelBadge.kt]"]
  node_score_dial["Safety score<br/>[SafetyScoreDial.kt]"]
  node_time_risk["Time risk<br/>[TimeRiskDialog.kt]"]
  node_journey["Journey simulation"]
  node_report["Incident report"]
  node_fake_call["Fake call<br/>[FakeCallScreen.kt]"]
end

subgraph group_data_ai["Data and AI"]
  node_safety_data["Safety data"]
  node_models["Safety models<br/>[SafetyModels.kt]"]
  node_chat["AI chat<br/>[AiChatScreen.kt]"]
  node_ai_service["AI service"]
end

subgraph group_user_settings["Account and settings"]
  node_auth["Authentication<br/>[AuthScreens.kt]"]
  node_profile["Profile<br/>[ProfileScreen.kt]"]
  node_settings["Settings<br/>[SettingsScreen.kt]"]
  node_preferences["User preferences"]
end

node_user(("User"))
node_gemini{{"Gemini API"}}

node_user -.->|"opens app"| node_activity
node_activity -.->|"shows entry"| node_front
node_front -.->|"continues to"| node_home
node_home -.->|"uses state"| node_viewmodel
node_viewmodel -.->|"accesses data"| node_safety_data
node_viewmodel -.->|"supports routes"| node_routes
node_viewmodel -.->|"supports map"| node_map
node_routes -.->|"shows details"| node_risk_dialog
node_map -.->|"shows risk"| node_risk_badge
node_map -.->|"shows score"| node_score_dial
node_routes -.->|"shows timing"| node_time_risk
node_routes -.->|"offers simulation"| node_journey
node_map -.->|"offers reporting"| node_report
node_home -.->|"offers fake call"| node_fake_call
node_safety_data -.->|"uses models"| node_models
node_user -.->|"starts chat"| node_chat
node_chat -.->|"requests AI"| node_ai_service
node_ai_service -.->|"queries service"| node_gemini
node_user -.->|"authenticates"| node_auth
node_user -.->|"manages profile"| node_profile
node_user -.->|"changes settings"| node_settings
node_settings -.->|"stores preferences"| node_preferences

click node_activity "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/MainActivity.kt"
click node_viewmodel "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/viewmodel/SheRouteViewModel.kt"
click node_front "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SheRouteFrontScreen.kt"
click node_home "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/HomeScreen.kt"
click node_routes "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/RoutesScreen.kt"
click node_map "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SafetyMapScreen.kt"
click node_risk_dialog "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/ExplainableRiskDialog.kt"
click node_risk_badge "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/RiskLevelBadge.kt"
click node_score_dial "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/SafetyScoreDial.kt"
click node_time_risk "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/TimeRiskDialog.kt"
click node_journey "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/LiveJourneySimulationSheet.kt"
click node_report "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/ReportIncidentDialog.kt"
click node_fake_call "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/FakeCallScreen.kt"
click node_safety_data "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/data/SheRouteRepository.kt"
click node_models "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/model/SafetyModels.kt"
click node_chat "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/AiChatScreen.kt"
click node_ai_service "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ai/SheRouteAiService.kt"
click node_auth "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/AuthScreens.kt"
click node_profile "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/ProfileScreen.kt"
click node_settings "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SettingsScreen.kt"
click node_preferences "https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/data/UserPreferencesRepository.kt"

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_activity,node_viewmodel,node_front,node_home,node_user toneBlue
class node_routes,node_map,node_risk_dialog,node_risk_badge,node_score_dial,node_time_risk,node_journey,node_report,node_fake_call toneAmber
class node_safety_data,node_models,node_chat,node_ai_service,node_gemini toneMint
class node_auth,node_profile,node_settings,node_preferences toneRose
```

## Components

### App flow

- [App entry](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/MainActivity.kt): `app/src/main/java/com/example/MainActivity.kt`
- [App state](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/viewmodel/SheRouteViewModel.kt): `app/src/main/java/com/example/viewmodel/SheRouteViewModel.kt`
- [Welcome screen](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SheRouteFrontScreen.kt): `app/src/main/java/com/example/ui/screens/SheRouteFrontScreen.kt`
- [Home](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/HomeScreen.kt): `app/src/main/java/com/example/ui/screens/HomeScreen.kt`

### Safety features

- [Routes](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/RoutesScreen.kt): `app/src/main/java/com/example/ui/screens/RoutesScreen.kt`
- [Safety map](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SafetyMapScreen.kt): `app/src/main/java/com/example/ui/screens/SafetyMapScreen.kt`
- [Risk explanation](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/ExplainableRiskDialog.kt): `app/src/main/java/com/example/ui/components/ExplainableRiskDialog.kt`
- [Risk indicator](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/RiskLevelBadge.kt): `app/src/main/java/com/example/ui/components/RiskLevelBadge.kt`
- [Safety score](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/SafetyScoreDial.kt): `app/src/main/java/com/example/ui/components/SafetyScoreDial.kt`
- [Time risk](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/TimeRiskDialog.kt): `app/src/main/java/com/example/ui/components/TimeRiskDialog.kt`
- [Journey simulation](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/LiveJourneySimulationSheet.kt): `app/src/main/java/com/example/ui/components/LiveJourneySimulationSheet.kt`
- [Incident report](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/ReportIncidentDialog.kt): `app/src/main/java/com/example/ui/components/ReportIncidentDialog.kt`
- [Fake call](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/components/FakeCallScreen.kt): `app/src/main/java/com/example/ui/components/FakeCallScreen.kt`

### Data and AI

- [Safety data](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/data/SheRouteRepository.kt): `app/src/main/java/com/example/data/SheRouteRepository.kt`
- [Safety models](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/model/SafetyModels.kt): `app/src/main/java/com/example/model/SafetyModels.kt`
- [AI chat](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/AiChatScreen.kt): `app/src/main/java/com/example/ui/screens/AiChatScreen.kt`
- [AI service](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ai/SheRouteAiService.kt): `app/src/main/java/com/example/ai/SheRouteAiService.kt`

### Account and settings

- [Authentication](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/AuthScreens.kt): `app/src/main/java/com/example/ui/screens/AuthScreens.kt`
- [Profile](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/ProfileScreen.kt): `app/src/main/java/com/example/ui/screens/ProfileScreen.kt`
- [Settings](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/ui/screens/SettingsScreen.kt): `app/src/main/java/com/example/ui/screens/SettingsScreen.kt`
- [User preferences](https://github.com/poojanellore/sheroute/blob/main/app/src/main/java/com/example/data/UserPreferencesRepository.kt): `app/src/main/java/com/example/data/UserPreferencesRepository.kt`

### Other components

- **User**
- **Gemini API**

## Connections

- User → App entry: opens app
- App entry → Welcome screen: shows entry
- Welcome screen → Home: continues to
- Home → App state: uses state
- App state → Safety data: accesses data
- App state → Routes: supports routes
- App state → Safety map: supports map
- Routes → Risk explanation: shows details
- Safety map → Risk indicator: shows risk
- Safety map → Safety score: shows score
- Routes → Time risk: shows timing
- Routes → Journey simulation: offers simulation
- Safety map → Incident report: offers reporting
- Home → Fake call: offers fake call
- Safety data → Safety models: uses models
- User → AI chat: starts chat
- AI chat → AI service: requests AI
- AI service → Gemini API: queries service
- User → Authentication: authenticates
- User → Profile: manages profile
- User → Settings: changes settings
- Settings → User preferences: stores preferences
