# yanis312/ride-with-yan architecture

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

- Interactive diagram: https://gitdiagram.com/yanis312/ride-with-yan
- Repository: https://github.com/yanis312/ride-with-yan

## Overview

Ride with Yan is a bilingual passenger-facing tablet app: passengers browse entertainment and a shoe shop during a ride, then submit an order for WhatsApp follow-up. The README also describes administration, advertising destinations, and AI assistance; sampled Supabase handlers substantiate chat, speech, and advertiser-link services. Flutter implementation details were not sampled, so app nodes use supported source directories and app-flow edges rely on README statements. The labs and presentation-video code are separate supporting projects, not stages in the passenger workflow.

Main entry points: [`supabase/functions/chat/index.ts`](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/index.ts) (Chat Function), [`supabase/functions/speak/index.ts`](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/speak/index.ts) (Speech Function), [`video/src/Root.tsx`](https://github.com/yanis312/ride-with-yan/blob/main/video/src/Root.tsx) (Video Compositions), [`app/lib/screens`](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens) (Shop Screensaver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_passenger["Passenger App"]
  node_screensaver["Shop Screensaver"]
  node_lounge["Lounge"]
  node_shop["Product Shop"]
  node_cart["Cart"]
  node_order["Order QR"]
  node_admin["Admin Panel"]
  node_app_backend["App Data Access"]
end

subgraph group_services["Backend Services"]
  node_database[("Supabase Database")]
  node_chat["Chat Function<br/>[index.ts]"]
  node_prompt["Chat Prompt<br/>[prompt.ts]"]
  node_validation["Message Validation<br/>[validate.ts]"]
  node_speech["Speech Function<br/>[index.ts]"]
  node_voice["SSML Builder<br/>[voice.ts]"]
  node_destination["Ad Destinations<br/>[destination.ts]"]
end

subgraph group_content["Presentation Media"]
  node_presentation["Project Presentation<br/>[Presentation.tsx]"]
  node_reels["Demo Reels<br/>[Reel.tsx]"]
  node_video_root["Video Compositions<br/>[Root.tsx]"]
end

node_passenger(("Passenger"))
node_azure["Azure AI"]
node_whatsapp["WhatsApp"]

node_passenger -->|"opens"| node_screensaver
node_screensaver -->|"browses to"| node_lounge
node_lounge -->|"browses to"| node_shop
node_shop -.->|"adds items"| node_cart
node_cart -->|"creates order"| node_order
node_order -->|"shares order"| node_whatsapp
node_admin -.->|"manages data"| node_app_backend
node_app_backend -.->|"accesses"| node_database
node_chat -->|"cleans messages"| node_validation
node_chat -->|"uses prompt"| node_prompt
node_chat -->|"checks quota"| node_database
node_chat -->|"requests completion"| node_azure
node_speech -.->|"builds SSML"| node_voice
node_speech -.->|"requests speech"| node_azure
node_destination -.->|"resolves ad links"| node_passenger
node_video_root -->|"registers"| node_presentation
node_video_root -->|"registers"| node_reels

click node_screensaver "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens"
click node_lounge "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens"
click node_shop "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens"
click node_cart "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/data"
click node_order "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens"
click node_admin "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/admin"
click node_app_backend "https://github.com/yanis312/ride-with-yan/tree/main/app/lib/backend"
click node_database "https://github.com/yanis312/ride-with-yan/tree/main/supabase"
click node_chat "https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/index.ts"
click node_prompt "https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/prompt.ts"
click node_validation "https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/validate.ts"
click node_speech "https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/speak/index.ts"
click node_voice "https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/speak/voice.ts"
click node_destination "https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/go/destination.ts"
click node_presentation "https://github.com/yanis312/ride-with-yan/blob/main/video/src/Presentation.tsx"
click node_reels "https://github.com/yanis312/ride-with-yan/blob/main/video/src/Reel.tsx"
click node_video_root "https://github.com/yanis312/ride-with-yan/blob/main/video/src/Root.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_screensaver,node_lounge,node_shop,node_cart,node_order,node_admin,node_app_backend toneBlue
class node_database,node_chat,node_prompt,node_validation,node_speech,node_voice,node_destination toneAmber
class node_presentation,node_reels,node_video_root toneMint
class node_passenger,node_azure,node_whatsapp toneIndigo
```

## Components

### Passenger App

- [Shop Screensaver](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens): `app/lib/screens`
- [Lounge](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens): `app/lib/screens`
- [Product Shop](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens): `app/lib/screens`
- [Cart](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/data): `app/lib/data`
- [Order QR](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/screens): `app/lib/screens`
- [Admin Panel](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/admin): `app/lib/admin`
- [App Data Access](https://github.com/yanis312/ride-with-yan/tree/main/app/lib/backend): `app/lib/backend`

### Backend Services

- [Supabase Database](https://github.com/yanis312/ride-with-yan/tree/main/supabase): `supabase`
- [Chat Function](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/index.ts): `supabase/functions/chat/index.ts`
- [Chat Prompt](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/prompt.ts): `supabase/functions/chat/prompt.ts`
- [Message Validation](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/chat/validate.ts): `supabase/functions/chat/validate.ts`
- [Speech Function](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/speak/index.ts): `supabase/functions/speak/index.ts`
- [SSML Builder](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/speak/voice.ts): `supabase/functions/speak/voice.ts`
- [Ad Destinations](https://github.com/yanis312/ride-with-yan/blob/main/supabase/functions/go/destination.ts): `supabase/functions/go/destination.ts`

### Presentation Media

- [Project Presentation](https://github.com/yanis312/ride-with-yan/blob/main/video/src/Presentation.tsx): `video/src/Presentation.tsx`
- [Demo Reels](https://github.com/yanis312/ride-with-yan/blob/main/video/src/Reel.tsx): `video/src/Reel.tsx`
- [Video Compositions](https://github.com/yanis312/ride-with-yan/blob/main/video/src/Root.tsx): `video/src/Root.tsx`

### Other components

- **Passenger**
- **Azure AI**
- **WhatsApp**

## Connections

- Passenger → Shop Screensaver: opens (evidence: `README.md`)
- Shop Screensaver → Lounge: browses to (evidence: `README.md`)
- Lounge → Product Shop: browses to (evidence: `README.md`)
- Product Shop → Cart: adds items
- Cart → Order QR: creates order (evidence: `README.md`)
- Order QR → WhatsApp: shares order (evidence: `README.md`)
- Admin Panel → App Data Access: manages data
- App Data Access → Supabase Database: accesses
- Chat Function → Message Validation: cleans messages (evidence: `supabase/functions/chat/index.ts`)
- Chat Function → Chat Prompt: uses prompt (evidence: `supabase/functions/chat/index.ts`)
- Chat Function → Supabase Database: checks quota (evidence: `supabase/functions/chat/index.ts`)
- Chat Function → Azure AI: requests completion (evidence: `supabase/functions/chat/index.ts`)
- Speech Function → SSML Builder: builds SSML (evidence: `supabase/functions/speak/index.ts`)
- Speech Function → Azure AI: requests speech
- Ad Destinations → Passenger: resolves ad links
- Video Compositions → Project Presentation: registers (evidence: `video/src/Root.tsx`)
- Video Compositions → Demo Reels: registers (evidence: `video/src/Root.tsx`)
