# cjmaybe/yaatra-ai architecture

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

## Overview

Yaatra is a mobile travel companion: travelers explore places, plan trips with AI, manage travel details, and use location-aware tools and accessibility features. The main flow runs from the traveler through the frontend to backend APIs and, where configured, external providers; Supabase supports signed-in data sync while guest data can remain local. The README documents several frontend capabilities whose implementation is not sampled, so those nodes and links reflect documented behavior, not inspected frontend calls.

Main entry points: [`frontend/index.html`](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html) (Travel app), [`server.js`](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js) (Accessibility APIs), [`supabase/schema.sql`](https://github.com/cjmaybe/yaatra-ai/blob/main/supabase/schema.sql) (Data schema), [`frontend/sw.js`](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/sw.js) (Offline cache)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Travel experience"]
  node_frontend["Travel app<br/>[index.html]"]
  node_explore["Explore map<br/>[index.html]"]
  node_itinerary["Trip planner<br/>[index.html]"]
  node_ai["AI companion<br/>[index.html]"]
  node_triptools["Trip tools<br/>[index.html]"]
  node_serviceworker["Offline cache<br/>[sw.js]"]
end

subgraph group_accessibility["Accessible travel"]
  node_accessmap["Accessibility map<br/>[index.html]"]
  node_accessprofile["Accessibility profile<br/>[index.html]"]
  node_accessscanner["AI access scanner<br/>[index.html]"]
  node_accessreport["Access reports<br/>[index.html]"]
end

subgraph group_backend["Backend services"]
  node_imageapi["Image lookup<br/>[server.js]"]
  node_placesapi["Nearby places<br/>[server.js]"]
  node_weatherapi["Weather API<br/>[server.js]"]
  node_currencyapi["Currency API<br/>[server.js]"]
  node_translateapi["Translation API<br/>[server.js]"]
  node_chatapi["AI chat API<br/>[server.js]"]
  node_accessapi["Accessibility APIs<br/>[server.js]"]
end

subgraph group_data["Data and integrations"]
  node_database[("Supabase")]
  node_schema[("Data schema<br/>[schema.sql]")]
  node_groq["Groq LLaMA"]
  node_osm["OpenStreetMap"]
  node_osrm["OSRM routing"]
  node_openmeteo["Open-Meteo"]
  node_googlevision["Google Vision"]
  node_currencyprovider["Exchange rates"]
  node_translationprovider["Translation service"]
end

node_traveler(("Traveler"))

node_traveler -->|"uses"| node_frontend
node_frontend -->|"opens"| node_explore
node_frontend -->|"opens"| node_itinerary
node_frontend -->|"opens"| node_ai
node_frontend -->|"opens"| node_triptools
node_explore -.->|"requests nearby"| node_placesapi
node_frontend -->|"requests images"| node_imageapi
node_frontend -.->|"requests forecasts"| node_weatherapi
node_frontend -.->|"requests rates"| node_currencyapi
node_frontend -.->|"requests translations"| node_translateapi
node_ai -.->|"sends chat"| node_chatapi
node_itinerary -.->|"generates trips"| node_chatapi
node_chatapi -->|"requests completions"| node_groq
node_placesapi -->|"queries places"| node_osm
node_weatherapi -.->|"fetches forecasts"| node_openmeteo
node_currencyapi -->|"fetches rates"| node_currencyprovider
node_translateapi -->|"requests translation"| node_translationprovider
node_frontend -->|"opens"| node_accessmap
node_frontend -->|"opens"| node_accessprofile
node_frontend -->|"opens"| node_accessscanner
node_frontend -->|"opens"| node_accessreport
node_accessmap -.->|"loads records"| node_accessapi
node_accessreport -.->|"submits reports"| node_accessapi
node_accessprofile -->|"syncs profile"| node_database
node_accessapi -->|"queries tags"| node_osm
node_accessapi -->|"requests routes"| node_osrm
node_accessscanner -.->|"scans images"| node_googlevision
node_frontend -->|"syncs trips"| node_database
node_schema -->|"defines tables"| node_database
node_frontend -.->|"uses offline cache"| node_serviceworker

click node_frontend "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_explore "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_itinerary "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_ai "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_triptools "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_imageapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_placesapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_weatherapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_currencyapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_translateapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_chatapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_accessmap "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_accessprofile "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_accessscanner "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_accessreport "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html"
click node_accessapi "https://github.com/cjmaybe/yaatra-ai/blob/main/server.js"
click node_schema "https://github.com/cjmaybe/yaatra-ai/blob/main/supabase/schema.sql"
click node_serviceworker "https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/sw.js"

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_frontend,node_explore,node_itinerary,node_ai,node_triptools,node_serviceworker toneBlue
class node_accessmap,node_accessprofile,node_accessscanner,node_accessreport toneAmber
class node_imageapi,node_placesapi,node_weatherapi,node_currencyapi,node_translateapi,node_chatapi,node_accessapi toneMint
class node_database,node_schema,node_groq,node_osm,node_osrm,node_openmeteo,node_googlevision,node_currencyprovider,node_translationprovider toneRose
class node_traveler toneIndigo
```

## Components

### Travel experience

- [Travel app](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [Explore map](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [Trip planner](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [AI companion](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [Trip tools](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [Offline cache](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/sw.js): `frontend/sw.js`

### Accessible travel

- [Accessibility map](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [Accessibility profile](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [AI access scanner](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`
- [Access reports](https://github.com/cjmaybe/yaatra-ai/blob/main/frontend/index.html): `frontend/index.html`

### Backend services

- [Image lookup](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`
- [Nearby places](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`
- [Weather API](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`
- [Currency API](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`
- [Translation API](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`
- [AI chat API](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`
- [Accessibility APIs](https://github.com/cjmaybe/yaatra-ai/blob/main/server.js): `server.js`

### Data and integrations

- **Supabase**
- [Data schema](https://github.com/cjmaybe/yaatra-ai/blob/main/supabase/schema.sql): `supabase/schema.sql`
- **Groq LLaMA**
- **OpenStreetMap**
- **OSRM routing**
- **Open-Meteo**
- **Google Vision**
- **Exchange rates**
- **Translation service**

### Other components

- **Traveler**

## Connections

- Traveler → Travel app: uses (evidence: `README.md`)
- Travel app → Explore map: opens (evidence: `README.md`)
- Travel app → Trip planner: opens (evidence: `README.md`)
- Travel app → AI companion: opens (evidence: `README.md`)
- Travel app → Trip tools: opens (evidence: `README.md`)
- Explore map → Nearby places: requests nearby
- Travel app → Image lookup: requests images (evidence: `server.js`)
- Travel app → Weather API: requests forecasts
- Travel app → Currency API: requests rates
- Travel app → Translation API: requests translations
- AI companion → AI chat API: sends chat
- Trip planner → AI chat API: generates trips
- AI chat API → Groq LLaMA: requests completions (evidence: `server.js`)
- Nearby places → OpenStreetMap: queries places (evidence: `server.js`)
- Weather API → Open-Meteo: fetches forecasts
- Currency API → Exchange rates: fetches rates (evidence: `server.js`)
- Translation API → Translation service: requests translation (evidence: `server.js`)
- Travel app → Accessibility map: opens (evidence: `README.md`)
- Travel app → Accessibility profile: opens (evidence: `README.md`)
- Travel app → AI access scanner: opens (evidence: `README.md`)
- Travel app → Access reports: opens (evidence: `README.md`)
- Accessibility map → Accessibility APIs: loads records
- Access reports → Accessibility APIs: submits reports
- Accessibility profile → Supabase: syncs profile (evidence: `README.md`)
- Accessibility APIs → OpenStreetMap: queries tags (evidence: `server.js`)
- Accessibility APIs → OSRM routing: requests routes (evidence: `server.js`)
- AI access scanner → Google Vision: scans images
- Travel app → Supabase: syncs trips (evidence: `README.md`)
- Data schema → Supabase: defines tables (evidence: `README.md`)
- Travel app → Offline cache: uses offline cache
