# bhavinv2/travel-companion architecture

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

- Interactive diagram: https://gitdiagram.com/bhavinv2/travel-companion
- Repository: https://github.com/bhavinv2/travel-companion

## Overview

Connecting Desis is a Flask travel-companion service: travellers post routes and dates, discover compatible trips, request connections and communicate under consent and claim rules. Its wider product includes a staff console for imported and scraped posts, configurable administration, notifications, Sahayak services and a separate insurance quote experience. The README documents these capabilities, but most route and service implementations were not sampled; links below follow documented workflows, with uncertain call wiring omitted.

Main entry points: [`app/__init__.py`](https://github.com/bhavinv2/travel-companion/blob/main/app/__init__.py) (Flask app), [`app/models.py`](https://github.com/bhavinv2/travel-companion/blob/main/app/models.py) (Application database), [`app/routes/trips.py`](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/trips.py) (Trip routes), [`app/routes/chat.py`](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/chat.py) (Chat routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_traveller["Traveller experience"]
  node_triproutes["Trip routes<br/>[trips.py]"]
  node_matchroutes["Trip discovery<br/>[matches.py]"]
  node_matching["Route matching<br/>[matching.py]"]
  node_chatroutes["Chat routes<br/>[chat.py]"]
  node_claimroutes["Claim flow<br/>[claim.py]"]
end

subgraph group_staff["Staff and imports"]
  node_csconsole["CS console<br/>[cs.py]"]
  node_importer["Spreadsheet import<br/>[importer.py]"]
  node_scraperoutes["Scraper console<br/>[scraper.py]"]
  node_scraperworker["Scrape worker<br/>[scraper_worker.py]"]
  node_scraper["Scrape service<br/>[scraper.py]"]
end

subgraph group_insurance["Insurance quotes"]
  node_insuranceui["Insurance experience<br/>[App.tsx]"]
  node_quote["Quote handling<br/>[main.py]"]
end

subgraph group_operations["Administration"]
  node_admin["Admin console<br/>[admin.py]"]
  node_notifications["Notifications<br/>[notify.py]"]
end

subgraph group_platform["Shared platform"]
  node_webapp["Flask app<br/>[__init__.py]"]
  node_models[("Domain records<br/>[models.py]")]
  node_sahayak["Sahayak service<br/>[sahayak.py]"]
  node_storage["File storage<br/>[storage.py]"]
  node_files["Private files<br/>[files.py]"]
  node_database[("Application database<br/>[models.py]")]
end

node_traveller(("Traveller"))
node_csstaff(("CS staff"))

node_traveller -->|"uses"| node_webapp
node_webapp -->|"dispatches"| node_triproutes
node_webapp -->|"dispatches"| node_matchroutes
node_webapp -->|"dispatches"| node_chatroutes
node_webapp -->|"dispatches"| node_claimroutes
node_matchroutes -->|"finds matches"| node_matching
node_triproutes -->|"stores trips"| node_database
node_matching -->|"reads trips"| node_database
node_chatroutes -->|"stores messages"| node_database
node_claimroutes -->|"stores claims"| node_database
node_csstaff -->|"uses"| node_webapp
node_webapp -->|"dispatches"| node_csconsole
node_csconsole -->|"imports posts"| node_importer
node_csconsole -->|"opens scraper"| node_scraperoutes
node_scraperoutes -->|"queues jobs"| node_scraperworker
node_scraperworker -->|"runs scraping"| node_scraper
node_scraperworker -->|"records progress"| node_database
node_scraperoutes -->|"reads scraped rows"| node_database
node_insuranceui -->|"requests quote"| node_quote
node_quote -->|"records quote"| node_database
node_webapp -->|"serves service"| node_sahayak
node_admin -->|"manages settings"| node_database
node_admin -->|"configures channels"| node_notifications
node_triproutes -->|"stores images"| node_storage
node_chatroutes -->|"stores attachments"| node_storage
node_files -->|"serves private files"| node_storage
node_files -->|"checks ownership"| node_database

click node_webapp "https://github.com/bhavinv2/travel-companion/blob/main/app/__init__.py"
click node_triproutes "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/trips.py"
click node_matchroutes "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/matches.py"
click node_matching "https://github.com/bhavinv2/travel-companion/blob/main/app/services/matching.py"
click node_chatroutes "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/chat.py"
click node_claimroutes "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/claim.py"
click node_models "https://github.com/bhavinv2/travel-companion/blob/main/app/models.py"
click node_csconsole "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/cs.py"
click node_importer "https://github.com/bhavinv2/travel-companion/blob/main/app/services/importer.py"
click node_scraperoutes "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/scraper.py"
click node_scraperworker "https://github.com/bhavinv2/travel-companion/blob/main/app/services/scraper_worker.py"
click node_scraper "https://github.com/bhavinv2/travel-companion/blob/main/app/services/scraper.py"
click node_insuranceui "https://github.com/bhavinv2/travel-companion/blob/main/frontend/insurance/src/App.tsx"
click node_quote "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/main.py"
click node_sahayak "https://github.com/bhavinv2/travel-companion/blob/main/app/services/sahayak.py"
click node_admin "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/admin.py"
click node_notifications "https://github.com/bhavinv2/travel-companion/blob/main/app/services/notify.py"
click node_storage "https://github.com/bhavinv2/travel-companion/blob/main/app/services/storage.py"
click node_files "https://github.com/bhavinv2/travel-companion/blob/main/app/routes/files.py"
click node_database "https://github.com/bhavinv2/travel-companion/blob/main/app/models.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_triproutes,node_matchroutes,node_matching,node_chatroutes,node_claimroutes toneBlue
class node_csconsole,node_importer,node_scraperoutes,node_scraperworker,node_scraper toneAmber
class node_insuranceui,node_quote toneMint
class node_admin,node_notifications toneRose
class node_webapp,node_models,node_sahayak,node_storage,node_files,node_database,node_traveller,node_csstaff toneIndigo
```

## Components

### Traveller experience

- [Trip routes](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/trips.py): `app/routes/trips.py`
- [Trip discovery](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/matches.py): `app/routes/matches.py`
- [Route matching](https://github.com/bhavinv2/travel-companion/blob/main/app/services/matching.py): `app/services/matching.py`
- [Chat routes](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/chat.py): `app/routes/chat.py`
- [Claim flow](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/claim.py): `app/routes/claim.py`

### Staff and imports

- [CS console](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/cs.py): `app/routes/cs.py`
- [Spreadsheet import](https://github.com/bhavinv2/travel-companion/blob/main/app/services/importer.py): `app/services/importer.py`
- [Scraper console](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/scraper.py): `app/routes/scraper.py`
- [Scrape worker](https://github.com/bhavinv2/travel-companion/blob/main/app/services/scraper_worker.py): `app/services/scraper_worker.py`
- [Scrape service](https://github.com/bhavinv2/travel-companion/blob/main/app/services/scraper.py): `app/services/scraper.py`

### Insurance quotes

- [Insurance experience](https://github.com/bhavinv2/travel-companion/blob/main/frontend/insurance/src/App.tsx): `frontend/insurance/src/App.tsx`
- [Quote handling](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/main.py): `app/routes/main.py`

### Administration

- [Admin console](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/admin.py): `app/routes/admin.py`
- [Notifications](https://github.com/bhavinv2/travel-companion/blob/main/app/services/notify.py): `app/services/notify.py`

### Shared platform

- [Flask app](https://github.com/bhavinv2/travel-companion/blob/main/app/__init__.py): `app/__init__.py`
- [Domain records](https://github.com/bhavinv2/travel-companion/blob/main/app/models.py): `app/models.py`
- [Sahayak service](https://github.com/bhavinv2/travel-companion/blob/main/app/services/sahayak.py): `app/services/sahayak.py`
- [File storage](https://github.com/bhavinv2/travel-companion/blob/main/app/services/storage.py): `app/services/storage.py`
- [Private files](https://github.com/bhavinv2/travel-companion/blob/main/app/routes/files.py): `app/routes/files.py`
- [Application database](https://github.com/bhavinv2/travel-companion/blob/main/app/models.py): `app/models.py`

### Other components

- **Traveller**
- **CS staff**

## Connections

- Traveller → Flask app: uses
- Flask app → Trip routes: dispatches
- Flask app → Trip discovery: dispatches
- Flask app → Chat routes: dispatches
- Flask app → Claim flow: dispatches
- Trip discovery → Route matching: finds matches
- Trip routes → Application database: stores trips
- Route matching → Application database: reads trips
- Chat routes → Application database: stores messages
- Claim flow → Application database: stores claims
- CS staff → Flask app: uses
- Flask app → CS console: dispatches
- CS console → Spreadsheet import: imports posts
- CS console → Scraper console: opens scraper
- Scraper console → Scrape worker: queues jobs
- Scrape worker → Scrape service: runs scraping
- Scrape worker → Application database: records progress
- Scraper console → Application database: reads scraped rows
- Insurance experience → Quote handling: requests quote
- Quote handling → Application database: records quote
- Flask app → Sahayak service: serves service
- Admin console → Application database: manages settings
- Admin console → Notifications: configures channels
- Trip routes → File storage: stores images
- Chat routes → File storage: stores attachments
- Private files → File storage: serves private files
- Private files → Application database: checks ownership
