# sgrappelli/pronto architecture

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

- Interactive diagram: https://gitdiagram.com/sgrappelli/pronto
- Repository: https://github.com/sgrappelli/pronto

## Overview

Pronto is a self-hosted/cloud business-management app for service businesses and retail. A client books through a public business page; the booking form submits to a server endpoint that validates availability and writes appointment/client data. Authenticated staff then manage bookings, clients, sales, inventory, and settings in the dashboard. The README documents offline POS, imports/exports, modular features, analytics, and notification channels. Some dashboard and integration internals were not sampled, so those documented capabilities are shown without speculative implementation-level links.

Main entry points: [`app/api/email/confirm/route.ts`](https://github.com/sgrappelli/pronto/blob/main/app/api/email/confirm/route.ts) (Booking notifications), [`app/api/cron/notify/route.ts`](https://github.com/sgrappelli/pronto/blob/main/app/api/cron/notify/route.ts) (Scheduled notifications), [`app/api/book/route.ts`](https://github.com/sgrappelli/pronto/blob/main/app/api/book/route.ts) (Booking submission), [`app/(auth)/login/actions.ts`](https://github.com/sgrappelli/pronto/blob/main/app/(auth)/login/actions.ts) (Sign-in & registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_booking["Booking"]
  node_public_booking["Booking page<br/>[page.tsx]"]
  node_booking_form["Booking form<br/>[booking-form.tsx]"]
  node_availability["Slot availability"]
  node_booking_api["Booking submission<br/>[route.ts]"]
  node_calendar["Booking calendar"]
end

subgraph group_operations["Business Operations"]
  node_crm["Client records"]
  node_pos["POS &amp; sales<br/>[pos-terminal.tsx]"]
  node_inventory["Inventory<br/>[inventory-list.tsx]"]
  node_dashboard["Revenue dashboard<br/>[page.tsx]"]
  node_settings["Business settings<br/>[settings-tabs.tsx]"]
end

subgraph group_platform["Accounts &amp; Platform"]
  node_auth["Sign-in &amp; registration<br/>[actions.ts]"]
  node_business_setup["Business setup<br/>[create-business.ts]"]
  node_onboarding["Onboarding"]
  node_data_access["Supabase access<br/>[service.ts]"]
end

subgraph group_messaging["Notifications"]
  node_booking_events["Booking notifications<br/>[route.ts]"]
  node_scheduled_events["Scheduled notifications<br/>[route.ts]"]
  node_email["Email delivery<br/>[email.ts]"]
  node_telegram["Telegram delivery<br/>[telegram.ts]"]
  node_viber["Viber delivery<br/>[viber.ts]"]
  node_whatsapp["WhatsApp delivery<br/>[whatsapp.ts]"]
end

node_client(("Client"))
node_staff(("Business staff"))
node_supabase[("Supabase")]
node_message_services{{"Messaging services"}}

node_client -->|"opens page"| node_public_booking
node_public_booking -->|"renders"| node_booking_form
node_booking_form -->|"submits booking"| node_booking_api
node_booking_api -->|"checks slot"| node_availability
node_booking_api -->|"reads and writes"| node_data_access
node_data_access -->|"accesses data"| node_supabase
node_staff -->|"signs in"| node_auth
node_auth -->|"creates business"| node_business_setup
node_auth -->|"routes new account"| node_onboarding
node_onboarding -->|"configures business"| node_business_setup
node_staff -->|"manages bookings"| node_calendar
node_staff -->|"manages clients"| node_crm
node_staff -->|"checks out sales"| node_pos
node_staff -->|"manages stock"| node_inventory
node_staff -->|"reviews revenue"| node_dashboard
node_staff -->|"configures modules"| node_settings
node_booking_events -->|"sends confirmation"| node_email
node_booking_events -->|"sends confirmation"| node_telegram
node_booking_events -->|"sends confirmation"| node_viber
node_booking_events -->|"sends confirmation"| node_whatsapp
node_scheduled_events -->|"sends reminders"| node_email
node_scheduled_events -->|"sends reminders"| node_telegram
node_scheduled_events -->|"sends reminders"| node_viber
node_email -->|"delivers email"| node_message_services
node_telegram -->|"delivers messages"| node_message_services
node_viber -->|"delivers messages"| node_message_services
node_whatsapp -->|"delivers messages"| node_message_services

click node_public_booking "https://github.com/sgrappelli/pronto/blob/main/app/book/%5Bslug%5D/page.tsx"
click node_booking_form "https://github.com/sgrappelli/pronto/blob/main/app/book/%5Bslug%5D/booking-form.tsx"
click node_availability "https://github.com/sgrappelli/pronto/blob/main/lib/booking-availability.ts"
click node_booking_api "https://github.com/sgrappelli/pronto/blob/main/app/api/book/route.ts"
click node_calendar "https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/booking/booking-calendar.tsx"
click node_auth "https://github.com/sgrappelli/pronto/blob/main/app/(auth)/login/actions.ts"
click node_business_setup "https://github.com/sgrappelli/pronto/blob/main/lib/create-business.ts"
click node_onboarding "https://github.com/sgrappelli/pronto/blob/main/app/onboarding/OnboardingWizard.tsx"
click node_data_access "https://github.com/sgrappelli/pronto/blob/main/lib/supabase/service.ts"
click node_crm "https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/crm/%5Bid%5D/client-detail-view.tsx"
click node_pos "https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/pos/pos-terminal.tsx"
click node_inventory "https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/inventory/inventory-list.tsx"
click node_dashboard "https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/dashboard/page.tsx"
click node_settings "https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/settings/settings-tabs.tsx"
click node_booking_events "https://github.com/sgrappelli/pronto/blob/main/app/api/email/confirm/route.ts"
click node_scheduled_events "https://github.com/sgrappelli/pronto/blob/main/app/api/cron/notify/route.ts"
click node_email "https://github.com/sgrappelli/pronto/blob/main/lib/email.ts"
click node_telegram "https://github.com/sgrappelli/pronto/blob/main/lib/telegram.ts"
click node_viber "https://github.com/sgrappelli/pronto/blob/main/lib/viber.ts"
click node_whatsapp "https://github.com/sgrappelli/pronto/blob/main/lib/whatsapp.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_public_booking,node_booking_form,node_availability,node_booking_api,node_calendar,node_client toneBlue
class node_crm,node_pos,node_inventory,node_dashboard,node_settings,node_supabase toneAmber
class node_auth,node_business_setup,node_onboarding,node_data_access toneMint
class node_booking_events,node_scheduled_events,node_email,node_telegram,node_viber,node_whatsapp toneRose
class node_staff,node_message_services toneIndigo
```

## Components

### Booking

- [Booking page](https://github.com/sgrappelli/pronto/blob/main/app/book/%5Bslug%5D/page.tsx): `app/book/[slug]/page.tsx`
- [Booking form](https://github.com/sgrappelli/pronto/blob/main/app/book/%5Bslug%5D/booking-form.tsx): `app/book/[slug]/booking-form.tsx`
- [Slot availability](https://github.com/sgrappelli/pronto/blob/main/lib/booking-availability.ts): `lib/booking-availability.ts`
- [Booking submission](https://github.com/sgrappelli/pronto/blob/main/app/api/book/route.ts): `app/api/book/route.ts`
- [Booking calendar](https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/booking/booking-calendar.tsx): `app/(dashboard)/booking/booking-calendar.tsx`

### Business Operations

- [Client records](https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/crm/%5Bid%5D/client-detail-view.tsx): `app/(dashboard)/crm/[id]/client-detail-view.tsx`
- [POS & sales](https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/pos/pos-terminal.tsx): `app/(dashboard)/pos/pos-terminal.tsx`
- [Inventory](https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/inventory/inventory-list.tsx): `app/(dashboard)/inventory/inventory-list.tsx`
- [Revenue dashboard](https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/dashboard/page.tsx): `app/(dashboard)/dashboard/page.tsx`
- [Business settings](https://github.com/sgrappelli/pronto/blob/main/app/(dashboard)/settings/settings-tabs.tsx): `app/(dashboard)/settings/settings-tabs.tsx`

### Accounts & Platform

- [Sign-in & registration](https://github.com/sgrappelli/pronto/blob/main/app/(auth)/login/actions.ts): `app/(auth)/login/actions.ts`
- [Business setup](https://github.com/sgrappelli/pronto/blob/main/lib/create-business.ts): `lib/create-business.ts`
- [Onboarding](https://github.com/sgrappelli/pronto/blob/main/app/onboarding/OnboardingWizard.tsx): `app/onboarding/OnboardingWizard.tsx`
- [Supabase access](https://github.com/sgrappelli/pronto/blob/main/lib/supabase/service.ts): `lib/supabase/service.ts`

### Notifications

- [Booking notifications](https://github.com/sgrappelli/pronto/blob/main/app/api/email/confirm/route.ts): `app/api/email/confirm/route.ts`
- [Scheduled notifications](https://github.com/sgrappelli/pronto/blob/main/app/api/cron/notify/route.ts): `app/api/cron/notify/route.ts`
- [Email delivery](https://github.com/sgrappelli/pronto/blob/main/lib/email.ts): `lib/email.ts`
- [Telegram delivery](https://github.com/sgrappelli/pronto/blob/main/lib/telegram.ts): `lib/telegram.ts`
- [Viber delivery](https://github.com/sgrappelli/pronto/blob/main/lib/viber.ts): `lib/viber.ts`
- [WhatsApp delivery](https://github.com/sgrappelli/pronto/blob/main/lib/whatsapp.ts): `lib/whatsapp.ts`

### Other components

- **Client**
- **Business staff**
- **Supabase**
- **Messaging services**

## Connections

- Client → Booking page: opens page
- Booking page → Booking form: renders (evidence: `app/book/[slug]/page.tsx`)
- Booking form → Booking submission: submits booking (evidence: `app/book/[slug]/booking-form.tsx`)
- Booking submission → Slot availability: checks slot (evidence: `app/api/book/route.ts`)
- Booking submission → Supabase access: reads and writes (evidence: `app/api/book/route.ts`)
- Supabase access → Supabase: accesses data
- Business staff → Sign-in & registration: signs in
- Sign-in & registration → Business setup: creates business
- Sign-in & registration → Onboarding: routes new account
- Onboarding → Business setup: configures business
- Business staff → Booking calendar: manages bookings
- Business staff → Client records: manages clients
- Business staff → POS & sales: checks out sales
- Business staff → Inventory: manages stock
- Business staff → Revenue dashboard: reviews revenue
- Business staff → Business settings: configures modules
- Booking notifications → Email delivery: sends confirmation (evidence: `app/api/email/confirm/route.ts`)
- Booking notifications → Telegram delivery: sends confirmation (evidence: `app/api/email/confirm/route.ts`)
- Booking notifications → Viber delivery: sends confirmation (evidence: `app/api/email/confirm/route.ts`)
- Booking notifications → WhatsApp delivery: sends confirmation (evidence: `app/api/email/confirm/route.ts`)
- Scheduled notifications → Email delivery: sends reminders (evidence: `app/api/cron/notify/route.ts`)
- Scheduled notifications → Telegram delivery: sends reminders (evidence: `app/api/cron/notify/route.ts`)
- Scheduled notifications → Viber delivery: sends reminders (evidence: `app/api/cron/notify/route.ts`)
- Email delivery → Messaging services: delivers email
- Telegram delivery → Messaging services: delivers messages (evidence: `lib/telegram.ts`)
- Viber delivery → Messaging services: delivers messages (evidence: `lib/viber.ts`)
- WhatsApp delivery → Messaging services: delivers messages
