# kushalkumar99/ambulancefirst_app architecture

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

- Interactive diagram: https://gitdiagram.com/kushalkumar99/ambulancefirst_app
- Repository: https://github.com/kushalkumar99/ambulancefirst_app

## Overview

Ambulance First is a Flutter ambulance-trip application. The README documents an active-trip screen that presents ETA, route information, a map preview and a hospital alert, with responsive layout behavior. The tree also contains Supabase functions for route calculation and staff provisioning, but the available evidence does not show how the Flutter screen invokes them or what external services they use. The documented screen path is absent from the supplied tree, so its path is null; platform runner files are host scaffolding rather than the product workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_trip["Active Trip Experience"]
  node_active_trip["Active trip screen"]
end

subgraph group_services["Supabase Functions"]
  node_route_calc["Route calculation<br/>[index.ts]"]
  node_staff_provision["Staff provisioning<br/>[index.ts]"]
end

node_rider(("Trip user"))

node_rider -->|"views trip"| node_active_trip

click node_route_calc "https://github.com/kushalkumar99/ambulancefirst_app/blob/main/supabase/functions/calculate-route/index.ts"
click node_staff_provision "https://github.com/kushalkumar99/ambulancefirst_app/blob/main/supabase/functions/admin-provision-staff/index.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_active_trip,node_rider toneBlue
class node_route_calc,node_staff_provision toneAmber
```

## Components

### Active Trip Experience

- **Active trip screen**

### Supabase Functions

- [Route calculation](https://github.com/kushalkumar99/ambulancefirst_app/blob/main/supabase/functions/calculate-route/index.ts): `supabase/functions/calculate-route/index.ts`
- [Staff provisioning](https://github.com/kushalkumar99/ambulancefirst_app/blob/main/supabase/functions/admin-provision-staff/index.ts): `supabase/functions/admin-provision-staff/index.ts`

### Other components

- **Trip user**

## Connections

- Trip user → Active trip screen: views trip
