# asukatraloc22-rgb/onspot-tripcard-analyseur architecture

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

- Interactive diagram: https://gitdiagram.com/asukatraloc22-rgb/onspot-tripcard-analyseur
- Repository: https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur

## Overview

TripCard Analyzer is an operator-facing travel dossier workbench, paired with the OnSpot Audit Assistant browser extension that captures trip data. The main workflow is capture or import JSON, normalize travel services and dossier metadata, review vouchers and tickets, build an itinerary, run local and OpenRouter-assisted audits, then review dashboard actions. The README documents the product stages and extension role; sampled source confirms the app shell, Home orchestration, normalization, audit, and AI request paths. Several dashboard subviews and extension internals are unsampled, so their details are represented only at subsystem level.

Main entry points: [`client/src/pages/Home.tsx`](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/Home.tsx) (Dashboard workflow), [`client/src/App.tsx`](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/App.tsx) (App shell), [`extension/popup.js`](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/extension/popup.js) (Audit Assistant), [`client/src/lib/openrouter.ts`](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts) (AI itinerary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and import"]
  node_assistant["Audit Assistant<br/>[popup.js]"]
  node_pdf["PDF parser<br/>[pdf.mjs]"]
end

subgraph group_dossier["Dossier preparation"]
  node_tripdoc["Trip normalizer<br/>[tripcard.ts]"]
  node_vouchers["Voucher summary<br/>[tripcard.ts]"]
  node_tickets["Ticket handling<br/>[tripcard.ts]"]
end

subgraph group_analysis["Analysis services"]
  node_localaudit["Local trip audit<br/>[tripAudit.ts]"]
  node_localitinerary["Local itinerary<br/>[openrouter.ts]"]
  node_itinerary["AI itinerary<br/>[openrouter.ts]"]
  node_audit360["360° AI audit<br/>[openrouter.ts]"]
  node_reminders["Reminder builder<br/>[reminders.ts]"]
end

subgraph group_workbench["Operator workbench"]
  node_home["Dashboard workflow<br/>[Home.tsx]"]
  node_app["App shell<br/>[App.tsx]"]
  node_notfound["Fallback page<br/>[NotFound.tsx]"]
  node_dashboard["Dossier views<br/>[Home.tsx]"]
  node_theme["Theme context<br/>[ThemeContext.tsx]"]
  node_errors["Error boundary<br/>[ErrorBoundary.tsx]"]
end

node_operator(("Travel operator"))
node_openrouter{{"OpenRouter API"}}
node_browserstore[("Browser local storage")]

node_operator -->|"captures trip"| node_assistant
node_assistant -->|"parses documents"| node_pdf
node_assistant -->|"exports JSON"| node_operator
node_operator -->|"imports JSON"| node_home
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_notfound
node_app -->|"wraps app"| node_errors
node_app -->|"provides theme"| node_theme
node_home -->|"normalizes payload"| node_tripdoc
node_home -->|"summarizes vouchers"| node_vouchers
node_home -->|"manages tickets"| node_tickets
node_home -->|"runs local checks"| node_localaudit
node_home -->|"builds local itinerary"| node_localitinerary
node_home -->|"requests itinerary"| node_itinerary
node_home -->|"requests audit"| node_audit360
node_home -->|"builds reminders"| node_reminders
node_itinerary -->|"requests JSON"| node_openrouter
node_audit360 -->|"requests JSON"| node_openrouter
node_home -->|"renders views"| node_dashboard
node_home -->|"reads API settings"| node_browserstore
node_home -->|"stores API settings"| node_browserstore

click node_assistant "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/extension/popup.js"
click node_pdf "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/extension/pdf.mjs"
click node_home "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/Home.tsx"
click node_app "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/App.tsx"
click node_notfound "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/NotFound.tsx"
click node_tripdoc "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripcard.ts"
click node_vouchers "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripcard.ts"
click node_tickets "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripcard.ts"
click node_localaudit "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripAudit.ts"
click node_localitinerary "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts"
click node_itinerary "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts"
click node_audit360 "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts"
click node_reminders "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/reminders.ts"
click node_dashboard "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/Home.tsx"
click node_theme "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/contexts/ThemeContext.tsx"
click node_errors "https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/components/ErrorBoundary.tsx"

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_assistant,node_pdf toneBlue
class node_tripdoc,node_vouchers,node_tickets,node_browserstore toneAmber
class node_localaudit,node_localitinerary,node_itinerary,node_audit360,node_reminders,node_openrouter toneMint
class node_home,node_app,node_notfound,node_dashboard,node_theme,node_errors toneRose
class node_operator toneIndigo
```

## Components

### Capture and import

- [Audit Assistant](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/extension/popup.js): `extension/popup.js`
- [PDF parser](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/extension/pdf.mjs): `extension/pdf.mjs`

### Dossier preparation

- [Trip normalizer](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripcard.ts): `client/src/lib/tripcard.ts`
- [Voucher summary](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripcard.ts): `client/src/lib/tripcard.ts`
- [Ticket handling](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripcard.ts): `client/src/lib/tripcard.ts`

### Analysis services

- [Local trip audit](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/tripAudit.ts): `client/src/lib/tripAudit.ts`
- [Local itinerary](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts): `client/src/lib/openrouter.ts`
- [AI itinerary](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts): `client/src/lib/openrouter.ts`
- [360° AI audit](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/openrouter.ts): `client/src/lib/openrouter.ts`
- [Reminder builder](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/lib/reminders.ts): `client/src/lib/reminders.ts`

### Operator workbench

- [Dashboard workflow](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/Home.tsx): `client/src/pages/Home.tsx`
- [App shell](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Fallback page](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/NotFound.tsx): `client/src/pages/NotFound.tsx`
- [Dossier views](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/pages/Home.tsx): `client/src/pages/Home.tsx`
- [Theme context](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/contexts/ThemeContext.tsx): `client/src/contexts/ThemeContext.tsx`
- [Error boundary](https://github.com/asukatraloc22-rgb/onspot-tripcard-analyseur/blob/main/client/src/components/ErrorBoundary.tsx): `client/src/components/ErrorBoundary.tsx`

### Other components

- **Travel operator**
- **OpenRouter API**
- **Browser local storage**

## Connections

- Travel operator → Audit Assistant: captures trip
- Audit Assistant → PDF parser: parses documents (evidence: `extension/popup.js`)
- Audit Assistant → Travel operator: exports JSON
- Travel operator → Dashboard workflow: imports JSON
- App shell → Dashboard workflow: routes to (evidence: `client/src/App.tsx`)
- App shell → Fallback page: routes to (evidence: `client/src/App.tsx`)
- App shell → Error boundary: wraps app (evidence: `client/src/App.tsx`)
- App shell → Theme context: provides theme (evidence: `client/src/App.tsx`)
- Dashboard workflow → Trip normalizer: normalizes payload (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → Voucher summary: summarizes vouchers
- Dashboard workflow → Ticket handling: manages tickets
- Dashboard workflow → Local trip audit: runs local checks (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → Local itinerary: builds local itinerary (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → AI itinerary: requests itinerary (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → 360° AI audit: requests audit (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → Reminder builder: builds reminders (evidence: `client/src/pages/Home.tsx`)
- AI itinerary → OpenRouter API: requests JSON (evidence: `client/src/lib/openrouter.ts`)
- 360° AI audit → OpenRouter API: requests JSON (evidence: `client/src/lib/openrouter.ts`)
- Dashboard workflow → Dossier views: renders views (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → Browser local storage: reads API settings (evidence: `client/src/pages/Home.tsx`)
- Dashboard workflow → Browser local storage: stores API settings
