# soemyinttun/travel-ops architecture

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

- Interactive diagram: https://gitdiagram.com/soemyinttun/travel-ops
- Repository: https://github.com/soemyinttun/travel-ops

## Overview

Travel Ops is an offline-capable travel-operations app for managing customers, bookings, trips, visa/passport cases, tickets, and business performance. Staff sign in (when cloud mode is configured), work through the app’s routed screens, and read or change local records; changes are queued and synchronized with the cloud. The graph preserves the documented admin, backup/import, calendar, analytics, and offline-sync capabilities. Some screen-to-store and sync-engine links are based on the SOURCE INDEX or README because those implementations were not excerpted.

Main entry points: [`app/src/App.tsx`](https://github.com/soemyinttun/travel-ops/blob/main/app/src/App.tsx) (App routing), [`app/src/state.tsx`](https://github.com/soemyinttun/travel-ops/blob/main/app/src/state.tsx) (App data and filters), [`app/src/store.ts`](https://github.com/soemyinttun/travel-ops/blob/main/app/src/store.ts) (Record operations), [`app/src/analytics.ts`](https://github.com/soemyinttun/travel-ops/blob/main/app/src/analytics.ts) (Sales analytics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_app["App routing<br/>[App.tsx]"]
  node_auth["Sign-in and roles<br/>[AuthProvider.tsx]"]
  node_authgate["Access gate<br/>[AuthGate.tsx]"]
  node_ui["Shared UI<br/>[ui.tsx]"]
end

subgraph group_operations["Travel operations"]
  node_bookings["Bookings<br/>[Bookings.tsx]"]
  node_customers["Customers<br/>[Customers.tsx]"]
  node_pipeline["Visa and passport cases<br/>[Pipeline.tsx]"]
  node_tickets["Air tickets<br/>[Tickets.tsx]"]
  node_trips["Trips and calendar<br/>[Trips.tsx]"]
  node_customerselect["Customer selector<br/>[CustomerSelect.tsx]"]
  node_packages["Packages and pricing<br/>[Packages.tsx]"]
  node_ics["Calendar export<br/>[ics.ts]"]
end

subgraph group_insights["Business insights"]
  node_overview["Overview<br/>[Overview.tsx]"]
  node_revenue["Revenue analysis<br/>[Revenue.tsx]"]
  node_heatmaps["Travel heatmaps<br/>[Heatmaps.tsx]"]
  node_analytics["Sales analytics<br/>[analytics.ts]"]
end

subgraph group_data["Local data and sync"]
  node_state["App data and filters<br/>[state.tsx]"]
  node_store["Record operations<br/>[store.ts]"]
  node_localdb[("Device database<br/>[db.ts]")]
  node_seed["Local data preparation<br/>[seed.ts]"]
  node_synccontroller["Sync scheduling<br/>[controller.ts]"]
  node_syncengine["Sync engine<br/>[engine.ts]"]
  node_remote["Remote store interface<br/>[remote.ts]"]
  node_suparemote["Supabase adapter<br/>[supabaseRemote.ts]"]
end

subgraph group_admin["Administration"]
  node_settings["Settings and backup<br/>[Settings.tsx]"]
  node_adminpage["Admin tools<br/>[Admin.tsx]"]
  node_validator["Import validation<br/>[validate.ts]"]
  node_adminauth["Staff administration<br/>[admin.ts]"]
  node_migration[("Cloud schema and rules<br/>[0001_init.sql]")]
end

node_staff(("Staff user"))
node_supabase[("Supabase cloud")]

node_staff -->|"signs in"| node_authgate
node_authgate -->|"checks access"| node_auth
node_authgate -->|"admits user"| node_app
node_app -->|"routes to"| node_bookings
node_app -->|"routes to"| node_customers
node_app -->|"routes to"| node_pipeline
node_app -->|"routes to"| node_tickets
node_app -->|"routes to"| node_trips
node_app -->|"routes to"| node_overview
node_app -->|"routes to"| node_revenue
node_app -->|"routes to"| node_heatmaps
node_app -->|"routes to"| node_packages
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_adminpage
node_bookings -->|"changes records"| node_store
node_customers -->|"changes records"| node_store
node_pipeline -->|"changes cases"| node_store
node_tickets -->|"changes records"| node_store
node_packages -->|"changes records"| node_store
node_trips -->|"exports events"| node_ics
node_bookings -->|"uses selector"| node_customerselect
node_pipeline -->|"uses selector"| node_customerselect
node_tickets -->|"uses selector"| node_customerselect
node_customerselect -->|"reads customers"| node_state
node_overview -->|"reads app data"| node_state
node_revenue -->|"reads app data"| node_state
node_heatmaps -->|"reads app data"| node_state
node_overview -->|"computes metrics"| node_analytics
node_revenue -->|"computes revenue"| node_analytics
node_heatmaps -->|"computes map data"| node_analytics
node_packages -->|"uses sales metrics"| node_analytics
node_tickets -->|"uses sales metrics"| node_analytics
node_state -->|"reads records"| node_localdb
node_state -->|"builds sales"| node_analytics
node_state -->|"prepares local data"| node_seed
node_store -->|"writes records"| node_localdb
node_seed -->|"loads local data"| node_localdb
node_auth -->|"starts sync"| node_synccontroller
node_synccontroller -->|"tracks local writes"| node_store
node_synccontroller -->|"runs sync"| node_syncengine
node_syncengine -->|"reads and updates"| node_localdb
node_syncengine -->|"syncs through"| node_remote
node_suparemote -->|"implements"| node_remote
node_auth -->|"configures adapter"| node_suparemote
node_suparemote -.->|"transfers records"| node_supabase
node_settings -->|"backs up data"| node_localdb
node_settings -->|"requests sync"| node_synccontroller
node_settings -->|"uses calendar export"| node_ics

click node_app "https://github.com/soemyinttun/travel-ops/blob/main/app/src/App.tsx"
click node_auth "https://github.com/soemyinttun/travel-ops/blob/main/app/src/auth/AuthProvider.tsx"
click node_authgate "https://github.com/soemyinttun/travel-ops/blob/main/app/src/auth/AuthGate.tsx"
click node_ui "https://github.com/soemyinttun/travel-ops/blob/main/app/src/components/ui.tsx"
click node_bookings "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Bookings.tsx"
click node_customers "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Customers.tsx"
click node_pipeline "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Pipeline.tsx"
click node_tickets "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Tickets.tsx"
click node_trips "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Trips.tsx"
click node_customerselect "https://github.com/soemyinttun/travel-ops/blob/main/app/src/components/CustomerSelect.tsx"
click node_overview "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Overview.tsx"
click node_revenue "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Revenue.tsx"
click node_heatmaps "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Heatmaps.tsx"
click node_packages "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Packages.tsx"
click node_analytics "https://github.com/soemyinttun/travel-ops/blob/main/app/src/analytics.ts"
click node_state "https://github.com/soemyinttun/travel-ops/blob/main/app/src/state.tsx"
click node_store "https://github.com/soemyinttun/travel-ops/blob/main/app/src/store.ts"
click node_localdb "https://github.com/soemyinttun/travel-ops/blob/main/app/src/db.ts"
click node_seed "https://github.com/soemyinttun/travel-ops/blob/main/app/src/seed.ts"
click node_synccontroller "https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/controller.ts"
click node_syncengine "https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/engine.ts"
click node_remote "https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/remote.ts"
click node_suparemote "https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/supabaseRemote.ts"
click node_ics "https://github.com/soemyinttun/travel-ops/blob/main/app/src/ics.ts"
click node_settings "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Settings.tsx"
click node_adminpage "https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Admin.tsx"
click node_validator "https://github.com/soemyinttun/travel-ops/blob/main/app/src/importer/validate.ts"
click node_adminauth "https://github.com/soemyinttun/travel-ops/blob/main/app/src/auth/admin.ts"
click node_migration "https://github.com/soemyinttun/travel-ops/blob/main/supabase/migrations/0001_init.sql"

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_app,node_auth,node_authgate,node_ui,node_staff toneBlue
class node_bookings,node_customers,node_pipeline,node_tickets,node_trips,node_customerselect,node_packages,node_ics,node_supabase toneAmber
class node_overview,node_revenue,node_heatmaps,node_analytics toneMint
class node_state,node_store,node_localdb,node_seed,node_synccontroller,node_syncengine,node_remote,node_suparemote toneRose
class node_settings,node_adminpage,node_validator,node_adminauth,node_migration toneIndigo
```

## Components

### App and access

- [App routing](https://github.com/soemyinttun/travel-ops/blob/main/app/src/App.tsx): `app/src/App.tsx`
- [Sign-in and roles](https://github.com/soemyinttun/travel-ops/blob/main/app/src/auth/AuthProvider.tsx): `app/src/auth/AuthProvider.tsx`
- [Access gate](https://github.com/soemyinttun/travel-ops/blob/main/app/src/auth/AuthGate.tsx): `app/src/auth/AuthGate.tsx`
- [Shared UI](https://github.com/soemyinttun/travel-ops/blob/main/app/src/components/ui.tsx): `app/src/components/ui.tsx`

### Travel operations

- [Bookings](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Bookings.tsx): `app/src/pages/Bookings.tsx`
- [Customers](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Customers.tsx): `app/src/pages/Customers.tsx`
- [Visa and passport cases](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Pipeline.tsx): `app/src/pages/Pipeline.tsx`
- [Air tickets](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Tickets.tsx): `app/src/pages/Tickets.tsx`
- [Trips and calendar](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Trips.tsx): `app/src/pages/Trips.tsx`
- [Customer selector](https://github.com/soemyinttun/travel-ops/blob/main/app/src/components/CustomerSelect.tsx): `app/src/components/CustomerSelect.tsx`
- [Packages and pricing](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Packages.tsx): `app/src/pages/Packages.tsx`
- [Calendar export](https://github.com/soemyinttun/travel-ops/blob/main/app/src/ics.ts): `app/src/ics.ts`

### Business insights

- [Overview](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Overview.tsx): `app/src/pages/Overview.tsx`
- [Revenue analysis](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Revenue.tsx): `app/src/pages/Revenue.tsx`
- [Travel heatmaps](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Heatmaps.tsx): `app/src/pages/Heatmaps.tsx`
- [Sales analytics](https://github.com/soemyinttun/travel-ops/blob/main/app/src/analytics.ts): `app/src/analytics.ts`

### Local data and sync

- [App data and filters](https://github.com/soemyinttun/travel-ops/blob/main/app/src/state.tsx): `app/src/state.tsx`
- [Record operations](https://github.com/soemyinttun/travel-ops/blob/main/app/src/store.ts): `app/src/store.ts`
- [Device database](https://github.com/soemyinttun/travel-ops/blob/main/app/src/db.ts): `app/src/db.ts`
- [Local data preparation](https://github.com/soemyinttun/travel-ops/blob/main/app/src/seed.ts): `app/src/seed.ts`
- [Sync scheduling](https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/controller.ts): `app/src/sync/controller.ts`
- [Sync engine](https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/engine.ts): `app/src/sync/engine.ts`
- [Remote store interface](https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/remote.ts): `app/src/sync/remote.ts`
- [Supabase adapter](https://github.com/soemyinttun/travel-ops/blob/main/app/src/sync/supabaseRemote.ts): `app/src/sync/supabaseRemote.ts`

### Administration

- [Settings and backup](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Settings.tsx): `app/src/pages/Settings.tsx`
- [Admin tools](https://github.com/soemyinttun/travel-ops/blob/main/app/src/pages/Admin.tsx): `app/src/pages/Admin.tsx`
- [Import validation](https://github.com/soemyinttun/travel-ops/blob/main/app/src/importer/validate.ts): `app/src/importer/validate.ts`
- [Staff administration](https://github.com/soemyinttun/travel-ops/blob/main/app/src/auth/admin.ts): `app/src/auth/admin.ts`
- [Cloud schema and rules](https://github.com/soemyinttun/travel-ops/blob/main/supabase/migrations/0001_init.sql): `supabase/migrations/0001_init.sql`

### Other components

- **Staff user**
- **Supabase cloud**

## Connections

- Staff user → Access gate: signs in (evidence: `README.md`)
- Access gate → Sign-in and roles: checks access (evidence: `app/src/auth/AuthGate.tsx`)
- Access gate → App routing: admits user (evidence: `app/src/main.tsx`)
- App routing → Bookings: routes to (evidence: `app/src/App.tsx`)
- App routing → Customers: routes to (evidence: `app/src/App.tsx`)
- App routing → Visa and passport cases: routes to (evidence: `app/src/App.tsx`)
- App routing → Air tickets: routes to (evidence: `app/src/App.tsx`)
- App routing → Trips and calendar: routes to (evidence: `app/src/App.tsx`)
- App routing → Overview: routes to (evidence: `app/src/App.tsx`)
- App routing → Revenue analysis: routes to (evidence: `app/src/App.tsx`)
- App routing → Travel heatmaps: routes to (evidence: `app/src/App.tsx`)
- App routing → Packages and pricing: routes to (evidence: `app/src/App.tsx`)
- App routing → Settings and backup: routes to (evidence: `app/src/App.tsx`)
- App routing → Admin tools: routes to (evidence: `app/src/App.tsx`)
- Bookings → Record operations: changes records (evidence: `app/src/pages/Bookings.tsx`)
- Customers → Record operations: changes records (evidence: `app/src/pages/Customers.tsx`)
- Visa and passport cases → Record operations: changes cases (evidence: `app/src/pages/Pipeline.tsx`)
- Air tickets → Record operations: changes records (evidence: `app/src/pages/Tickets.tsx`)
- Packages and pricing → Record operations: changes records (evidence: `app/src/pages/Packages.tsx`)
- Trips and calendar → Calendar export: exports events (evidence: `app/src/pages/Trips.tsx`)
- Bookings → Customer selector: uses selector (evidence: `app/src/pages/Bookings.tsx`)
- Visa and passport cases → Customer selector: uses selector (evidence: `app/src/pages/Pipeline.tsx`)
- Air tickets → Customer selector: uses selector (evidence: `app/src/pages/Tickets.tsx`)
- Customer selector → App data and filters: reads customers (evidence: `app/src/components/CustomerSelect.tsx`)
- Overview → App data and filters: reads app data (evidence: `app/src/pages/Overview.tsx`)
- Revenue analysis → App data and filters: reads app data (evidence: `app/src/pages/Revenue.tsx`)
- Travel heatmaps → App data and filters: reads app data (evidence: `app/src/pages/Heatmaps.tsx`)
- Overview → Sales analytics: computes metrics (evidence: `app/src/pages/Overview.tsx`)
- Revenue analysis → Sales analytics: computes revenue (evidence: `app/src/pages/Revenue.tsx`)
- Travel heatmaps → Sales analytics: computes map data (evidence: `app/src/pages/Heatmaps.tsx`)
- Packages and pricing → Sales analytics: uses sales metrics (evidence: `app/src/pages/Packages.tsx`)
- Air tickets → Sales analytics: uses sales metrics (evidence: `app/src/pages/Tickets.tsx`)
- App data and filters → Device database: reads records (evidence: `app/src/state.tsx`)
- App data and filters → Sales analytics: builds sales (evidence: `app/src/state.tsx`)
- App data and filters → Local data preparation: prepares local data (evidence: `app/src/state.tsx`)
- Record operations → Device database: writes records (evidence: `app/src/store.ts`)
- Local data preparation → Device database: loads local data (evidence: `app/src/seed.ts`)
- Sign-in and roles → Sync scheduling: starts sync (evidence: `app/src/auth/AuthProvider.tsx`)
- Sync scheduling → Record operations: tracks local writes (evidence: `app/src/sync/controller.ts`)
- Sync scheduling → Sync engine: runs sync (evidence: `app/src/sync/controller.ts`)
- Sync engine → Device database: reads and updates (evidence: `app/src/sync/engine.ts`)
- Sync engine → Remote store interface: syncs through (evidence: `app/src/sync/engine.ts`)
- Supabase adapter → Remote store interface: implements (evidence: `app/src/sync/supabaseRemote.ts`)
- Sign-in and roles → Supabase adapter: configures adapter (evidence: `app/src/auth/AuthProvider.tsx`)
- Supabase adapter → Supabase cloud: transfers records
- Settings and backup → Device database: backs up data (evidence: `app/src/pages/Settings.tsx`)
- Settings and backup → Sync scheduling: requests sync (evidence: `app/src/pages/Settings.tsx`)
- Settings and backup → Calendar export: uses calendar export (evidence: `app/src/pages/Settings.tsx`)
