# odd-shoes-dev/salon-system architecture

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

- Interactive diagram: https://gitdiagram.com/odd-shoes-dev/salon-system
- Repository: https://github.com/odd-shoes-dev/salon-system

## Overview

This is a multi-tenant salon management web app. Salon staff use its tablet-oriented interface to manage clients, bookings, services, and sales; a POS sale is recorded as a visit, updates account and client-related state, and can trigger receipt messaging. The graph also preserves the README’s major operational areas. Sampled source verifies the visit handler’s calls to authentication, account resolution, database access, and messaging; several other links are dashed because their runtime wiring was not sampled.

Main entry points: [`src/app/api/visits/route.ts`](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/visits/route.ts) (Sales and visits), [`src/lib/db/index.ts`](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/db/index.ts) (Neon database), [`src/lib/sms/index.ts`](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/sms/index.ts) (SMS provider routing), [`src/app/api/clients/route.ts`](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/clients/route.ts) (Clients and referrals)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Salon interface"]
  node_pos["Point of sale<br/>[page.tsx]"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_clients_ui["Client management<br/>[page.tsx]"]
  node_bookings_ui["Bookings<br/>[page.tsx]"]
  node_inventory_ui["Inventory<br/>[page.tsx]"]
  node_reports_ui["Reports<br/>[page.tsx]"]
  node_shell["App navigation<br/>[NavSidebar.tsx]"]
end

subgraph group_operations["Salon operations"]
  node_visits_api["Sales and visits<br/>[route.ts]"]
  node_clients_api["Clients and referrals<br/>[route.ts]"]
  node_bookings_api["Booking services<br/>[route.ts]"]
  node_service_catalog["Services and categories<br/>[route.ts]"]
  node_workers["Workers and staff<br/>[route.ts]"]
  node_inventory_api["Stock and purchasing"]
  node_loyalty["Loyalty and coupons<br/>[route.ts]"]
end

subgraph group_finance["Finance and insights"]
  node_finance_api["Accounts and expenses<br/>[route.ts]"]
  node_expense_api["Expense management<br/>[route.ts]"]
  node_reports_api["Analytics and reports<br/>[route.ts]"]
  node_account_helpers["Account operations<br/>[accounts.ts]"]
end

subgraph group_platform["Platform services"]
  node_auth["Sessions and permissions<br/>[auth.ts]"]
  node_tenant["Tenant routing<br/>[middleware.ts]"]
  node_db[("Neon database<br/>[index.ts]")]
  node_imagekit["ImageKit storage<br/>[imagekit.ts]"]
end

subgraph group_messaging["Messaging"]
  node_sms_api["SMS campaigns"]
  node_sms_dispatch["SMS provider routing<br/>[index.ts]"]
  node_sms_providers["SMS gateways"]
  node_whatsapp["WhatsApp receipts<br/>[whatsapp.ts]"]
end

node_operator(("Salon staff"))

node_operator -.->|"records sale"| node_pos
node_operator -.->|"views activity"| node_dashboard
node_operator -.->|"manages clients"| node_clients_ui
node_operator -.->|"manages bookings"| node_bookings_ui
node_operator -.->|"manages stock"| node_inventory_ui
node_operator -.->|"reviews reports"| node_reports_ui
node_pos -.->|"submits sale"| node_visits_api
node_clients_ui -.->|"manages clients"| node_clients_api
node_bookings_ui -.->|"manages bookings"| node_bookings_api
node_inventory_ui -.->|"manages stock"| node_inventory_api
node_reports_ui -.->|"requests reports"| node_reports_api
node_shell -.->|"navigates"| node_dashboard
node_visits_api -->|"authenticates"| node_auth
node_visits_api -->|"reads and writes"| node_db
node_visits_api -->|"resolves inflow"| node_account_helpers
node_visits_api -->|"sends receipt"| node_sms_dispatch
node_visits_api -->|"builds receipt"| node_whatsapp
node_clients_api -->|"authenticates"| node_auth
node_clients_api -->|"reads and writes"| node_db
node_clients_api -->|"sends referral"| node_sms_dispatch
node_bookings_api -->|"authenticates"| node_auth
node_bookings_api -->|"reads and writes"| node_db
node_bookings_api -->|"sends messages"| node_sms_dispatch
node_expense_api -->|"checks balance"| node_account_helpers
node_account_helpers -->|"queries accounts"| node_db
node_reports_api -->|"authenticates"| node_auth
node_reports_api -->|"queries reports"| node_db
node_sms_api -.->|"uses provider"| node_sms_dispatch
node_sms_dispatch -->|"dispatches messages"| node_sms_providers
node_tenant -.->|"resolves tenant"| node_db
node_operator -.->|"manages services"| node_service_catalog
node_operator -.->|"manages workforce"| node_workers
node_operator -.->|"manages rewards"| node_loyalty
node_operator -.->|"manages accounts"| node_finance_api
node_operator -.->|"records expenses"| node_expense_api
node_operator -.->|"runs campaigns"| node_sms_api
node_operator -.->|"uploads branding"| node_imagekit

click node_pos "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/pos/page.tsx"
click node_dashboard "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/dashboard/page.tsx"
click node_clients_ui "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/clients/page.tsx"
click node_bookings_ui "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/bookings/page.tsx"
click node_inventory_ui "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/inventory/page.tsx"
click node_reports_ui "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/reports/page.tsx"
click node_shell "https://github.com/odd-shoes-dev/salon-system/blob/master/src/components/NavSidebar.tsx"
click node_visits_api "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/visits/route.ts"
click node_clients_api "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/clients/route.ts"
click node_bookings_api "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/bookings/route.ts"
click node_service_catalog "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/services/route.ts"
click node_workers "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/workers/route.ts"
click node_inventory_api "https://github.com/odd-shoes-dev/salon-system/tree/master/src/app/api/inventory"
click node_loyalty "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/loyalty/tiers/route.ts"
click node_finance_api "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/accounts/route.ts"
click node_expense_api "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/expenses/route.ts"
click node_reports_api "https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/reports/route.ts"
click node_auth "https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/auth.ts"
click node_tenant "https://github.com/odd-shoes-dev/salon-system/blob/master/src/middleware.ts"
click node_db "https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/db/index.ts"
click node_account_helpers "https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/accounts.ts"
click node_sms_api "https://github.com/odd-shoes-dev/salon-system/tree/master/src/app/api/sms"
click node_sms_dispatch "https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/sms/index.ts"
click node_sms_providers "https://github.com/odd-shoes-dev/salon-system/tree/master/src/lib/sms/providers"
click node_whatsapp "https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/whatsapp.ts"
click node_imagekit "https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/imagekit.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_pos,node_dashboard,node_clients_ui,node_bookings_ui,node_inventory_ui,node_reports_ui,node_shell toneBlue
class node_visits_api,node_clients_api,node_bookings_api,node_service_catalog,node_workers,node_inventory_api,node_loyalty toneAmber
class node_finance_api,node_expense_api,node_reports_api,node_account_helpers toneMint
class node_auth,node_tenant,node_db,node_imagekit toneRose
class node_sms_api,node_sms_dispatch,node_sms_providers,node_whatsapp,node_operator toneIndigo
```

## Components

### Salon interface

- [Point of sale](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/pos/page.tsx): `src/app/pos/page.tsx`
- [Dashboard](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Client management](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/clients/page.tsx): `src/app/clients/page.tsx`
- [Bookings](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/bookings/page.tsx): `src/app/bookings/page.tsx`
- [Inventory](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/inventory/page.tsx): `src/app/inventory/page.tsx`
- [Reports](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/reports/page.tsx): `src/app/reports/page.tsx`
- [App navigation](https://github.com/odd-shoes-dev/salon-system/blob/master/src/components/NavSidebar.tsx): `src/components/NavSidebar.tsx`

### Salon operations

- [Sales and visits](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/visits/route.ts): `src/app/api/visits/route.ts`
- [Clients and referrals](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/clients/route.ts): `src/app/api/clients/route.ts`
- [Booking services](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/bookings/route.ts): `src/app/api/bookings/route.ts`
- [Services and categories](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/services/route.ts): `src/app/api/services/route.ts`
- [Workers and staff](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/workers/route.ts): `src/app/api/workers/route.ts`
- [Stock and purchasing](https://github.com/odd-shoes-dev/salon-system/tree/master/src/app/api/inventory): `src/app/api/inventory`
- [Loyalty and coupons](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/loyalty/tiers/route.ts): `src/app/api/loyalty/tiers/route.ts`

### Finance and insights

- [Accounts and expenses](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/accounts/route.ts): `src/app/api/accounts/route.ts`
- [Expense management](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/expenses/route.ts): `src/app/api/expenses/route.ts`
- [Analytics and reports](https://github.com/odd-shoes-dev/salon-system/blob/master/src/app/api/reports/route.ts): `src/app/api/reports/route.ts`
- [Account operations](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/accounts.ts): `src/lib/accounts.ts`

### Platform services

- [Sessions and permissions](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/auth.ts): `src/lib/auth.ts`
- [Tenant routing](https://github.com/odd-shoes-dev/salon-system/blob/master/src/middleware.ts): `src/middleware.ts`
- [Neon database](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/db/index.ts): `src/lib/db/index.ts`
- [ImageKit storage](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/imagekit.ts): `src/lib/imagekit.ts`

### Messaging

- [SMS campaigns](https://github.com/odd-shoes-dev/salon-system/tree/master/src/app/api/sms): `src/app/api/sms`
- [SMS provider routing](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/sms/index.ts): `src/lib/sms/index.ts`
- [SMS gateways](https://github.com/odd-shoes-dev/salon-system/tree/master/src/lib/sms/providers): `src/lib/sms/providers`
- [WhatsApp receipts](https://github.com/odd-shoes-dev/salon-system/blob/master/src/lib/whatsapp.ts): `src/lib/whatsapp.ts`

### Other components

- **Salon staff**

## Connections

- Salon staff → Point of sale: records sale
- Salon staff → Dashboard: views activity
- Salon staff → Client management: manages clients
- Salon staff → Bookings: manages bookings
- Salon staff → Inventory: manages stock
- Salon staff → Reports: reviews reports
- Point of sale → Sales and visits: submits sale
- Client management → Clients and referrals: manages clients
- Bookings → Booking services: manages bookings
- Inventory → Stock and purchasing: manages stock
- Reports → Analytics and reports: requests reports
- App navigation → Dashboard: navigates
- Sales and visits → Sessions and permissions: authenticates (evidence: `src/app/api/visits/route.ts`)
- Sales and visits → Neon database: reads and writes (evidence: `src/app/api/visits/route.ts`)
- Sales and visits → Account operations: resolves inflow (evidence: `src/app/api/visits/route.ts`)
- Sales and visits → SMS provider routing: sends receipt (evidence: `src/app/api/visits/route.ts`)
- Sales and visits → WhatsApp receipts: builds receipt (evidence: `src/app/api/visits/route.ts`)
- Clients and referrals → Sessions and permissions: authenticates (evidence: `src/app/api/clients/route.ts`)
- Clients and referrals → Neon database: reads and writes (evidence: `src/app/api/clients/route.ts`)
- Clients and referrals → SMS provider routing: sends referral (evidence: `src/app/api/clients/route.ts`)
- Booking services → Sessions and permissions: authenticates (evidence: `src/app/api/bookings/route.ts`)
- Booking services → Neon database: reads and writes (evidence: `src/app/api/bookings/route.ts`)
- Booking services → SMS provider routing: sends messages (evidence: `src/app/api/bookings/route.ts`)
- Expense management → Account operations: checks balance (evidence: `src/app/api/expenses/route.ts`)
- Account operations → Neon database: queries accounts (evidence: `src/lib/accounts.ts`)
- Analytics and reports → Sessions and permissions: authenticates (evidence: `src/app/api/reports/route.ts`)
- Analytics and reports → Neon database: queries reports (evidence: `src/app/api/reports/route.ts`)
- SMS campaigns → SMS provider routing: uses provider
- SMS provider routing → SMS gateways: dispatches messages (evidence: `src/lib/sms/index.ts`)
- Tenant routing → Neon database: resolves tenant
- Salon staff → Services and categories: manages services
- Salon staff → Workers and staff: manages workforce
- Salon staff → Loyalty and coupons: manages rewards
- Salon staff → Accounts and expenses: manages accounts
- Salon staff → Expense management: records expenses
- Salon staff → SMS campaigns: runs campaigns
- Salon staff → ImageKit storage: uploads branding
