# dhvani30/noor architecture

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

- Interactive diagram: https://gitdiagram.com/dhvani30/noor
- Repository: https://github.com/dhvani30/noor

## Overview

Noor appears to be a Flutter personal-safety app, with Mumbai risk data and route-safety features suggested by the source tree. A likely user journey is authentication, viewing safety information, and using map, route-planning, or emergency tools. The README is only Flutter starter text, and Flutter application sources were not excerpted, so those runtime connections are unverified. The Python excerpts do show separate data-preparation and risk-generation scripts that export the shared risk-grid JSON; their relationships to the app are not established by the available evidence.

Main entry points: [`lib/home_page.dart`](https://github.com/dhvani30/noor/blob/main/lib/home_page.dart) (Safety home), [`lib/screens/safe_route_map.dart`](https://github.com/dhvani30/noor/blob/main/lib/screens/safe_route_map.dart) (Risk map), [`lib/services/fake_call_service.dart`](https://github.com/dhvani30/noor/blob/main/lib/services/fake_call_service.dart) (Fake call), [`assets/data/mumbai_risk_grid.json`](https://github.com/dhvani30/noor/blob/main/assets/data/mumbai_risk_grid.json) (Risk grid data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Safety app"]
  node_entry["App entry<br/>[main.dart]"]
  node_home["Safety home<br/>[home_page.dart]"]
  node_news["Safety news<br/>[news_page.dart]"]
end

subgraph group_mapping["Risk and routes"]
  node_riskmap["Risk map"]
  node_mapbox["Mapbox route"]
  node_planner["Route planner"]
  node_route_risk["Route risk"]
  node_forecast["Risk forecast"]
  node_forecast_model["Forecast model<br/>[risk_forecast.dart]"]
  node_risk_model["Mumbai risk model<br/>[mumbai_risk.dart]"]
  node_offline_risk["Offline risk"]
  node_risk_api["Risk API"]
end

subgraph group_emergency["Emergency tools"]
  node_sos["SOS service<br/>[sos_service.dart]"]
  node_emergency_card["Emergency card"]
  node_fake_call["Fake call"]
  node_call_setup["Call setup"]
  node_incoming_call["Incoming call"]
  node_active_call["Active call"]
  node_widget["Android SOS widget"]
end

subgraph group_account["Account and interface"]
  node_auth["Authentication<br/>[auth_service.dart]"]
  node_auth_provider["Auth state<br/>[auth_provider.dart]"]
  node_login["Login screen<br/>[login_page.dart]"]
  node_profile["Profile<br/>[profile_page.dart]"]
  node_theme["Theme settings"]
end

subgraph group_riskdata["Risk data preparation"]
  node_risk_grid["Risk grid data"]
  node_risk_training["Risk training"]
  node_risk_synthetic["Synthetic risk data<br/>[run_ai_pipeline.py]"]
end

node_person(("App user"))

node_person -.->|"opens"| node_entry
node_entry -.->|"shows"| node_home
node_home -.->|"opens"| node_riskmap
node_home -.->|"opens"| node_news
node_home -.->|"opens"| node_planner
node_planner -.->|"checks risk"| node_route_risk
node_riskmap -.->|"loads risk"| node_offline_risk
node_riskmap -.->|"requests risk"| node_risk_api
node_riskmap -.->|"loads forecast"| node_forecast
node_forecast -.->|"uses model"| node_forecast_model
node_offline_risk -.->|"reads"| node_risk_grid
node_risk_api -.->|"uses model"| node_risk_model
node_risk_training -->|"writes"| node_risk_grid
node_risk_synthetic -->|"writes"| node_risk_grid
node_person -.->|"signs in"| node_login
node_login -.->|"uses state"| node_auth_provider
node_auth_provider -.->|"delegates"| node_auth
node_person -.->|"views"| node_profile
node_person -.->|"requests help"| node_sos
node_person -.->|"opens"| node_emergency_card
node_person -.->|"sets up call"| node_call_setup
node_call_setup -.->|"configures"| node_fake_call
node_fake_call -.->|"shows call"| node_incoming_call
node_fake_call -.->|"starts call"| node_active_call
node_person -.->|"changes theme"| node_theme
node_person -.->|"triggers SOS"| node_widget

click node_entry "https://github.com/dhvani30/noor/blob/main/lib/main.dart"
click node_home "https://github.com/dhvani30/noor/blob/main/lib/home_page.dart"
click node_news "https://github.com/dhvani30/noor/blob/main/lib/news_page.dart"
click node_riskmap "https://github.com/dhvani30/noor/blob/main/lib/screens/safe_route_map.dart"
click node_mapbox "https://github.com/dhvani30/noor/blob/main/lib/screens/mapbox_safe_route.dart"
click node_planner "https://github.com/dhvani30/noor/blob/main/lib/widgets/safe_route_planner.dart"
click node_route_risk "https://github.com/dhvani30/noor/blob/main/lib/services/route_risk_service.dart"
click node_forecast "https://github.com/dhvani30/noor/blob/main/lib/services/forecast_service.dart"
click node_forecast_model "https://github.com/dhvani30/noor/blob/main/lib/models/risk_forecast.dart"
click node_risk_model "https://github.com/dhvani30/noor/blob/main/lib/models/mumbai_risk.dart"
click node_offline_risk "https://github.com/dhvani30/noor/blob/main/lib/services/offline_risk_service.dart"
click node_risk_api "https://github.com/dhvani30/noor/blob/main/lib/services/risk_api_service.dart"
click node_risk_grid "https://github.com/dhvani30/noor/blob/main/assets/data/mumbai_risk_grid.json"
click node_risk_training "https://github.com/dhvani30/noor/blob/main/lib/python/generate_heatmap_tiles.py"
click node_risk_synthetic "https://github.com/dhvani30/noor/blob/main/lib/python/run_ai_pipeline.py"
click node_sos "https://github.com/dhvani30/noor/blob/main/lib/services/sos_service.dart"
click node_emergency_card "https://github.com/dhvani30/noor/blob/main/lib/widgets/emergency_card.dart"
click node_fake_call "https://github.com/dhvani30/noor/blob/main/lib/services/fake_call_service.dart"
click node_call_setup "https://github.com/dhvani30/noor/blob/main/lib/screens/fake_call_setup.dart"
click node_incoming_call "https://github.com/dhvani30/noor/blob/main/lib/screens/incoming_call_screen.dart"
click node_active_call "https://github.com/dhvani30/noor/blob/main/lib/screens/active_call_screen.dart"
click node_auth "https://github.com/dhvani30/noor/blob/main/lib/services/auth_service.dart"
click node_auth_provider "https://github.com/dhvani30/noor/blob/main/lib/providers/auth_provider.dart"
click node_login "https://github.com/dhvani30/noor/blob/main/lib/screens/login_page.dart"
click node_profile "https://github.com/dhvani30/noor/blob/main/lib/profile_page.dart"
click node_theme "https://github.com/dhvani30/noor/blob/main/lib/theme/theme_provider.dart"
click node_widget "https://github.com/dhvani30/noor/blob/main/android/app/src/main/kotlin/com/example/noor_new/MyWidgetProvider.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_entry,node_home,node_news,node_person toneBlue
class node_riskmap,node_mapbox,node_planner,node_route_risk,node_forecast,node_forecast_model,node_risk_model,node_offline_risk,node_risk_api toneAmber
class node_sos,node_emergency_card,node_fake_call,node_call_setup,node_incoming_call,node_active_call,node_widget toneMint
class node_auth,node_auth_provider,node_login,node_profile,node_theme toneRose
class node_risk_grid,node_risk_training,node_risk_synthetic toneIndigo
```

## Components

### Safety app

- [App entry](https://github.com/dhvani30/noor/blob/main/lib/main.dart): `lib/main.dart`
- [Safety home](https://github.com/dhvani30/noor/blob/main/lib/home_page.dart): `lib/home_page.dart`
- [Safety news](https://github.com/dhvani30/noor/blob/main/lib/news_page.dart): `lib/news_page.dart`

### Risk and routes

- [Risk map](https://github.com/dhvani30/noor/blob/main/lib/screens/safe_route_map.dart): `lib/screens/safe_route_map.dart`
- [Mapbox route](https://github.com/dhvani30/noor/blob/main/lib/screens/mapbox_safe_route.dart): `lib/screens/mapbox_safe_route.dart`
- [Route planner](https://github.com/dhvani30/noor/blob/main/lib/widgets/safe_route_planner.dart): `lib/widgets/safe_route_planner.dart`
- [Route risk](https://github.com/dhvani30/noor/blob/main/lib/services/route_risk_service.dart): `lib/services/route_risk_service.dart`
- [Risk forecast](https://github.com/dhvani30/noor/blob/main/lib/services/forecast_service.dart): `lib/services/forecast_service.dart`
- [Forecast model](https://github.com/dhvani30/noor/blob/main/lib/models/risk_forecast.dart): `lib/models/risk_forecast.dart`
- [Mumbai risk model](https://github.com/dhvani30/noor/blob/main/lib/models/mumbai_risk.dart): `lib/models/mumbai_risk.dart`
- [Offline risk](https://github.com/dhvani30/noor/blob/main/lib/services/offline_risk_service.dart): `lib/services/offline_risk_service.dart`
- [Risk API](https://github.com/dhvani30/noor/blob/main/lib/services/risk_api_service.dart): `lib/services/risk_api_service.dart`

### Emergency tools

- [SOS service](https://github.com/dhvani30/noor/blob/main/lib/services/sos_service.dart): `lib/services/sos_service.dart`
- [Emergency card](https://github.com/dhvani30/noor/blob/main/lib/widgets/emergency_card.dart): `lib/widgets/emergency_card.dart`
- [Fake call](https://github.com/dhvani30/noor/blob/main/lib/services/fake_call_service.dart): `lib/services/fake_call_service.dart`
- [Call setup](https://github.com/dhvani30/noor/blob/main/lib/screens/fake_call_setup.dart): `lib/screens/fake_call_setup.dart`
- [Incoming call](https://github.com/dhvani30/noor/blob/main/lib/screens/incoming_call_screen.dart): `lib/screens/incoming_call_screen.dart`
- [Active call](https://github.com/dhvani30/noor/blob/main/lib/screens/active_call_screen.dart): `lib/screens/active_call_screen.dart`
- [Android SOS widget](https://github.com/dhvani30/noor/blob/main/android/app/src/main/kotlin/com/example/noor_new/MyWidgetProvider.kt): `android/app/src/main/kotlin/com/example/noor_new/MyWidgetProvider.kt`

### Account and interface

- [Authentication](https://github.com/dhvani30/noor/blob/main/lib/services/auth_service.dart): `lib/services/auth_service.dart`
- [Auth state](https://github.com/dhvani30/noor/blob/main/lib/providers/auth_provider.dart): `lib/providers/auth_provider.dart`
- [Login screen](https://github.com/dhvani30/noor/blob/main/lib/screens/login_page.dart): `lib/screens/login_page.dart`
- [Profile](https://github.com/dhvani30/noor/blob/main/lib/profile_page.dart): `lib/profile_page.dart`
- [Theme settings](https://github.com/dhvani30/noor/blob/main/lib/theme/theme_provider.dart): `lib/theme/theme_provider.dart`

### Risk data preparation

- [Risk grid data](https://github.com/dhvani30/noor/blob/main/assets/data/mumbai_risk_grid.json): `assets/data/mumbai_risk_grid.json`
- [Risk training](https://github.com/dhvani30/noor/blob/main/lib/python/generate_heatmap_tiles.py): `lib/python/generate_heatmap_tiles.py`
- [Synthetic risk data](https://github.com/dhvani30/noor/blob/main/lib/python/run_ai_pipeline.py): `lib/python/run_ai_pipeline.py`

### Other components

- **App user**

## Connections

- App user → App entry: opens
- App entry → Safety home: shows
- Safety home → Risk map: opens
- Safety home → Safety news: opens
- Safety home → Route planner: opens
- Route planner → Route risk: checks risk
- Risk map → Offline risk: loads risk
- Risk map → Risk API: requests risk
- Risk map → Risk forecast: loads forecast
- Risk forecast → Forecast model: uses model
- Offline risk → Risk grid data: reads
- Risk API → Mumbai risk model: uses model
- Risk training → Risk grid data: writes (evidence: `lib/python/generate_heatmap_tiles.py`)
- Synthetic risk data → Risk grid data: writes (evidence: `lib/python/run_ai_pipeline.py`)
- App user → Login screen: signs in
- Login screen → Auth state: uses state
- Auth state → Authentication: delegates
- App user → Profile: views
- App user → SOS service: requests help
- App user → Emergency card: opens
- App user → Call setup: sets up call
- Call setup → Fake call: configures
- Fake call → Incoming call: shows call
- Fake call → Active call: starts call
- App user → Theme settings: changes theme
- App user → Android SOS widget: triggers SOS
