# sriramadhenu/accessmapai architecture

> Architecture diagram of the GitHub repository sriramadhenu/accessmapai, 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/sriramadhenu/accessmapai
- Repository: https://github.com/sriramadhenu/accessmapai

## Overview

AccessMap AI is a personalized accessibility-navigation product. A user opens the map dashboard, selects accessibility profiles and a destination, and receives an explainable, hazard-aware route; the dashboard also supports hazard reports, image analysis, map overlays, and spoken directions. At startup, the backend builds an enriched pedestrian graph, then serves routing and map data. Supabase supports hazards and authenticated profiles, while Gemini provides optional image analysis. The README documents several capabilities whose detailed frontend wiring was not sampled, so those links are shown only where documented or left unverified.

Main entry points: [`backend/main.py`](https://github.com/sriramadhenu/accessmapai/blob/main/backend/main.py) (FastAPI service), [`frontend/components/access-dashboard.tsx`](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/access-dashboard.tsx) (Map dashboard), [`backend/pipeline/enrichment.py`](https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/enrichment.py) (Graph enrichment), [`backend/api/hazards.py`](https://github.com/sriramadhenu/accessmapai/blob/main/backend/api/hazards.py) (Hazard endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Map and accounts"]
  node_dashboard["Map dashboard"]
  node_map["Interactive map<br/>[mapbox-map.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_auth_profiles["Auth and profiles<br/>[auth-provider.tsx]"]
  node_profile_api["Profile API<br/>[route.ts]"]
  node_login["Login form<br/>[login-form.tsx]"]
end

subgraph group_api["Backend API"]
  node_backend["FastAPI service<br/>[main.py]"]
  node_hazard_api["Hazard endpoints<br/>[hazards.py]"]
  node_vision_api["Sidewalk analysis<br/>[vision.py]"]
end

subgraph group_routing["Routing and data"]
  node_enrichment["Graph enrichment<br/>[enrichment.py]"]
  node_graph_builder["Pedestrian graph<br/>[graph_builder.py]"]
  node_elevation["Elevation and slope<br/>[elevation.py]"]
  node_gtfs["Transit feeds<br/>[gtfs.py]"]
  node_scoring["Environmental scoring<br/>[scoring.py]"]
  node_profiles["Accessibility profiles<br/>[profiles.py]"]
  node_engine["Route engine<br/>[engine.py]"]
end

subgraph group_integrations["External services"]
  node_supabase[("Supabase")]
  node_gemini["Gemini"]
  node_mapbox["Mapbox"]
  node_speech["Web Speech API"]
end

node_traveler(("Map user"))

node_traveler -->|"opens"| node_dashboard
node_dashboard -.->|"renders"| node_map
node_dashboard -.->|"requests data"| node_api_client
node_api_client -.->|"calls API"| node_backend
node_backend -->|"boots pipeline"| node_enrichment
node_backend -->|"computes routes"| node_engine
node_backend -->|"lists profiles"| node_profiles
node_backend -->|"routes requests"| node_hazard_api
node_backend -->|"routes requests"| node_vision_api
node_backend -->|"serves map data"| node_graph_builder
node_enrichment -->|"builds graph"| node_graph_builder
node_enrichment -->|"adds slope"| node_elevation
node_enrichment -->|"loads transit"| node_gtfs
node_enrichment -->|"adds scores"| node_scoring
node_engine -->|"uses weights"| node_profiles
node_hazard_api -->|"reads and writes"| node_supabase
node_profile_api -->|"stores profiles"| node_supabase
node_auth_profiles -.->|"loads and saves"| node_profile_api
node_login -.->|"authenticates"| node_auth_profiles
node_vision_api -->|"analyzes images"| node_gemini
node_map -.->|"renders layers"| node_mapbox
node_dashboard -.->|"speaks directions"| node_speech
node_dashboard -.->|"reports hazards"| node_hazard_api
node_dashboard -.->|"uploads images"| node_vision_api

click node_dashboard "https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/access-dashboard.tsx"
click node_map "https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/access-map/mapbox-map.tsx"
click node_api_client "https://github.com/sriramadhenu/accessmapai/blob/main/frontend/lib/api.ts"
click node_auth_profiles "https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/auth-provider.tsx"
click node_profile_api "https://github.com/sriramadhenu/accessmapai/blob/main/frontend/app/api/profile/route.ts"
click node_login "https://github.com/sriramadhenu/accessmapai/blob/main/frontend/app/login/login-form.tsx"
click node_backend "https://github.com/sriramadhenu/accessmapai/blob/main/backend/main.py"
click node_hazard_api "https://github.com/sriramadhenu/accessmapai/blob/main/backend/api/hazards.py"
click node_vision_api "https://github.com/sriramadhenu/accessmapai/blob/main/backend/api/vision.py"
click node_enrichment "https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/enrichment.py"
click node_graph_builder "https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/graph_builder.py"
click node_elevation "https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/elevation.py"
click node_gtfs "https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/gtfs.py"
click node_scoring "https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/scoring.py"
click node_profiles "https://github.com/sriramadhenu/accessmapai/blob/main/backend/routing/profiles.py"
click node_engine "https://github.com/sriramadhenu/accessmapai/blob/main/backend/routing/engine.py"

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_dashboard,node_map,node_api_client,node_auth_profiles,node_profile_api,node_login,node_traveler toneBlue
class node_backend,node_hazard_api,node_vision_api toneAmber
class node_enrichment,node_graph_builder,node_elevation,node_gtfs,node_scoring,node_profiles,node_engine toneMint
class node_supabase,node_gemini,node_mapbox,node_speech toneRose
```

## Components

### Map and accounts

- [Map dashboard](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/access-dashboard.tsx): `frontend/components/access-dashboard.tsx`
- [Interactive map](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/access-map/mapbox-map.tsx): `frontend/components/access-map/mapbox-map.tsx`
- [API client](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/lib/api.ts): `frontend/lib/api.ts`
- [Auth and profiles](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/components/auth-provider.tsx): `frontend/components/auth-provider.tsx`
- [Profile API](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/app/api/profile/route.ts): `frontend/app/api/profile/route.ts`
- [Login form](https://github.com/sriramadhenu/accessmapai/blob/main/frontend/app/login/login-form.tsx): `frontend/app/login/login-form.tsx`

### Backend API

- [FastAPI service](https://github.com/sriramadhenu/accessmapai/blob/main/backend/main.py): `backend/main.py`
- [Hazard endpoints](https://github.com/sriramadhenu/accessmapai/blob/main/backend/api/hazards.py): `backend/api/hazards.py`
- [Sidewalk analysis](https://github.com/sriramadhenu/accessmapai/blob/main/backend/api/vision.py): `backend/api/vision.py`

### Routing and data

- [Graph enrichment](https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/enrichment.py): `backend/pipeline/enrichment.py`
- [Pedestrian graph](https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/graph_builder.py): `backend/pipeline/graph_builder.py`
- [Elevation and slope](https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/elevation.py): `backend/pipeline/elevation.py`
- [Transit feeds](https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/gtfs.py): `backend/pipeline/gtfs.py`
- [Environmental scoring](https://github.com/sriramadhenu/accessmapai/blob/main/backend/pipeline/scoring.py): `backend/pipeline/scoring.py`
- [Accessibility profiles](https://github.com/sriramadhenu/accessmapai/blob/main/backend/routing/profiles.py): `backend/routing/profiles.py`
- [Route engine](https://github.com/sriramadhenu/accessmapai/blob/main/backend/routing/engine.py): `backend/routing/engine.py`

### External services

- **Supabase**
- **Gemini**
- **Mapbox**
- **Web Speech API**

### Other components

- **Map user**

## Connections

- Map user → Map dashboard: opens (evidence: `README.md`)
- Map dashboard → Interactive map: renders
- Map dashboard → API client: requests data
- API client → FastAPI service: calls API
- FastAPI service → Graph enrichment: boots pipeline (evidence: `README.md`)
- FastAPI service → Route engine: computes routes (evidence: `backend/main.py`)
- FastAPI service → Accessibility profiles: lists profiles (evidence: `backend/main.py`)
- FastAPI service → Hazard endpoints: routes requests (evidence: `backend/main.py`)
- FastAPI service → Sidewalk analysis: routes requests (evidence: `backend/main.py`)
- FastAPI service → Pedestrian graph: serves map data (evidence: `backend/main.py`)
- Graph enrichment → Pedestrian graph: builds graph (evidence: `README.md`)
- Graph enrichment → Elevation and slope: adds slope (evidence: `README.md`)
- Graph enrichment → Transit feeds: loads transit (evidence: `README.md`)
- Graph enrichment → Environmental scoring: adds scores (evidence: `README.md`)
- Route engine → Accessibility profiles: uses weights (evidence: `backend/routing/engine.py`)
- Hazard endpoints → Supabase: reads and writes (evidence: `backend/api/hazards.py`)
- Profile API → Supabase: stores profiles (evidence: `frontend/app/api/profile/route.ts`)
- Auth and profiles → Profile API: loads and saves
- Login form → Auth and profiles: authenticates
- Sidewalk analysis → Gemini: analyzes images (evidence: `backend/api/vision.py`)
- Interactive map → Mapbox: renders layers
- Map dashboard → Web Speech API: speaks directions (evidence: `README.md`)
- Map dashboard → Hazard endpoints: reports hazards (evidence: `README.md`)
- Map dashboard → Sidewalk analysis: uploads images (evidence: `README.md`)
