# rusheekg/examtrip architecture

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

- Interactive diagram: https://gitdiagram.com/rusheekg/examtrip
- Repository: https://github.com/rusheekg/examtrip

## Overview

ExamTrip turns exam-centre and travel constraints into a live, budget-aware exam-day plan. The main browser flow submits a search to the FastAPI endpoint, which orchestrates centre lookup, hotel and route planning, food search, best-pick selection, and an essentials lookup before returning results for the tabbed trip pass. The repository also includes a Streamlit interface to the planner. README capabilities cover the UI features not fully visible in the sampled excerpts; the graph does not infer unsampled internal calls.

Main entry points: [`serp_client.py`](https://github.com/rusheekg/examtrip/blob/main/serp_client.py) (Search and cache), [`examtrip.py`](https://github.com/rusheekg/examtrip/blob/main/examtrip.py) (Trip orchestration), [`api.py`](https://github.com/rusheekg/examtrip/blob/main/api.py) (Plan API), [`web/app.js`](https://github.com/rusheekg/examtrip/blob/main/web/app.js) (Trip planner UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interfaces["User interfaces"]
  node_browser["Trip planner UI<br/>[app.js]"]
  node_trip_results["Trip results<br/>[app.js]"]
  node_streamlit["Streamlit UI<br/>[app.py]"]
end

subgraph group_planning["Trip planning"]
  node_plan_api["Plan API<br/>[api.py]"]
  node_trip_planner["Trip orchestration<br/>[examtrip.py]"]
  node_centre_lookup["Centre lookup<br/>[serp_client.py]"]
  node_stay_search["Budget stays<br/>[examtrip.py]"]
  node_route_planning["Routes and timing<br/>[examtrip.py]"]
  node_stay_pick["Best stay<br/>[examtrip.py]"]
end

subgraph group_discovery["Nearby discovery"]
  node_food_search["Food options<br/>[examtrip.py]"]
  node_essentials_search["Exam essentials<br/>[essentials.py]"]
end

subgraph group_integrations["Data integration"]
  node_serp_client["Search and cache<br/>[serp_client.py]"]
  node_cache[("Result cache<br/>[serp_client.py]")]
end

node_traveller(("Traveller"))
node_serpapi{{"SerpApi"}}

node_traveller -->|"enters search"| node_browser
node_browser -->|"submits plan"| node_plan_api
node_plan_api -->|"plans trip"| node_trip_planner
node_streamlit -->|"plans trip"| node_trip_planner
node_trip_planner -->|"locates centre"| node_centre_lookup
node_trip_planner -->|"searches stays"| node_stay_search
node_trip_planner -->|"gets routes"| node_route_planning
node_trip_planner -->|"finds food"| node_food_search
node_plan_api -->|"selects best stay"| node_stay_pick
node_plan_api -->|"finds essentials"| node_essentials_search
node_centre_lookup -->|"searches places"| node_serp_client
node_stay_search -->|"searches hotels"| node_serp_client
node_route_planning -->|"fetches directions"| node_serp_client
node_food_search -->|"searches places"| node_serp_client
node_essentials_search -->|"searches places"| node_serp_client
node_serp_client -->|"requests live data"| node_serpapi
node_serp_client -->|"reads and writes"| node_cache
node_plan_api -->|"returns plan"| node_trip_results
node_trip_results -->|"shows trip pass"| node_traveller

click node_browser "https://github.com/rusheekg/examtrip/blob/main/web/app.js"
click node_trip_results "https://github.com/rusheekg/examtrip/blob/main/web/app.js"
click node_streamlit "https://github.com/rusheekg/examtrip/blob/main/app.py"
click node_plan_api "https://github.com/rusheekg/examtrip/blob/main/api.py"
click node_trip_planner "https://github.com/rusheekg/examtrip/blob/main/examtrip.py"
click node_centre_lookup "https://github.com/rusheekg/examtrip/blob/main/serp_client.py"
click node_stay_search "https://github.com/rusheekg/examtrip/blob/main/examtrip.py"
click node_route_planning "https://github.com/rusheekg/examtrip/blob/main/examtrip.py"
click node_food_search "https://github.com/rusheekg/examtrip/blob/main/examtrip.py"
click node_stay_pick "https://github.com/rusheekg/examtrip/blob/main/examtrip.py"
click node_essentials_search "https://github.com/rusheekg/examtrip/blob/main/essentials.py"
click node_serp_client "https://github.com/rusheekg/examtrip/blob/main/serp_client.py"
click node_cache "https://github.com/rusheekg/examtrip/blob/main/serp_client.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_browser,node_trip_results,node_streamlit toneBlue
class node_plan_api,node_trip_planner,node_centre_lookup,node_stay_search,node_route_planning,node_stay_pick toneAmber
class node_food_search,node_essentials_search,node_serpapi toneMint
class node_serp_client,node_cache toneRose
class node_traveller toneIndigo
```

## Components

### User interfaces

- [Trip planner UI](https://github.com/rusheekg/examtrip/blob/main/web/app.js): `web/app.js`
- [Trip results](https://github.com/rusheekg/examtrip/blob/main/web/app.js): `web/app.js`
- [Streamlit UI](https://github.com/rusheekg/examtrip/blob/main/app.py): `app.py`

### Trip planning

- [Plan API](https://github.com/rusheekg/examtrip/blob/main/api.py): `api.py`
- [Trip orchestration](https://github.com/rusheekg/examtrip/blob/main/examtrip.py): `examtrip.py`
- [Centre lookup](https://github.com/rusheekg/examtrip/blob/main/serp_client.py): `serp_client.py`
- [Budget stays](https://github.com/rusheekg/examtrip/blob/main/examtrip.py): `examtrip.py`
- [Routes and timing](https://github.com/rusheekg/examtrip/blob/main/examtrip.py): `examtrip.py`
- [Best stay](https://github.com/rusheekg/examtrip/blob/main/examtrip.py): `examtrip.py`

### Nearby discovery

- [Food options](https://github.com/rusheekg/examtrip/blob/main/examtrip.py): `examtrip.py`
- [Exam essentials](https://github.com/rusheekg/examtrip/blob/main/essentials.py): `essentials.py`

### Data integration

- [Search and cache](https://github.com/rusheekg/examtrip/blob/main/serp_client.py): `serp_client.py`
- [Result cache](https://github.com/rusheekg/examtrip/blob/main/serp_client.py): `serp_client.py`

### Other components

- **Traveller**
- **SerpApi**

## Connections

- Traveller → Trip planner UI: enters search (evidence: `README.md`)
- Trip planner UI → Plan API: submits plan (evidence: `web/app.js`)
- Plan API → Trip orchestration: plans trip (evidence: `api.py`)
- Streamlit UI → Trip orchestration: plans trip (evidence: `app.py`)
- Trip orchestration → Centre lookup: locates centre (evidence: `README.md`)
- Trip orchestration → Budget stays: searches stays (evidence: `README.md`)
- Trip orchestration → Routes and timing: gets routes (evidence: `README.md`)
- Trip orchestration → Food options: finds food (evidence: `examtrip.py`)
- Plan API → Best stay: selects best stay (evidence: `api.py`)
- Plan API → Exam essentials: finds essentials (evidence: `api.py`)
- Centre lookup → Search and cache: searches places (evidence: `serp_client.py`)
- Budget stays → Search and cache: searches hotels (evidence: `README.md`)
- Routes and timing → Search and cache: fetches directions (evidence: `examtrip.py`)
- Food options → Search and cache: searches places (evidence: `examtrip.py`)
- Exam essentials → Search and cache: searches places (evidence: `essentials.py`)
- Search and cache → SerpApi: requests live data (evidence: `serp_client.py`)
- Search and cache → Result cache: reads and writes (evidence: `serp_client.py`)
- Plan API → Trip results: returns plan (evidence: `api.py`)
- Trip results → Traveller: shows trip pass (evidence: `README.md`)
