Docs

11. Database Design Overview

11.1 Core Entities (Conceptual)

EntityPurpose
usersId, email, password_hash, role (customer
providersUser id, business_name, slug, description, address, profile_image_url, stripe_account_id, default_slot_minutes, buffer_minutes, created_at, updated_at.
servicesProvider id, name, duration_minutes, price_cents (nullable), sort_order.
business_hoursProvider id, day_of_week (0–6), open_time, close_time.
special_datesProvider id, date, is_available (false = time off).
appointmentsProvider id, customer (user) id, service id, slot start/end (or date + time), status, payment_method (cash
reviewsAppointment id, user id (customer), rating (1–5), comment (nullable), created_at.
refresh_tokens (optional)Token hash, user id, expires_at, for revocation.

11.2 Migrations

  • Use Alembic for all schema changes.
  • One migration per logical change; never edit applied migrations.