How obraga45/appointment_system works
TemVagas serves small businesses with public appointment booking, an owner dashboard for managing services and appointments, and WhatsApp confirmations and reminders. The main customer flow starts at a business booking page; the owner manages the resulting schedule from the app. The README documents optional deposits, client cancellation, and WhatsApp connection, while sampled server actions show service management and authentication using Prisma and optional Supabase Auth. Several booking, settings, and messaging implementations were not sampled, so their internal call relationships are not expanded.
Main entry points: appointments.ts Appointment actions · reminders.ts Reminder dispatch · booking-wizard.tsx Booking wizard · auth.ts Account actions
Components 28
Public booking
- Booking page
components/public-booking-page.tsx - Booking wizard
components/booking-wizard.tsx - Cancel booking
app/agendar/cancel/[token]/page.tsx - Cancellation form
components/cancel-booking-form.tsx
Owner workspace
- Dashboard
app/(app)/dashboard/page.tsx - Appointments
app/(app)/appointments/page.tsx - Manual booking
components/new-appointment-form.tsx - Services page
app/(app)/services/page.tsx - Service manager
components/services-manager.tsx - Settings page
app/(app)/settings/page.tsx - Business settings
components/settings-forms.tsx
Booking operations
- Appointment actions
actions/appointments.ts - Service actions
actions/services.ts - Availability rules
lib/availability.ts - Message cancellation
lib/whatsapp-cancel.ts
WhatsApp messaging
- Reminder dispatch
lib/reminders.ts - QStash endpoint
app/api/qstash/reminders/route.ts - Cron endpoint
app/api/cron/reminders/route.ts - Notifications
lib/notifications.ts - WhatsApp provider
lib/evolution.ts - WhatsApp webhook
app/api/webhooks/evolution/route.ts
Identity and data
- PostgreSQL
- Account actions
actions/auth.ts - User authentication
lib/auth.ts - Supabase Auth
Other components
- Customer
- Business owner
- Business WhatsApp
Connections 32
- Customer → Booking page: opens booking
- Booking page → Booking wizard: presents booking
- Customer → Booking wizard: books appointment
- Customer → Cancel booking: opens cancel link
- Cancel booking → Cancellation form: renders form
app/agendar/cancel/[token]/page.tsx - Customer → Cancellation form: cancels booking
- Business owner → Dashboard: views schedule
- Business owner → Appointments: manages appointments
- Business owner → Manual booking: creates appointment
- Business owner → Services page: manages services
- Services page → Service manager: renders manager
app/(app)/services/page.tsx - Service manager → Service actions: calls service actions
components/services-manager.tsx - Service actions → PostgreSQL: reads and writes
actions/services.ts - Business owner → Settings page: configures business
- Settings page → Business settings: renders settings
app/(app)/settings/page.tsx - Business owner → Appointment actions: updates appointments
- Appointment actions → PostgreSQL: stores appointments
- Booking wizard → Appointment actions: submits booking
- Appointment actions → Availability rules: checks availability
- Account actions → PostgreSQL: reads and writes
actions/auth.ts - Account actions → Supabase Auth: uses when configured
actions/auth.ts - User authentication → PostgreSQL: loads user profile
lib/auth.ts - User authentication → Supabase Auth: checks session when configured
lib/auth.ts - QStash endpoint → Reminder dispatch: dispatches reminders
app/api/qstash/reminders/route.ts - Cron endpoint → Reminder dispatch: dispatches reminders
app/api/cron/reminders/route.ts - Reminder dispatch → PostgreSQL: reads appointments
lib/reminders.ts - Reminder dispatch → Notifications: sends notices
lib/reminders.ts - Notifications → WhatsApp provider: sends messages
- WhatsApp provider → Business WhatsApp: delivers WhatsApp
- Business WhatsApp → WhatsApp webhook: posts events
- WhatsApp webhook → Message cancellation: handles cancellation
app/api/webhooks/evolution/route.ts - Message cancellation → Appointment actions: cancels next visit