# shrimbly/book-the-lakehouse architecture

> Architecture diagram of the GitHub repository shrimbly/book-the-lakehouse, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shrimbly/book-the-lakehouse
- Repository: https://github.com/shrimbly/book-the-lakehouse

## Overview

Book the Lakehouse is a private family-home booking calendar. The main workflow is PIN access, identity selection, date-range selection with conflict checking, and booking creation or editing; optional costs and transfer details support payment follow-up, while Mary mode tracks settlement. The README documents demo-data operation, profile/stay photos, and family customization. Several route and action implementations were only sampled partially, so uncertain internal call links are omitted; unsampled documented capabilities use their existing enclosing paths.

Main entry points: [`src/app/actions.ts`](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/actions.ts) (Server actions), [`src/db/client.ts`](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/client.ts) (Database client), [`src/app/mary/page.tsx`](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/mary/page.tsx) (Mary route), [`src/db/queries.ts`](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/queries.ts) (Database queries)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Calendar experience"]
  node_home["Calendar route<br/>[page.tsx]"]
  node_calendar["Calendar UI<br/>[Calendar.tsx]"]
  node_selection["Date selection"]
  node_calendarlogic["Calendar rules<br/>[calendar.ts]"]
end

subgraph group_booking["Booking and payments"]
  node_actions["Server actions<br/>[actions.ts]"]
  node_optimistic["Booking updates"]
  node_payment["Payment settings<br/>[payment.ts]"]
  node_maryroute["Mary route<br/>[page.tsx]"]
  node_checklist["Payment checklist<br/>[MaryChecklist.tsx]"]
end

subgraph group_identity["Access and identity"]
  node_identityui["Identity picker<br/>[IdentityPicker.tsx]"]
  node_gate["PIN gate<br/>[PinGate.tsx]"]
end

subgraph group_persistence["Data and media"]
  node_datasource["Data source<br/>[data-source.ts]"]
  node_demo["Demo data<br/>[data.ts]"]
  node_queries["Database queries<br/>[queries.ts]"]
  node_dbclient["Database client<br/>[client.ts]"]
  node_schema["Database schema<br/>[schema.ts]"]
  node_photos["Photo features<br/>[useStayPhotos.ts]"]
  node_image["Image processing<br/>[image.ts]"]
end

node_family(("Family member"))
node_neon[("Neon Postgres")]
node_blob[("Vercel Blob")]

node_family -->|"opens"| node_home
node_home -->|"renders"| node_calendar
node_family -->|"enters PIN"| node_gate
node_family -->|"chooses identity"| node_identityui
node_calendar -->|"selects dates"| node_selection
node_selection -->|"checks dates"| node_calendarlogic
node_optimistic -->|"calls booking actions"| node_actions
node_identityui -->|"updates profile"| node_actions
node_photos -->|"processes images"| node_image
node_photos -->|"uploads or deletes"| node_actions
node_actions -->|"uses database"| node_dbclient
node_dbclient -.->|"connects"| node_neon
node_dbclient -->|"configures"| node_schema
node_datasource -->|"loads demo data"| node_demo
node_datasource -->|"loads persisted data"| node_queries
node_queries -->|"queries"| node_dbclient
node_queries -->|"queries tables"| node_schema
node_maryroute -->|"loads stays"| node_datasource
node_maryroute -->|"reads settings"| node_payment
node_maryroute -->|"renders stays"| node_checklist
node_checklist -->|"updates settlement"| node_actions
node_actions -.->|"stores images"| node_blob

click node_home "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/page.tsx"
click node_calendar "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/Calendar.tsx"
click node_selection "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/calendar/useBookingSelection.ts"
click node_calendarlogic "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/calendar.ts"
click node_identityui "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/IdentityPicker.tsx"
click node_gate "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/PinGate.tsx"
click node_actions "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/actions.ts"
click node_optimistic "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/calendar/useOptimisticBookings.ts"
click node_payment "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/payment.ts"
click node_maryroute "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/mary/page.tsx"
click node_checklist "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/MaryChecklist.tsx"
click node_datasource "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/data-source.ts"
click node_demo "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/data.ts"
click node_queries "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/queries.ts"
click node_dbclient "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/client.ts"
click node_schema "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/schema.ts"
click node_photos "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/calendar/useStayPhotos.ts"
click node_image "https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/image.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_home,node_calendar,node_selection,node_calendarlogic toneBlue
class node_actions,node_optimistic,node_payment,node_maryroute,node_checklist,node_neon,node_blob toneAmber
class node_identityui,node_gate toneMint
class node_datasource,node_demo,node_queries,node_dbclient,node_schema,node_photos,node_image toneRose
class node_family toneIndigo
```

## Components

### Calendar experience

- [Calendar route](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Calendar UI](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/Calendar.tsx): `src/components/Calendar.tsx`
- [Date selection](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/calendar/useBookingSelection.ts): `src/components/calendar/useBookingSelection.ts`
- [Calendar rules](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/calendar.ts): `src/lib/calendar.ts`

### Booking and payments

- [Server actions](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/actions.ts): `src/app/actions.ts`
- [Booking updates](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/calendar/useOptimisticBookings.ts): `src/components/calendar/useOptimisticBookings.ts`
- [Payment settings](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/payment.ts): `src/lib/payment.ts`
- [Mary route](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/app/mary/page.tsx): `src/app/mary/page.tsx`
- [Payment checklist](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/MaryChecklist.tsx): `src/components/MaryChecklist.tsx`

### Access and identity

- [Identity picker](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/IdentityPicker.tsx): `src/components/IdentityPicker.tsx`
- [PIN gate](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/PinGate.tsx): `src/components/PinGate.tsx`

### Data and media

- [Data source](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/data-source.ts): `src/lib/data-source.ts`
- [Demo data](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/data.ts): `src/lib/data.ts`
- [Database queries](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/queries.ts): `src/db/queries.ts`
- [Database client](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/client.ts): `src/db/client.ts`
- [Database schema](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/db/schema.ts): `src/db/schema.ts`
- [Photo features](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/components/calendar/useStayPhotos.ts): `src/components/calendar/useStayPhotos.ts`
- [Image processing](https://github.com/shrimbly/book-the-lakehouse/blob/master/src/lib/image.ts): `src/lib/image.ts`

### Other components

- **Family member**
- **Neon Postgres**
- **Vercel Blob**

## Connections

- Family member → Calendar route: opens
- Calendar route → Calendar UI: renders
- Family member → PIN gate: enters PIN
- Family member → Identity picker: chooses identity
- Calendar UI → Date selection: selects dates
- Date selection → Calendar rules: checks dates
- Booking updates → Server actions: calls booking actions
- Identity picker → Server actions: updates profile
- Photo features → Image processing: processes images
- Photo features → Server actions: uploads or deletes
- Server actions → Database client: uses database
- Database client → Neon Postgres: connects
- Database client → Database schema: configures
- Data source → Demo data: loads demo data
- Data source → Database queries: loads persisted data
- Database queries → Database client: queries
- Database queries → Database schema: queries tables
- Mary route → Data source: loads stays
- Mary route → Payment settings: reads settings
- Mary route → Payment checklist: renders stays
- Payment checklist → Server actions: updates settlement
- Server actions → Vercel Blob: stores images
