# laidback-programmer/tarang architecture

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

- Interactive diagram: https://gitdiagram.com/laidback-programmer/tarang
- Repository: https://github.com/laidback-programmer/tarang

## Overview

Tarang is a Flutter maritime-hazard response app. Citizens authenticate, submit located hazard reports, and follow their status; maritime officials review and update those reports. The README also describes maps, community reports, emergency guidance and SOS, news, dashboards, analytics, and alerts. Feature links below reflect documented workflows and capabilities; application source was not sampled, so implementation-level calls and some wiring remain unverified. Platform-shell nodes are included for the indexed core files, not as build-system components.

Main entry points: [`lib/models/hazard_report.dart`](https://github.com/laidback-programmer/tarang/blob/main/lib/models/hazard_report.dart) (Hazard reports), [`windows/runner/flutter_window.h`](https://github.com/laidback-programmer/tarang/blob/main/windows/runner/flutter_window.h) (Windows Flutter host), [`lib/screens/auth`](https://github.com/laidback-programmer/tarang/tree/main/lib/screens/auth) (Sign-in and roles), [`lib/screens/citizen/add_report_screen.dart`](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/add_report_screen.dart) (Submit hazard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen features"]
  node_auth["Sign-in and roles"]
  node_report_submit["Submit hazard"]
  node_report_status["Track report status"]
  node_community["Community reports"]
  node_hazard_map["Live hazard map<br/>[live_osm_map.dart]"]
  node_emergency["Emergency SOS"]
  node_assistant["AI assistant"]
  node_news["Safety news<br/>[news_screen.dart]"]
end

subgraph group_official["Official response"]
  node_official_dashboard["Official dashboard"]
  node_report_management["Manage reports"]
  node_analytics["Analytics"]
  node_alerts["Alert management"]
end

subgraph group_shared["Shared app services"]
  node_report_data["Hazard reports<br/>[hazard_report.dart]"]
  node_location["Location services"]
  node_firebase[("Firebase")]
  node_ai_service["AI prediction"]
  node_news_service["News integration"]
end

subgraph group_platform["Platform shells"]
  node_windows_entry["Windows entry<br/>[main.cpp]"]
  node_windows_flutter["Windows Flutter host<br/>[flutter_window.h]"]
  node_windows_native["Windows window<br/>[win32_window.h]"]
  node_windows_plugins["Windows plugins"]
  node_linux_entry["Linux entry<br/>[main.cc]"]
  node_linux_app["Linux application<br/>[my_application.h]"]
  node_linux_plugins["Linux plugins"]
  node_mac_plugins["macOS plugins"]
  node_ios_app["iOS app delegate<br/>[AppDelegate.swift]"]
end

node_citizen_actor(("Citizen"))
node_official_actor(("Maritime official"))

node_citizen_actor -->|"signs in"| node_auth
node_auth -->|"enables reporting"| node_report_submit
node_citizen_actor -->|"submits"| node_report_submit
node_report_submit -->|"creates report"| node_report_data
node_report_data -->|"stored in"| node_firebase
node_report_data -->|"status tracking"| node_report_status
node_report_data -->|"shown as reports"| node_community
node_report_data -->|"shown on map"| node_hazard_map
node_location -->|"provides location"| node_hazard_map
node_citizen_actor -->|"requests help"| node_emergency
node_citizen_actor -->|"seeks guidance"| node_assistant
node_assistant -.->|"gets predictions"| node_ai_service
node_citizen_actor -->|"reads news"| node_news
node_news -.->|"loads news"| node_news_service
node_official_actor -->|"signs in"| node_auth
node_official_actor -->|"views overview"| node_official_dashboard
node_official_dashboard -->|"summarizes incidents"| node_report_data
node_official_actor -->|"reviews reports"| node_report_management
node_report_management -->|"updates status"| node_report_data
node_official_actor -->|"views trends"| node_analytics
node_official_actor -->|"manages alerts"| node_alerts
node_windows_entry -->|"creates host"| node_windows_flutter
node_windows_flutter -->|"extends window"| node_windows_native
node_windows_flutter -->|"registers plugins"| node_windows_plugins
node_linux_entry -->|"runs application"| node_linux_app
node_linux_app -->|"registers plugins"| node_linux_plugins
node_ios_app -->|"registers plugins"| node_mac_plugins

click node_auth "https://github.com/laidback-programmer/tarang/tree/main/lib/screens/auth"
click node_report_submit "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/add_report_screen.dart"
click node_report_data "https://github.com/laidback-programmer/tarang/blob/main/lib/models/hazard_report.dart"
click node_report_status "https://github.com/laidback-programmer/tarang/tree/main/lib/screens/citizen"
click node_community "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/citizen_home_screen.dart"
click node_hazard_map "https://github.com/laidback-programmer/tarang/blob/main/lib/live_osm_map.dart"
click node_location "https://github.com/laidback-programmer/tarang/blob/main/lib/services/location_service.dart"
click node_emergency "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/emergency_screen.dart"
click node_assistant "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/ai_assistant_screen.dart"
click node_news "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/news_screen.dart"
click node_official_dashboard "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/official_dashboard_screen.dart"
click node_report_management "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/reports_management_screen.dart"
click node_analytics "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/analytics_screen.dart"
click node_alerts "https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/alert_management_screen.dart"
click node_ai_service "https://github.com/laidback-programmer/tarang/blob/main/lib/services/ai_prediction_service.dart"
click node_news_service "https://github.com/laidback-programmer/tarang/blob/main/lib/services/gemini_news_service.dart"
click node_windows_entry "https://github.com/laidback-programmer/tarang/blob/main/windows/runner/main.cpp"
click node_windows_flutter "https://github.com/laidback-programmer/tarang/blob/main/windows/runner/flutter_window.h"
click node_windows_native "https://github.com/laidback-programmer/tarang/blob/main/windows/runner/win32_window.h"
click node_windows_plugins "https://github.com/laidback-programmer/tarang/blob/main/windows/flutter/generated_plugin_registrant.h"
click node_linux_entry "https://github.com/laidback-programmer/tarang/blob/main/linux/runner/main.cc"
click node_linux_app "https://github.com/laidback-programmer/tarang/blob/main/linux/runner/my_application.h"
click node_linux_plugins "https://github.com/laidback-programmer/tarang/blob/main/linux/flutter/generated_plugin_registrant.h"
click node_mac_plugins "https://github.com/laidback-programmer/tarang/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift"
click node_ios_app "https://github.com/laidback-programmer/tarang/blob/main/ios/Runner/AppDelegate.swift"

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_auth,node_report_submit,node_report_status,node_community,node_hazard_map,node_emergency,node_assistant,node_news toneBlue
class node_official_dashboard,node_report_management,node_analytics,node_alerts toneAmber
class node_report_data,node_location,node_firebase,node_ai_service,node_news_service toneMint
class node_windows_entry,node_windows_flutter,node_windows_native,node_windows_plugins,node_linux_entry,node_linux_app,node_linux_plugins,node_mac_plugins,node_ios_app toneRose
class node_citizen_actor,node_official_actor toneIndigo
```

## Components

### Citizen features

- [Sign-in and roles](https://github.com/laidback-programmer/tarang/tree/main/lib/screens/auth): `lib/screens/auth`
- [Submit hazard](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/add_report_screen.dart): `lib/screens/citizen/add_report_screen.dart`
- [Track report status](https://github.com/laidback-programmer/tarang/tree/main/lib/screens/citizen): `lib/screens/citizen`
- [Community reports](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/citizen_home_screen.dart): `lib/screens/citizen/citizen_home_screen.dart`
- [Live hazard map](https://github.com/laidback-programmer/tarang/blob/main/lib/live_osm_map.dart): `lib/live_osm_map.dart`
- [Emergency SOS](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/emergency_screen.dart): `lib/screens/citizen/emergency_screen.dart`
- [AI assistant](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/ai_assistant_screen.dart): `lib/screens/citizen/ai_assistant_screen.dart`
- [Safety news](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/citizen/news_screen.dart): `lib/screens/citizen/news_screen.dart`

### Official response

- [Official dashboard](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/official_dashboard_screen.dart): `lib/screens/official/official_dashboard_screen.dart`
- [Manage reports](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/reports_management_screen.dart): `lib/screens/official/reports_management_screen.dart`
- [Analytics](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/analytics_screen.dart): `lib/screens/official/analytics_screen.dart`
- [Alert management](https://github.com/laidback-programmer/tarang/blob/main/lib/screens/official/alert_management_screen.dart): `lib/screens/official/alert_management_screen.dart`

### Shared app services

- [Hazard reports](https://github.com/laidback-programmer/tarang/blob/main/lib/models/hazard_report.dart): `lib/models/hazard_report.dart`
- [Location services](https://github.com/laidback-programmer/tarang/blob/main/lib/services/location_service.dart): `lib/services/location_service.dart`
- **Firebase**
- [AI prediction](https://github.com/laidback-programmer/tarang/blob/main/lib/services/ai_prediction_service.dart): `lib/services/ai_prediction_service.dart`
- [News integration](https://github.com/laidback-programmer/tarang/blob/main/lib/services/gemini_news_service.dart): `lib/services/gemini_news_service.dart`

### Platform shells

- [Windows entry](https://github.com/laidback-programmer/tarang/blob/main/windows/runner/main.cpp): `windows/runner/main.cpp`
- [Windows Flutter host](https://github.com/laidback-programmer/tarang/blob/main/windows/runner/flutter_window.h): `windows/runner/flutter_window.h`
- [Windows window](https://github.com/laidback-programmer/tarang/blob/main/windows/runner/win32_window.h): `windows/runner/win32_window.h`
- [Windows plugins](https://github.com/laidback-programmer/tarang/blob/main/windows/flutter/generated_plugin_registrant.h): `windows/flutter/generated_plugin_registrant.h`
- [Linux entry](https://github.com/laidback-programmer/tarang/blob/main/linux/runner/main.cc): `linux/runner/main.cc`
- [Linux application](https://github.com/laidback-programmer/tarang/blob/main/linux/runner/my_application.h): `linux/runner/my_application.h`
- [Linux plugins](https://github.com/laidback-programmer/tarang/blob/main/linux/flutter/generated_plugin_registrant.h): `linux/flutter/generated_plugin_registrant.h`
- [macOS plugins](https://github.com/laidback-programmer/tarang/blob/main/macos/Flutter/GeneratedPluginRegistrant.swift): `macos/Flutter/GeneratedPluginRegistrant.swift`
- [iOS app delegate](https://github.com/laidback-programmer/tarang/blob/main/ios/Runner/AppDelegate.swift): `ios/Runner/AppDelegate.swift`

### Other components

- **Citizen**
- **Maritime official**

## Connections

- Citizen → Sign-in and roles: signs in (evidence: `README.md`)
- Sign-in and roles → Submit hazard: enables reporting (evidence: `README.md`)
- Citizen → Submit hazard: submits (evidence: `README.md`)
- Submit hazard → Hazard reports: creates report (evidence: `README.md`)
- Hazard reports → Firebase: stored in (evidence: `README.md`)
- Hazard reports → Track report status: status tracking (evidence: `README.md`)
- Hazard reports → Community reports: shown as reports (evidence: `README.md`)
- Hazard reports → Live hazard map: shown on map (evidence: `README.md`)
- Location services → Live hazard map: provides location (evidence: `README.md`)
- Citizen → Emergency SOS: requests help (evidence: `README.md`)
- Citizen → AI assistant: seeks guidance (evidence: `README.md`)
- AI assistant → AI prediction: gets predictions
- Citizen → Safety news: reads news (evidence: `README.md`)
- Safety news → News integration: loads news
- Maritime official → Sign-in and roles: signs in (evidence: `README.md`)
- Maritime official → Official dashboard: views overview (evidence: `README.md`)
- Official dashboard → Hazard reports: summarizes incidents (evidence: `README.md`)
- Maritime official → Manage reports: reviews reports (evidence: `README.md`)
- Manage reports → Hazard reports: updates status (evidence: `README.md`)
- Maritime official → Analytics: views trends (evidence: `README.md`)
- Maritime official → Alert management: manages alerts (evidence: `README.md`)
- Windows entry → Windows Flutter host: creates host (evidence: `windows/runner/main.cpp`)
- Windows Flutter host → Windows window: extends window (evidence: `windows/runner/flutter_window.h`)
- Windows Flutter host → Windows plugins: registers plugins
- Linux entry → Linux application: runs application (evidence: `linux/runner/main.cc`)
- Linux application → Linux plugins: registers plugins (evidence: `linux/runner/my_application.cc`)
- iOS app delegate → macOS plugins: registers plugins (evidence: `ios/Runner/AppDelegate.swift`)
