# shagunpathak1508-create/e_madad architecture

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

- Interactive diagram: https://gitdiagram.com/shagunpathak1508-create/e_madad
- Repository: https://github.com/shagunpathak1508-create/e_madad

## Overview

eMADAD is a Flutter emergency-response app connecting people requesting help with nearby volunteer responders. The documented user flow runs from permissions and home selection through SOS, emergency classification, and response actions; volunteers can sign up or manage requests from a dashboard. The README documents maps, nearby services, offline location history, SMS/calls, and Firestore-backed volunteer/request data. Dart source excerpts were not provided, so links among service modules are limited to relationships stated in the README; matching internals are represented without speculative wiring.

Main entry points: [`lib/screens/map_screen.dart`](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/map_screen.dart) (Emergency map), [`lib/services/firestore_service.dart`](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/firestore_service.dart) (Firestore access), [`lib/screens/home_screen.dart`](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/home_screen.dart) (Home choices), [`lib/screens/emergency_response_screen.dart`](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/emergency_response_screen.dart) (Response actions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["App experience"]
  node_main["App routing<br/>[main.dart]"]
  node_permissions["Permissions"]
  node_home["Home choices<br/>[home_screen.dart]"]
end

subgraph group_emergency["Emergency response"]
  node_sos["SOS trigger<br/>[sos_screen.dart]"]
  node_type["Emergency type"]
  node_response["Response actions"]
  node_emergency_model["Emergency data"]
  node_sms["Emergency messaging<br/>[sms_service.dart]"]
end

subgraph group_volunteers["Volunteer network"]
  node_match["Volunteer matches"]
  node_signup["Volunteer signup"]
  node_dashboard["Volunteer dashboard"]
  node_volmap["Volunteer navigation"]
  node_volmatch["Incoming request"]
  node_volunteer_model["Volunteer data"]
  node_allocation["Request allocation"]
  node_gemini["AI matching"]
end

subgraph group_platform["Location and data"]
  node_map["Emergency map<br/>[map_screen.dart]"]
  node_firestore["Firestore access"]
  node_location["GPS location"]
  node_cache["Offline cache<br/>[cache_service.dart]"]
  node_connectivity["Connectivity status"]
  node_nearby["Nearby services"]
end

node_user(("App user"))
node_firestore_db[("Firebase Firestore")]
node_overpass["Overpass API"]
node_phone["Phone and SMS"]
node_osm["OpenStreetMap"]

node_user -->|"launches"| node_main
node_main -->|"routes to"| node_permissions
node_permissions -->|"continues to"| node_home
node_user -->|"chooses help"| node_home
node_home -->|"requests help"| node_sos
node_sos -->|"confirms SOS"| node_type
node_type -->|"selects category"| node_response
node_response -->|"requests SMS"| node_sms
node_sms -->|"opens call or SMS"| node_phone
node_response -->|"opens map"| node_map
node_response -->|"seeks volunteers"| node_match
node_home -->|"starts volunteering"| node_signup
node_home -->|"returns as volunteer"| node_dashboard
node_dashboard -->|"handles requests"| node_volmatch
node_dashboard -->|"navigates to victim"| node_volmap
node_match -->|"requests matches"| node_allocation
node_allocation -.->|"uses matching"| node_gemini
node_allocation -->|"reads volunteers"| node_firestore
node_signup -->|"saves volunteer"| node_firestore
node_dashboard -->|"reads and updates"| node_firestore
node_firestore -->|"reads and writes"| node_firestore_db
node_firestore -->|"maps volunteer data"| node_volunteer_model
node_firestore -->|"maps request data"| node_emergency_model
node_map -->|"uses GPS"| node_location
node_volmap -->|"uses GPS"| node_location
node_location -->|"stores trail"| node_cache
node_map -->|"reads offline trail"| node_cache
node_connectivity -->|"provides status"| node_map
node_map -->|"loads nearby places"| node_nearby
node_nearby -->|"queries places"| node_overpass
node_map -->|"renders tiles"| node_osm

click node_main "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/main.dart"
click node_permissions "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/permissions_screen.dart"
click node_home "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/home_screen.dart"
click node_sos "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/sos_screen.dart"
click node_type "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/emergency_type_screen.dart"
click node_response "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/emergency_response_screen.dart"
click node_match "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_match_screen.dart"
click node_map "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/map_screen.dart"
click node_signup "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_signup_screen.dart"
click node_dashboard "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_dashboard_screen.dart"
click node_volmap "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_map_screen.dart"
click node_volmatch "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_match_screen.dart"
click node_emergency_model "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/models/emergency_model.dart"
click node_volunteer_model "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/models/volunteer_model.dart"
click node_allocation "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/allocation_service.dart"
click node_gemini "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/gemini_matching_service.dart"
click node_firestore "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/firestore_service.dart"
click node_location "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/location_service.dart"
click node_cache "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/cache_service.dart"
click node_connectivity "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/connectivity_service.dart"
click node_nearby "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/nearby_service.dart"
click node_sms "https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/sms_service.dart"

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_main,node_permissions,node_home,node_user toneBlue
class node_sos,node_type,node_response,node_emergency_model,node_sms,node_firestore_db toneAmber
class node_match,node_signup,node_dashboard,node_volmap,node_volmatch,node_volunteer_model,node_allocation,node_gemini,node_overpass toneMint
class node_map,node_firestore,node_location,node_cache,node_connectivity,node_nearby toneRose
class node_phone,node_osm toneIndigo
```

## Components

### App experience

- [App routing](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/main.dart): `lib/main.dart`
- [Permissions](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/permissions_screen.dart): `lib/screens/permissions_screen.dart`
- [Home choices](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/home_screen.dart): `lib/screens/home_screen.dart`

### Emergency response

- [SOS trigger](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/sos_screen.dart): `lib/screens/sos_screen.dart`
- [Emergency type](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/emergency_type_screen.dart): `lib/screens/emergency_type_screen.dart`
- [Response actions](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/emergency_response_screen.dart): `lib/screens/emergency_response_screen.dart`
- [Emergency data](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/models/emergency_model.dart): `lib/models/emergency_model.dart`
- [Emergency messaging](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/sms_service.dart): `lib/services/sms_service.dart`

### Volunteer network

- [Volunteer matches](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_match_screen.dart): `lib/screens/volunteer_match_screen.dart`
- [Volunteer signup](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_signup_screen.dart): `lib/screens/volunteer_signup_screen.dart`
- [Volunteer dashboard](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_dashboard_screen.dart): `lib/screens/volunteer_dashboard_screen.dart`
- [Volunteer navigation](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_map_screen.dart): `lib/screens/volunteer_map_screen.dart`
- [Incoming request](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/volunteer_match_screen.dart): `lib/screens/volunteer_match_screen.dart`
- [Volunteer data](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/models/volunteer_model.dart): `lib/models/volunteer_model.dart`
- [Request allocation](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/allocation_service.dart): `lib/services/allocation_service.dart`
- [AI matching](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/gemini_matching_service.dart): `lib/services/gemini_matching_service.dart`

### Location and data

- [Emergency map](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/screens/map_screen.dart): `lib/screens/map_screen.dart`
- [Firestore access](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/firestore_service.dart): `lib/services/firestore_service.dart`
- [GPS location](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/location_service.dart): `lib/services/location_service.dart`
- [Offline cache](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/cache_service.dart): `lib/services/cache_service.dart`
- [Connectivity status](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/connectivity_service.dart): `lib/services/connectivity_service.dart`
- [Nearby services](https://github.com/shagunpathak1508-create/e_madad/blob/main/lib/services/nearby_service.dart): `lib/services/nearby_service.dart`

### Other components

- **App user**
- **Firebase Firestore**
- **Overpass API**
- **Phone and SMS**
- **OpenStreetMap**

## Connections

- App user → App routing: launches
- App routing → Permissions: routes to
- Permissions → Home choices: continues to
- App user → Home choices: chooses help
- Home choices → SOS trigger: requests help
- SOS trigger → Emergency type: confirms SOS
- Emergency type → Response actions: selects category
- Response actions → Emergency messaging: requests SMS
- Emergency messaging → Phone and SMS: opens call or SMS
- Response actions → Emergency map: opens map
- Response actions → Volunteer matches: seeks volunteers
- Home choices → Volunteer signup: starts volunteering
- Home choices → Volunteer dashboard: returns as volunteer
- Volunteer dashboard → Incoming request: handles requests
- Volunteer dashboard → Volunteer navigation: navigates to victim
- Volunteer matches → Request allocation: requests matches
- Request allocation → AI matching: uses matching
- Request allocation → Firestore access: reads volunteers
- Volunteer signup → Firestore access: saves volunteer
- Volunteer dashboard → Firestore access: reads and updates
- Firestore access → Firebase Firestore: reads and writes
- Firestore access → Volunteer data: maps volunteer data
- Firestore access → Emergency data: maps request data
- Emergency map → GPS location: uses GPS
- Volunteer navigation → GPS location: uses GPS
- GPS location → Offline cache: stores trail
- Emergency map → Offline cache: reads offline trail
- Connectivity status → Emergency map: provides status
- Emergency map → Nearby services: loads nearby places
- Nearby services → Overpass API: queries places
- Emergency map → OpenStreetMap: renders tiles
