# aofkungz/washthis-webshop architecture

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

- Interactive diagram: https://gitdiagram.com/aofkungz/washthis-webshop
- Repository: https://github.com/aofkungz/washthis-webshop

## Overview

WashThis! is a laundry-machine booking dashboard. A user opens the dashboard, reviews machine availability, configures a washer or dryer booking, and submits it; the page updates in-memory machine, account, queue, and booking-history state. Users can also manage their profile, view queues and notifications, and use chat. Google sign-in supplies a session, while a separate product-management server-action branch uses a temporary in-memory product store. The README is only the default Next.js template; unsampled widget internals and persistence behavior are not inferred.

Main entry points: [`src/app/page.tsx`](https://github.com/aofkungz/washthis-webshop/blob/master/src/app/page.tsx) (Dashboard state), [`src/auth.ts`](https://github.com/aofkungz/washthis-webshop/blob/master/src/auth.ts) (Auth configuration), [`src/lib/types.ts`](https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/types.ts) (Booking history), [`src/components/BookingModal.tsx`](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/BookingModal.tsx) (Booking form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Laundry Dashboard"]
  node_dashboard_page["Dashboard state<br/>[page.tsx]"]
  node_dashboard_ui["Machine dashboard UI<br/>[DashboardUI.tsx]"]
  node_booking["Booking form<br/>[BookingModal.tsx]"]
  node_queue["Queue view<br/>[QueueModal.tsx]"]
  node_profile["Profile and wallet<br/>[ProfileModal.tsx]"]
  node_confirm["Confirmation dialog<br/>[ConfirmDialog.tsx]"]
  node_notifications["Notification menu"]
  node_chat["Chat widget<br/>[ChatWidget.tsx]"]
  node_booking_history["Booking history<br/>[types.ts]"]
end

subgraph group_identity["Identity"]
  node_auth_config["Auth configuration<br/>[auth.ts]"]
  node_auth_route["Auth API route<br/>[route.ts]"]
  node_auth_provider["Session provider<br/>[AuthProvider.tsx]"]
  node_layout["App layout<br/>[layout.tsx]"]
  node_auth_button["Auth button<br/>[auth-button.tsx]"]
end

subgraph group_product["Product Actions"]
  node_product_action["Product server actions<br/>[action.tsx]"]
  node_product_store["Temporary product store<br/>[products.ts]"]
end

subgraph group_shared["Shared Logic"]
  node_schemas["Input schemas<br/>[schemas.ts]"]
  node_time["Time calculations<br/>[time.ts]"]
end

node_user(("Laundry user"))
node_google(("Google identity"))

node_user -->|"opens"| node_dashboard_page
node_dashboard_page -->|"renders"| node_dashboard_ui
node_dashboard_page -->|"opens and submits"| node_booking
node_dashboard_page -->|"renders"| node_queue
node_dashboard_page -->|"renders"| node_profile
node_dashboard_page -->|"renders"| node_confirm
node_dashboard_page -->|"renders"| node_notifications
node_dashboard_page -->|"renders"| node_chat
node_dashboard_page -->|"tracks"| node_booking_history
node_dashboard_ui -->|"formats wait"| node_time
node_booking -->|"validates with"| node_schemas
node_booking -->|"uses types"| node_booking_history
node_profile -->|"validates with"| node_schemas
node_profile -->|"displays"| node_booking_history
node_queue -->|"calculates wait"| node_time
node_queue -->|"uses types"| node_booking_history
node_chat -->|"uses validation"| node_schemas
node_layout -->|"wraps app"| node_auth_provider
node_layout -->|"loads session"| node_auth_config
node_auth_provider -.->|"provides session"| node_auth_config
node_auth_route -->|"routes handlers"| node_auth_config
node_auth_button -->|"starts sign-in"| node_auth_config
node_google -->|"authenticates"| node_auth_config
node_product_action -->|"updates and deletes"| node_product_store

click node_dashboard_page "https://github.com/aofkungz/washthis-webshop/blob/master/src/app/page.tsx"
click node_dashboard_ui "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/DashboardUI.tsx"
click node_booking "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/BookingModal.tsx"
click node_queue "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/QueueModal.tsx"
click node_profile "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/ProfileModal.tsx"
click node_confirm "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/ConfirmDialog.tsx"
click node_notifications "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/NotificationDropdown.tsx"
click node_chat "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/ChatWidget.tsx"
click node_booking_history "https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/types.ts"
click node_auth_config "https://github.com/aofkungz/washthis-webshop/blob/master/src/auth.ts"
click node_auth_route "https://github.com/aofkungz/washthis-webshop/blob/master/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_auth_provider "https://github.com/aofkungz/washthis-webshop/blob/master/src/components/AuthProvider.tsx"
click node_layout "https://github.com/aofkungz/washthis-webshop/blob/master/src/app/layout.tsx"
click node_auth_button "https://github.com/aofkungz/washthis-webshop/blob/master/src/app/auth-button.tsx"
click node_product_action "https://github.com/aofkungz/washthis-webshop/blob/master/src/app/action.tsx"
click node_product_store "https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/products.ts"
click node_schemas "https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/schemas.ts"
click node_time "https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/time.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_dashboard_page,node_dashboard_ui,node_booking,node_queue,node_profile,node_confirm,node_notifications,node_chat,node_booking_history,node_user toneBlue
class node_auth_config,node_auth_route,node_auth_provider,node_layout,node_auth_button toneAmber
class node_product_action,node_product_store toneMint
class node_schemas,node_time toneRose
class node_google toneIndigo
```

## Components

### Laundry Dashboard

- [Dashboard state](https://github.com/aofkungz/washthis-webshop/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Machine dashboard UI](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/DashboardUI.tsx): `src/components/DashboardUI.tsx`
- [Booking form](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/BookingModal.tsx): `src/components/BookingModal.tsx`
- [Queue view](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/QueueModal.tsx): `src/components/QueueModal.tsx`
- [Profile and wallet](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/ProfileModal.tsx): `src/components/ProfileModal.tsx`
- [Confirmation dialog](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/ConfirmDialog.tsx): `src/components/ConfirmDialog.tsx`
- [Notification menu](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/NotificationDropdown.tsx): `src/components/NotificationDropdown.tsx`
- [Chat widget](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/ChatWidget.tsx): `src/components/ChatWidget.tsx`
- [Booking history](https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/types.ts): `src/lib/types.ts`

### Identity

- [Auth configuration](https://github.com/aofkungz/washthis-webshop/blob/master/src/auth.ts): `src/auth.ts`
- [Auth API route](https://github.com/aofkungz/washthis-webshop/blob/master/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- [Session provider](https://github.com/aofkungz/washthis-webshop/blob/master/src/components/AuthProvider.tsx): `src/components/AuthProvider.tsx`
- [App layout](https://github.com/aofkungz/washthis-webshop/blob/master/src/app/layout.tsx): `src/app/layout.tsx`
- [Auth button](https://github.com/aofkungz/washthis-webshop/blob/master/src/app/auth-button.tsx): `src/app/auth-button.tsx`

### Product Actions

- [Product server actions](https://github.com/aofkungz/washthis-webshop/blob/master/src/app/action.tsx): `src/app/action.tsx`
- [Temporary product store](https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/products.ts): `src/lib/products.ts`

### Shared Logic

- [Input schemas](https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/schemas.ts): `src/lib/schemas.ts`
- [Time calculations](https://github.com/aofkungz/washthis-webshop/blob/master/src/lib/time.ts): `src/lib/time.ts`

### Other components

- **Laundry user**
- **Google identity**

## Connections

- Laundry user → Dashboard state: opens (evidence: `src/app/page.tsx`)
- Dashboard state → Machine dashboard UI: renders (evidence: `src/app/page.tsx`)
- Dashboard state → Booking form: opens and submits (evidence: `src/app/page.tsx`)
- Dashboard state → Queue view: renders (evidence: `src/app/page.tsx`)
- Dashboard state → Profile and wallet: renders (evidence: `src/app/page.tsx`)
- Dashboard state → Confirmation dialog: renders (evidence: `src/app/page.tsx`)
- Dashboard state → Notification menu: renders (evidence: `src/app/page.tsx`)
- Dashboard state → Chat widget: renders (evidence: `src/app/page.tsx`)
- Dashboard state → Booking history: tracks (evidence: `src/app/page.tsx`)
- Machine dashboard UI → Time calculations: formats wait (evidence: `src/components/DashboardUI.tsx`)
- Booking form → Input schemas: validates with (evidence: `src/components/BookingModal.tsx`)
- Booking form → Booking history: uses types (evidence: `src/components/BookingModal.tsx`)
- Profile and wallet → Input schemas: validates with (evidence: `src/components/ProfileModal.tsx`)
- Profile and wallet → Booking history: displays (evidence: `src/components/ProfileModal.tsx`)
- Queue view → Time calculations: calculates wait (evidence: `src/components/QueueModal.tsx`)
- Queue view → Booking history: uses types (evidence: `src/components/QueueModal.tsx`)
- Chat widget → Input schemas: uses validation (evidence: `src/components/ChatWidget.tsx`)
- App layout → Session provider: wraps app (evidence: `src/app/layout.tsx`)
- App layout → Auth configuration: loads session (evidence: `src/app/layout.tsx`)
- Session provider → Auth configuration: provides session
- Auth API route → Auth configuration: routes handlers (evidence: `src/app/api/auth/[...nextauth]/route.ts`)
- Auth button → Auth configuration: starts sign-in (evidence: `src/app/auth-button.tsx`)
- Google identity → Auth configuration: authenticates (evidence: `src/auth.ts`)
- Product server actions → Temporary product store: updates and deletes (evidence: `src/app/action.tsx`)
