# thureinlynn/ai-studio architecture

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

- Interactive diagram: https://gitdiagram.com/thureinlynn/ai-studio
- Repository: https://github.com/thureinlynn/ai-studio

## Overview

LuuKyone is a traveler-carrying and cargo-partner marketplace: users search routes and available carrying capacity, inspect trip or partner details, and can authenticate and manage trip listings. The client combines trip and account state with Firebase-backed sync and server APIs; the server applies security checks and persists marketplace data. Cargo-partner discovery and administration, localization, and SEO are additional product capabilities. Several client views and API handlers were not sampled, so their links are omitted unless documented or indexed.

Main entry points: [`src/context/TripContext.tsx`](https://github.com/thureinlynn/ai-studio/blob/main/src/context/TripContext.tsx) (Trip state), [`src/App.tsx`](https://github.com/thureinlynn/ai-studio/blob/main/src/App.tsx) (Application shell), [`server.ts`](https://github.com/thureinlynn/ai-studio/blob/main/server.ts) (HTTP server), [`api/users.ts`](https://github.com/thureinlynn/ai-studio/blob/main/api/users.ts) (User API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Marketplace client"]
  node_app["Application shell<br/>[App.tsx]"]
  node_search["Route search<br/>[SearchBar.tsx]"]
  node_tripresults["Trip listings<br/>[TripList.tsx]"]
  node_tripdetail["Trip detail<br/>[TripDetail.tsx]"]
  node_partnerbrowse["Partner directory"]
  node_partnerdetail["Partner detail"]
  node_authui["Account interface<br/>[AuthModal.tsx]"]
  node_adminui["Admin dashboard"]
end

subgraph group_domain["Marketplace domain"]
  node_tripstate["Trip state<br/>[TripContext.tsx]"]
  node_authstate["Account state<br/>[AuthContext.tsx]"]
  node_tripsearch["Search parsing<br/>[searchEngine.ts]"]
  node_triputils["Trip matching<br/>[tripUtils.ts]"]
  node_partnerutils["Partner utilities<br/>[partnerUtils.ts]"]
end

subgraph group_server["Server and persistence"]
  node_tripsapi["Trip API<br/>[trips.ts]"]
  node_partnersapi["Partner API<br/>[partners.ts]"]
  node_usersapi["User API<br/>[users.ts]"]
  node_server["HTTP server<br/>[server.ts]"]
  node_security["Request security<br/>[security.ts]"]
  node_adminauth["Admin credentials<br/>[adminAuth.ts]"]
  node_storage[("Marketplace storage<br/>[storage.ts]")]
end

subgraph group_support["Shared capabilities"]
  node_firebase[("Firebase services<br/>[firebase.ts]")]
  node_language["Localization"]
  node_seo["SEO metadata<br/>[seoUtils.ts]"]
end

node_traveler(("Traveler"))

node_traveler -->|"uses"| node_app
node_app -->|"renders"| node_search
node_app -->|"renders"| node_tripresults
node_app -->|"routes to"| node_tripdetail
node_app -->|"routes to"| node_partnerdetail
node_search -->|"reads state"| node_tripstate
node_search -->|"parses queries"| node_tripsearch
node_tripstate -->|"filters trips"| node_triputils
node_triputils -->|"parses queries"| node_tripsearch
node_tripstate -->|"syncs data"| node_firebase
node_tripstate -->|"fetches trips"| node_tripsapi
node_tripstate -->|"manages partners"| node_partnersapi
node_partnerbrowse -->|"reads state"| node_tripstate
node_partnerbrowse -->|"uses utilities"| node_partnerutils
node_partnerdetail -->|"reads state"| node_tripstate
node_partnerdetail -->|"uses services"| node_firebase
node_authui -->|"authenticates"| node_authstate
node_authstate -->|"uses services"| node_firebase
node_authstate -->|"verifies admin"| node_usersapi
node_adminui -->|"manages listings"| node_tripstate
node_adminui -->|"checks account"| node_authstate
node_tripsapi -->|"checks requests"| node_security
node_tripsapi -->|"reads and writes"| node_storage
node_usersapi -->|"checks requests"| node_security
node_usersapi -->|"checks admin"| node_adminauth
node_usersapi -->|"reads and writes"| node_storage
node_server -->|"checks requests"| node_security
node_server -->|"uses credentials"| node_adminauth
node_server -->|"loads data"| node_storage
node_server -->|"builds metadata"| node_seo
node_storage -->|"hashes password"| node_adminauth
node_app -.->|"provides language"| node_language

click node_app "https://github.com/thureinlynn/ai-studio/blob/main/src/App.tsx"
click node_search "https://github.com/thureinlynn/ai-studio/blob/main/src/components/SearchBar.tsx"
click node_tripresults "https://github.com/thureinlynn/ai-studio/blob/main/src/components/TripList.tsx"
click node_tripdetail "https://github.com/thureinlynn/ai-studio/blob/main/src/components/TripDetail.tsx"
click node_partnerbrowse "https://github.com/thureinlynn/ai-studio/blob/main/src/components/CargoPartnersView.tsx"
click node_partnerdetail "https://github.com/thureinlynn/ai-studio/blob/main/src/components/CargoPartnerDetail.tsx"
click node_authui "https://github.com/thureinlynn/ai-studio/blob/main/src/components/AuthModal.tsx"
click node_adminui "https://github.com/thureinlynn/ai-studio/blob/main/src/components/AdminDashboardView.tsx"
click node_tripstate "https://github.com/thureinlynn/ai-studio/blob/main/src/context/TripContext.tsx"
click node_authstate "https://github.com/thureinlynn/ai-studio/blob/main/src/context/AuthContext.tsx"
click node_tripsearch "https://github.com/thureinlynn/ai-studio/blob/main/src/utils/searchEngine.ts"
click node_triputils "https://github.com/thureinlynn/ai-studio/blob/main/src/utils/tripUtils.ts"
click node_partnerutils "https://github.com/thureinlynn/ai-studio/blob/main/src/utils/partnerUtils.ts"
click node_tripsapi "https://github.com/thureinlynn/ai-studio/blob/main/api/trips.ts"
click node_partnersapi "https://github.com/thureinlynn/ai-studio/blob/main/api/partners.ts"
click node_usersapi "https://github.com/thureinlynn/ai-studio/blob/main/api/users.ts"
click node_server "https://github.com/thureinlynn/ai-studio/blob/main/server.ts"
click node_security "https://github.com/thureinlynn/ai-studio/blob/main/server/security.ts"
click node_adminauth "https://github.com/thureinlynn/ai-studio/blob/main/server/adminAuth.ts"
click node_storage "https://github.com/thureinlynn/ai-studio/blob/main/server/storage.ts"
click node_firebase "https://github.com/thureinlynn/ai-studio/blob/main/src/firebase.ts"
click node_language "https://github.com/thureinlynn/ai-studio/blob/main/src/context/LanguageContext.tsx"
click node_seo "https://github.com/thureinlynn/ai-studio/blob/main/src/utils/seoUtils.ts"

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_search,node_tripresults,node_tripdetail,node_partnerbrowse,node_partnerdetail,node_authui,node_adminui toneBlue
class node_tripstate,node_authstate,node_tripsearch,node_triputils,node_partnerutils toneAmber
class node_tripsapi,node_partnersapi,node_usersapi,node_server,node_security,node_adminauth,node_storage toneMint
class node_firebase,node_language,node_seo toneRose
class node_traveler toneIndigo
```

## Components

### Marketplace client

- [Application shell](https://github.com/thureinlynn/ai-studio/blob/main/src/App.tsx): `src/App.tsx`
- [Route search](https://github.com/thureinlynn/ai-studio/blob/main/src/components/SearchBar.tsx): `src/components/SearchBar.tsx`
- [Trip listings](https://github.com/thureinlynn/ai-studio/blob/main/src/components/TripList.tsx): `src/components/TripList.tsx`
- [Trip detail](https://github.com/thureinlynn/ai-studio/blob/main/src/components/TripDetail.tsx): `src/components/TripDetail.tsx`
- [Partner directory](https://github.com/thureinlynn/ai-studio/blob/main/src/components/CargoPartnersView.tsx): `src/components/CargoPartnersView.tsx`
- [Partner detail](https://github.com/thureinlynn/ai-studio/blob/main/src/components/CargoPartnerDetail.tsx): `src/components/CargoPartnerDetail.tsx`
- [Account interface](https://github.com/thureinlynn/ai-studio/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Admin dashboard](https://github.com/thureinlynn/ai-studio/blob/main/src/components/AdminDashboardView.tsx): `src/components/AdminDashboardView.tsx`

### Marketplace domain

- [Trip state](https://github.com/thureinlynn/ai-studio/blob/main/src/context/TripContext.tsx): `src/context/TripContext.tsx`
- [Account state](https://github.com/thureinlynn/ai-studio/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Search parsing](https://github.com/thureinlynn/ai-studio/blob/main/src/utils/searchEngine.ts): `src/utils/searchEngine.ts`
- [Trip matching](https://github.com/thureinlynn/ai-studio/blob/main/src/utils/tripUtils.ts): `src/utils/tripUtils.ts`
- [Partner utilities](https://github.com/thureinlynn/ai-studio/blob/main/src/utils/partnerUtils.ts): `src/utils/partnerUtils.ts`

### Server and persistence

- [Trip API](https://github.com/thureinlynn/ai-studio/blob/main/api/trips.ts): `api/trips.ts`
- [Partner API](https://github.com/thureinlynn/ai-studio/blob/main/api/partners.ts): `api/partners.ts`
- [User API](https://github.com/thureinlynn/ai-studio/blob/main/api/users.ts): `api/users.ts`
- [HTTP server](https://github.com/thureinlynn/ai-studio/blob/main/server.ts): `server.ts`
- [Request security](https://github.com/thureinlynn/ai-studio/blob/main/server/security.ts): `server/security.ts`
- [Admin credentials](https://github.com/thureinlynn/ai-studio/blob/main/server/adminAuth.ts): `server/adminAuth.ts`
- [Marketplace storage](https://github.com/thureinlynn/ai-studio/blob/main/server/storage.ts): `server/storage.ts`

### Shared capabilities

- [Firebase services](https://github.com/thureinlynn/ai-studio/blob/main/src/firebase.ts): `src/firebase.ts`
- [Localization](https://github.com/thureinlynn/ai-studio/blob/main/src/context/LanguageContext.tsx): `src/context/LanguageContext.tsx`
- [SEO metadata](https://github.com/thureinlynn/ai-studio/blob/main/src/utils/seoUtils.ts): `src/utils/seoUtils.ts`

### Other components

- **Traveler**

## Connections

- Traveler → Application shell: uses
- Application shell → Route search: renders (evidence: `src/App.tsx`)
- Application shell → Trip listings: renders (evidence: `src/App.tsx`)
- Application shell → Trip detail: routes to (evidence: `src/App.tsx`)
- Application shell → Partner detail: routes to (evidence: `src/App.tsx`)
- Route search → Trip state: reads state (evidence: `src/components/SearchBar.tsx`)
- Route search → Search parsing: parses queries (evidence: `src/components/SearchBar.tsx`)
- Trip state → Trip matching: filters trips (evidence: `src/context/TripContext.tsx`)
- Trip matching → Search parsing: parses queries (evidence: `src/utils/tripUtils.ts`)
- Trip state → Firebase services: syncs data (evidence: `src/context/TripContext.tsx`)
- Trip state → Trip API: fetches trips
- Trip state → Partner API: manages partners
- Partner directory → Trip state: reads state (evidence: `src/components/CargoPartnersView.tsx`)
- Partner directory → Partner utilities: uses utilities (evidence: `src/components/CargoPartnersView.tsx`)
- Partner detail → Trip state: reads state (evidence: `src/components/CargoPartnerDetail.tsx`)
- Partner detail → Firebase services: uses services (evidence: `src/components/CargoPartnerDetail.tsx`)
- Account interface → Account state: authenticates (evidence: `src/components/AuthModal.tsx`)
- Account state → Firebase services: uses services (evidence: `src/context/AuthContext.tsx`)
- Account state → User API: verifies admin
- Admin dashboard → Trip state: manages listings (evidence: `src/components/AdminDashboardView.tsx`)
- Admin dashboard → Account state: checks account (evidence: `src/components/AdminDashboardView.tsx`)
- Trip API → Request security: checks requests (evidence: `api/trips.ts`)
- Trip API → Marketplace storage: reads and writes (evidence: `api/trips.ts`)
- User API → Request security: checks requests (evidence: `api/users.ts`)
- User API → Admin credentials: checks admin (evidence: `api/users.ts`)
- User API → Marketplace storage: reads and writes (evidence: `api/users.ts`)
- HTTP server → Request security: checks requests (evidence: `server.ts`)
- HTTP server → Admin credentials: uses credentials (evidence: `server.ts`)
- HTTP server → Marketplace storage: loads data (evidence: `server.ts`)
- HTTP server → SEO metadata: builds metadata (evidence: `server.ts`)
- Marketplace storage → Admin credentials: hashes password (evidence: `server/storage.ts`)
- Application shell → Localization: provides language (evidence: `src/App.tsx`)
