# peter-177/lakta architecture

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

- Interactive diagram: https://gitdiagram.com/peter-177/lakta
- Repository: https://github.com/peter-177/lakta

## Overview

Media Production is a studio-booking and payment-management web application. Customers choose studio time, create a booking hold, submit payment proof or use wallet balance, and manage bookings; administrators review bookings, refunds, and top-ups. The tree also shows availability, notifications, bilingual presentation, and wallet capabilities. The excerpts verify only selected calls, so most unsampled subsystem relationships are intentionally left unconnected rather than inferred.

Main entry points: [`media-production/src/components/ui/booking-flow/BookingFlowClient.tsx`](https://github.com/peter-177/lakta/blob/main/media-production/src/components/ui/booking-flow/BookingFlowClient.tsx) (Booking flow), [`media-production/src/lib/supabase/server.ts`](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/supabase/server.ts) (Supabase client), [`media-production/src/app/api/admin/proofs/[fileName]/route.ts`](https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/admin/proofs/%5BfileName%5D/route.ts) (Proof receipt route), [`media-production/src/app/api/admin/top-ups/[topupId]/receipt/route.ts`](https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/admin/top-ups/%5BtopupId%5D/receipt/route.ts) (Top-up receipt route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_booking["Booking &amp; availability"]
  node_booking_flow["Booking flow"]
  node_create_booking["Create booking<br/>[create-booking.ts]"]
  node_availability["Slot availability"]
  node_booking_pages["Booking pages"]
  node_booking_lists["Booking lists<br/>[page.tsx]"]
  node_cancellation["Cancellation policy"]
  node_hold_expiry["Hold expiry logic<br/>[hold-expiry.ts]"]
  node_studio["Studio discovery"]
end

subgraph group_payments["Payments &amp; wallet"]
  node_proof_upload["Proof upload<br/>[upload-proof.ts]"]
  node_wallet["Wallet"]
  node_wallet_pages["Wallet pages"]
end

subgraph group_admin["Admin operations"]
  node_admin_review["Booking review<br/>[page.tsx]"]
  node_admin_dashboard["Admin dashboard<br/>[page.tsx]"]
  node_admin_refunds["Refund management<br/>[page.tsx]"]
  node_admin_topups["Top-up management<br/>[page.tsx]"]
  node_proof_receipt["Proof receipt route<br/>[route.ts]"]
  node_topup_receipt["Top-up receipt route<br/>[route.ts]"]
end

subgraph group_platform["Shared platform"]
  node_db_queries["Database queries<br/>[queries.ts]"]
  node_supabase_client["Supabase client<br/>[server.ts]"]
  node_expire_route["Hold expiry trigger<br/>[route.ts]"]
  node_retry_route["Notification retry trigger<br/>[route.ts]"]
  node_retry_notifications["Notification retries"]
  node_localization["Localization"]
end

node_customer(("Customer"))
node_supabase_storage[("Supabase storage")]

node_customer -->|"submits booking"| node_booking_flow
node_booking_flow -->|"creates booking"| node_create_booking
node_booking_flow -->|"routes to checkout"| node_booking_pages
node_expire_route -->|"releases expired holds"| node_hold_expiry
node_retry_route -->|"retries notices"| node_retry_notifications
node_proof_receipt -->|"finds proof"| node_db_queries
node_proof_receipt -->|"downloads file"| node_supabase_client
node_supabase_client -->|"connects to"| node_supabase_storage
node_topup_receipt -->|"finds top-up"| node_db_queries
node_topup_receipt -->|"downloads file"| node_supabase_client

click node_booking_flow "https://github.com/peter-177/lakta/blob/main/media-production/src/components/ui/booking-flow/BookingFlowClient.tsx"
click node_create_booking "https://github.com/peter-177/lakta/blob/main/media-production/src/lib/booking/create-booking.ts"
click node_availability "https://github.com/peter-177/lakta/tree/main/media-production/src/lib/slots"
click node_booking_pages "https://github.com/peter-177/lakta/tree/main/media-production/src/app/%5Blocale%5D/booking"
click node_booking_lists "https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/bookings/page.tsx"
click node_cancellation "https://github.com/peter-177/lakta/tree/main/media-production/src/lib/booking"
click node_proof_upload "https://github.com/peter-177/lakta/blob/main/media-production/src/lib/booking/upload-proof.ts"
click node_wallet "https://github.com/peter-177/lakta/tree/main/media-production/src/lib/wallet"
click node_wallet_pages "https://github.com/peter-177/lakta/tree/main/media-production/src/app/%5Blocale%5D/wallet"
click node_admin_review "https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/booking/%5BbookingId%5D/page.tsx"
click node_admin_dashboard "https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/dashboard/page.tsx"
click node_admin_refunds "https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/refunds/page.tsx"
click node_admin_topups "https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/top-ups/page.tsx"
click node_proof_receipt "https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/admin/proofs/%5BfileName%5D/route.ts"
click node_topup_receipt "https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/admin/top-ups/%5BtopupId%5D/receipt/route.ts"
click node_db_queries "https://github.com/peter-177/lakta/blob/main/media-production/src/lib/db/queries.ts"
click node_supabase_client "https://github.com/peter-177/lakta/blob/main/media-production/src/lib/supabase/server.ts"
click node_expire_route "https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/cron/expire-bookings/route.ts"
click node_hold_expiry "https://github.com/peter-177/lakta/blob/main/media-production/src/lib/booking/hold-expiry.ts"
click node_retry_route "https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/cron/retry-notifications/route.ts"
click node_retry_notifications "https://github.com/peter-177/lakta/blob/main/media-production/src/lib/email/retry-notifications.ts"
click node_studio "https://github.com/peter-177/lakta/tree/main/media-production/src/app/%5Blocale%5D/studio"
click node_localization "https://github.com/peter-177/lakta/tree/main/media-production/src/lib/i18n"

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_booking_flow,node_create_booking,node_availability,node_booking_pages,node_booking_lists,node_cancellation,node_hold_expiry,node_studio toneBlue
class node_proof_upload,node_wallet,node_wallet_pages,node_supabase_storage toneAmber
class node_admin_review,node_admin_dashboard,node_admin_refunds,node_admin_topups,node_proof_receipt,node_topup_receipt toneMint
class node_db_queries,node_supabase_client,node_expire_route,node_retry_route,node_retry_notifications,node_localization toneRose
class node_customer toneIndigo
```

## Components

### Booking & availability

- [Booking flow](https://github.com/peter-177/lakta/blob/main/media-production/src/components/ui/booking-flow/BookingFlowClient.tsx): `media-production/src/components/ui/booking-flow/BookingFlowClient.tsx`
- [Create booking](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/booking/create-booking.ts): `media-production/src/lib/booking/create-booking.ts`
- [Slot availability](https://github.com/peter-177/lakta/tree/main/media-production/src/lib/slots): `media-production/src/lib/slots`
- [Booking pages](https://github.com/peter-177/lakta/tree/main/media-production/src/app/%5Blocale%5D/booking): `media-production/src/app/[locale]/booking`
- [Booking lists](https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/bookings/page.tsx): `media-production/src/app/[locale]/bookings/page.tsx`
- [Cancellation policy](https://github.com/peter-177/lakta/tree/main/media-production/src/lib/booking): `media-production/src/lib/booking`
- [Hold expiry logic](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/booking/hold-expiry.ts): `media-production/src/lib/booking/hold-expiry.ts`
- [Studio discovery](https://github.com/peter-177/lakta/tree/main/media-production/src/app/%5Blocale%5D/studio): `media-production/src/app/[locale]/studio`

### Payments & wallet

- [Proof upload](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/booking/upload-proof.ts): `media-production/src/lib/booking/upload-proof.ts`
- [Wallet](https://github.com/peter-177/lakta/tree/main/media-production/src/lib/wallet): `media-production/src/lib/wallet`
- [Wallet pages](https://github.com/peter-177/lakta/tree/main/media-production/src/app/%5Blocale%5D/wallet): `media-production/src/app/[locale]/wallet`

### Admin operations

- [Booking review](https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/booking/%5BbookingId%5D/page.tsx): `media-production/src/app/[locale]/admin/booking/[bookingId]/page.tsx`
- [Admin dashboard](https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/dashboard/page.tsx): `media-production/src/app/[locale]/admin/dashboard/page.tsx`
- [Refund management](https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/refunds/page.tsx): `media-production/src/app/[locale]/admin/refunds/page.tsx`
- [Top-up management](https://github.com/peter-177/lakta/blob/main/media-production/src/app/%5Blocale%5D/admin/top-ups/page.tsx): `media-production/src/app/[locale]/admin/top-ups/page.tsx`
- [Proof receipt route](https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/admin/proofs/%5BfileName%5D/route.ts): `media-production/src/app/api/admin/proofs/[fileName]/route.ts`
- [Top-up receipt route](https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/admin/top-ups/%5BtopupId%5D/receipt/route.ts): `media-production/src/app/api/admin/top-ups/[topupId]/receipt/route.ts`

### Shared platform

- [Database queries](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/db/queries.ts): `media-production/src/lib/db/queries.ts`
- [Supabase client](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/supabase/server.ts): `media-production/src/lib/supabase/server.ts`
- [Hold expiry trigger](https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/cron/expire-bookings/route.ts): `media-production/src/app/api/cron/expire-bookings/route.ts`
- [Notification retry trigger](https://github.com/peter-177/lakta/blob/main/media-production/src/app/api/cron/retry-notifications/route.ts): `media-production/src/app/api/cron/retry-notifications/route.ts`
- [Notification retries](https://github.com/peter-177/lakta/blob/main/media-production/src/lib/email/retry-notifications.ts): `media-production/src/lib/email/retry-notifications.ts`
- [Localization](https://github.com/peter-177/lakta/tree/main/media-production/src/lib/i18n): `media-production/src/lib/i18n`

### Other components

- **Customer**
- **Supabase storage**

## Connections

- Customer → Booking flow: submits booking (evidence: `media-production/src/components/ui/booking-flow/BookingFlowClient.tsx`)
- Booking flow → Create booking: creates booking (evidence: `media-production/src/components/ui/booking-flow/BookingFlowClient.tsx`)
- Booking flow → Booking pages: routes to checkout (evidence: `media-production/src/components/ui/booking-flow/BookingFlowClient.tsx`)
- Hold expiry trigger → Hold expiry logic: releases expired holds (evidence: `media-production/src/app/api/cron/expire-bookings/route.ts`)
- Notification retry trigger → Notification retries: retries notices (evidence: `media-production/src/app/api/cron/retry-notifications/route.ts`)
- Proof receipt route → Database queries: finds proof (evidence: `media-production/src/app/api/admin/proofs/[fileName]/route.ts`)
- Proof receipt route → Supabase client: downloads file (evidence: `media-production/src/app/api/admin/proofs/[fileName]/route.ts`)
- Supabase client → Supabase storage: connects to (evidence: `media-production/src/lib/supabase/server.ts`)
- Top-up receipt route → Database queries: finds top-up (evidence: `media-production/src/app/api/admin/top-ups/[topupId]/receipt/route.ts`)
- Top-up receipt route → Supabase client: downloads file (evidence: `media-production/src/app/api/admin/top-ups/[topupId]/receipt/route.ts`)
