# starrlikeringo22/vipclub architecture

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

- Interactive diagram: https://gitdiagram.com/starrlikeringo22/vipclub
- Repository: https://github.com/starrlikeringo22/vipclub

## Overview

VIP Club is a salon-focused loyalty and retention app. Customers join a business, receive a QR-linked VIP pass, and earn rewards through staff-logged visits; owners manage members, appointments, campaigns, and rebooking reminders, while admins review cross-shop analytics. The API routes coordinate these workflows and the data layer supports in-memory or Supabase-backed persistence. Major capabilities and some links are based on README descriptions and the SOURCE INDEX; unsampled implementation details are not asserted beyond that evidence.

Main entry points: [`app/api/bookings/route.ts`](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/bookings/route.ts) (Booking API), [`lib/db.ts`](https://github.com/starrlikeringo22/vipclub/blob/main/lib/db.ts) (Member Data), [`app/api/signup/route.ts`](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/signup/route.ts) (Signup API), [`lib/sms.ts`](https://github.com/starrlikeringo22/vipclub/blob/main/lib/sms.ts) (SMS Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_customer["Customer Loyalty"]
  node_join["Join Page<br/>[page.tsx]"]
  node_signup["Signup API<br/>[route.ts]"]
  node_pass["VIP Pass<br/>[page.tsx]"]
  node_checkin["Staff Check-in<br/>[CheckinClient.tsx]"]
  node_visitapi["Visit API<br/>[route.ts]"]
end

subgraph group_operations["Shop Operations"]
  node_ownerapp["Owner Workspace<br/>[OwnerApp.tsx]"]
  node_profile["Client Profile<br/>[ClientProfile.tsx]"]
  node_settings["Business Settings<br/>[SettingsClient.tsx]"]
  node_admin["Admin Analytics<br/>[page.tsx]"]
end

subgraph group_engagement["Messaging and Scheduling"]
  node_bookingsapi["Booking API<br/>[route.ts]"]
  node_bookinglogic["Booking Actions<br/>[booking-actions.ts]"]
  node_calendar["Calendar Assets<br/>[calendar.ts]"]
  node_email["Email Delivery<br/>[email.ts]"]
  node_reminders["Reminder Runner<br/>[route.ts]"]
  node_campaigns["Campaigns API<br/>[route.ts]"]
  node_sms["SMS Service<br/>[sms.ts]"]
end

subgraph group_platform["Platform Services"]
  node_memberdata[("Member Data<br/>[db.ts]")]
  node_clientlogic["Client Management<br/>[clients.ts]"]
  node_auth["Authentication<br/>[auth.ts]"]
  node_session["Session Guards<br/>[session.ts]"]
  node_users["User Accounts<br/>[users.ts]"]
end

node_customer(("Customer"))
node_staff(("Staff"))
node_supabase[("Supabase")]
node_twilio["Twilio"]
node_resend["Resend"]

node_customer -->|"opens"| node_join
node_join -->|"submits signup"| node_signup
node_signup -->|"creates member"| node_memberdata
node_signup -->|"checks referral"| node_clientlogic
node_signup -->|"sends welcome"| node_sms
node_memberdata -->|"loads member"| node_pass
node_customer -->|"views pass"| node_pass
node_staff -->|"scans pass"| node_checkin
node_checkin -->|"records visit"| node_visitapi
node_visitapi -.->|"updates rewards"| node_memberdata
node_ownerapp -->|"manages bookings"| node_bookingsapi
node_bookingsapi -->|"creates booking"| node_bookinglogic
node_bookingsapi -->|"loads business data"| node_memberdata
node_bookingsapi -->|"builds calendar links"| node_calendar
node_bookingsapi -->|"sends invite"| node_email
node_email -.->|"delivers email"| node_resend
node_ownerapp -->|"manages clients"| node_profile
node_ownerapp -->|"configures shop"| node_settings
node_reminders -->|"finds due members"| node_clientlogic
node_reminders -->|"sends reminders"| node_sms
node_campaigns -->|"sends campaign"| node_sms
node_sms -.->|"delivers texts"| node_twilio
node_admin -.->|"reports metrics"| node_memberdata
node_session -->|"verifies session"| node_auth
node_users -->|"checks passwords"| node_auth
node_bookingsapi -->|"checks role"| node_session
node_memberdata -.->|"persists records"| node_supabase

click node_join "https://github.com/starrlikeringo22/vipclub/blob/main/app/join/%5BbusinessId%5D/page.tsx"
click node_signup "https://github.com/starrlikeringo22/vipclub/blob/main/app/api/signup/route.ts"
click node_memberdata "https://github.com/starrlikeringo22/vipclub/blob/main/lib/db.ts"
click node_clientlogic "https://github.com/starrlikeringo22/vipclub/blob/main/lib/clients.ts"
click node_pass "https://github.com/starrlikeringo22/vipclub/blob/main/app/pass/%5BcustomerId%5D/page.tsx"
click node_checkin "https://github.com/starrlikeringo22/vipclub/blob/main/app/checkin/%5BcustomerId%5D/CheckinClient.tsx"
click node_visitapi "https://github.com/starrlikeringo22/vipclub/blob/main/app/api/customers/%5Bid%5D/visit/route.ts"
click node_ownerapp "https://github.com/starrlikeringo22/vipclub/blob/main/app/owner/OwnerApp.tsx"
click node_profile "https://github.com/starrlikeringo22/vipclub/blob/main/app/owner/client/%5Bid%5D/ClientProfile.tsx"
click node_settings "https://github.com/starrlikeringo22/vipclub/blob/main/app/owner/settings/SettingsClient.tsx"
click node_bookingsapi "https://github.com/starrlikeringo22/vipclub/blob/main/app/api/bookings/route.ts"
click node_bookinglogic "https://github.com/starrlikeringo22/vipclub/blob/main/lib/booking-actions.ts"
click node_calendar "https://github.com/starrlikeringo22/vipclub/blob/main/lib/calendar.ts"
click node_email "https://github.com/starrlikeringo22/vipclub/blob/main/lib/email.ts"
click node_reminders "https://github.com/starrlikeringo22/vipclub/blob/main/app/api/reminders/run/route.ts"
click node_campaigns "https://github.com/starrlikeringo22/vipclub/blob/main/app/api/campaigns/route.ts"
click node_sms "https://github.com/starrlikeringo22/vipclub/blob/main/lib/sms.ts"
click node_admin "https://github.com/starrlikeringo22/vipclub/blob/main/app/admin/page.tsx"
click node_auth "https://github.com/starrlikeringo22/vipclub/blob/main/lib/auth.ts"
click node_session "https://github.com/starrlikeringo22/vipclub/blob/main/lib/session.ts"
click node_users "https://github.com/starrlikeringo22/vipclub/blob/main/lib/users.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_join,node_signup,node_pass,node_checkin,node_visitapi toneBlue
class node_ownerapp,node_profile,node_settings,node_admin,node_supabase toneAmber
class node_bookingsapi,node_bookinglogic,node_calendar,node_email,node_reminders,node_campaigns,node_sms toneMint
class node_memberdata,node_clientlogic,node_auth,node_session,node_users toneRose
class node_customer,node_staff,node_twilio,node_resend toneIndigo
```

## Components

### Customer Loyalty

- [Join Page](https://github.com/starrlikeringo22/vipclub/blob/main/app/join/%5BbusinessId%5D/page.tsx): `app/join/[businessId]/page.tsx`
- [Signup API](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/signup/route.ts): `app/api/signup/route.ts`
- [VIP Pass](https://github.com/starrlikeringo22/vipclub/blob/main/app/pass/%5BcustomerId%5D/page.tsx): `app/pass/[customerId]/page.tsx`
- [Staff Check-in](https://github.com/starrlikeringo22/vipclub/blob/main/app/checkin/%5BcustomerId%5D/CheckinClient.tsx): `app/checkin/[customerId]/CheckinClient.tsx`
- [Visit API](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/customers/%5Bid%5D/visit/route.ts): `app/api/customers/[id]/visit/route.ts`

### Shop Operations

- [Owner Workspace](https://github.com/starrlikeringo22/vipclub/blob/main/app/owner/OwnerApp.tsx): `app/owner/OwnerApp.tsx`
- [Client Profile](https://github.com/starrlikeringo22/vipclub/blob/main/app/owner/client/%5Bid%5D/ClientProfile.tsx): `app/owner/client/[id]/ClientProfile.tsx`
- [Business Settings](https://github.com/starrlikeringo22/vipclub/blob/main/app/owner/settings/SettingsClient.tsx): `app/owner/settings/SettingsClient.tsx`
- [Admin Analytics](https://github.com/starrlikeringo22/vipclub/blob/main/app/admin/page.tsx): `app/admin/page.tsx`

### Messaging and Scheduling

- [Booking API](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/bookings/route.ts): `app/api/bookings/route.ts`
- [Booking Actions](https://github.com/starrlikeringo22/vipclub/blob/main/lib/booking-actions.ts): `lib/booking-actions.ts`
- [Calendar Assets](https://github.com/starrlikeringo22/vipclub/blob/main/lib/calendar.ts): `lib/calendar.ts`
- [Email Delivery](https://github.com/starrlikeringo22/vipclub/blob/main/lib/email.ts): `lib/email.ts`
- [Reminder Runner](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/reminders/run/route.ts): `app/api/reminders/run/route.ts`
- [Campaigns API](https://github.com/starrlikeringo22/vipclub/blob/main/app/api/campaigns/route.ts): `app/api/campaigns/route.ts`
- [SMS Service](https://github.com/starrlikeringo22/vipclub/blob/main/lib/sms.ts): `lib/sms.ts`

### Platform Services

- [Member Data](https://github.com/starrlikeringo22/vipclub/blob/main/lib/db.ts): `lib/db.ts`
- [Client Management](https://github.com/starrlikeringo22/vipclub/blob/main/lib/clients.ts): `lib/clients.ts`
- [Authentication](https://github.com/starrlikeringo22/vipclub/blob/main/lib/auth.ts): `lib/auth.ts`
- [Session Guards](https://github.com/starrlikeringo22/vipclub/blob/main/lib/session.ts): `lib/session.ts`
- [User Accounts](https://github.com/starrlikeringo22/vipclub/blob/main/lib/users.ts): `lib/users.ts`

### Other components

- **Customer**
- **Staff**
- **Supabase**
- **Twilio**
- **Resend**

## Connections

- Customer → Join Page: opens
- Join Page → Signup API: submits signup
- Signup API → Member Data: creates member (evidence: `app/api/signup/route.ts`)
- Signup API → Client Management: checks referral (evidence: `app/api/signup/route.ts`)
- Signup API → SMS Service: sends welcome (evidence: `app/api/signup/route.ts`)
- Member Data → VIP Pass: loads member (evidence: `app/pass/[customerId]/page.tsx`)
- Customer → VIP Pass: views pass
- Staff → Staff Check-in: scans pass
- Staff Check-in → Visit API: records visit (evidence: `app/checkin/[customerId]/CheckinClient.tsx`)
- Visit API → Member Data: updates rewards
- Owner Workspace → Booking API: manages bookings
- Booking API → Booking Actions: creates booking (evidence: `app/api/bookings/route.ts`)
- Booking API → Member Data: loads business data (evidence: `app/api/bookings/route.ts`)
- Booking API → Calendar Assets: builds calendar links (evidence: `app/api/bookings/route.ts`)
- Booking API → Email Delivery: sends invite (evidence: `app/api/bookings/route.ts`)
- Email Delivery → Resend: delivers email
- Owner Workspace → Client Profile: manages clients
- Owner Workspace → Business Settings: configures shop
- Reminder Runner → Client Management: finds due members (evidence: `app/api/reminders/run/route.ts`)
- Reminder Runner → SMS Service: sends reminders (evidence: `app/api/reminders/run/route.ts`)
- Campaigns API → SMS Service: sends campaign (evidence: `app/api/campaigns/route.ts`)
- SMS Service → Twilio: delivers texts
- Admin Analytics → Member Data: reports metrics
- Session Guards → Authentication: verifies session (evidence: `lib/session.ts`)
- User Accounts → Authentication: checks passwords (evidence: `lib/users.ts`)
- Booking API → Session Guards: checks role (evidence: `app/api/bookings/route.ts`)
- Member Data → Supabase: persists records
