# joshricaballes2007-create/bright-smile architecture

> Architecture diagram of the GitHub repository joshricaballes2007-create/bright-smile, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joshricaballes2007-create/bright-smile
- Repository: https://github.com/joshricaballes2007-create/bright-smile

## Overview

Bright Smile is a dental clinic information and appointment website. Visitors browse clinic pages, choose a service and time, and submit booking details; the server validates requests and, in live mode, schedules through Cal.com and records data with Supabase. The site also supports contact messages, patient accounts and history, and an admin page. The graph preserves the documented prototype separately. Some route and database details are not shown in the excerpts, so those links are included only where the README or sampled source supports them.

Main entry points: [`app.py`](https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py) (Booking workflow), [`static/booking.js`](https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/booking.js) (Booking calendar), [`static/main.js`](https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/main.js) (Contact form), [`supabase-setup.sql`](https://github.com/joshricaballes2007-create/bright-smile/blob/main/supabase-setup.sql) (Database setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Website experience"]
  node_home["Clinic pages<br/>[home.html]"]
  node_shared["Shared layout<br/>[base.html]"]
  node_services_page["Services page<br/>[services.html]"]
  node_booking_ui["Booking calendar<br/>[booking.js]"]
  node_account_page["Patient account<br/>[account.html]"]
  node_admin_page["Admin page<br/>[admin.html]"]
  node_contact_ui["Contact form<br/>[main.js]"]
  node_styles["Responsive styling<br/>[style.css]"]
end

subgraph group_server["Server workflows"]
  node_server_app["FastAPI server<br/>[app.py]"]
  node_booking_api["Booking workflow<br/>[app.py]"]
  node_account_workflow["Accounts and history<br/>[app.py]"]
  node_contact_api["Contact handling<br/>[app.py]"]
end

subgraph group_services["External services"]
  node_db_schema["Database setup<br/>[supabase-setup.sql]"]
  node_supabase[("Supabase")]
  node_calcom["Cal.com"]
end

subgraph group_prototype["Legacy prototype"]
  node_legacy_app["Original prototype<br/>[script-1.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"browses"| node_home
node_visitor -->|"chooses appointment"| node_booking_ui
node_visitor -->|"uses account"| node_account_page
node_visitor -->|"administers clinic"| node_admin_page
node_visitor -->|"sends message"| node_contact_ui
node_server_app -->|"renders pages"| node_shared
node_booking_ui -->|"requests slots"| node_booking_api
node_booking_ui -->|"submits booking"| node_booking_api
node_contact_ui -->|"posts message"| node_contact_api
node_booking_api -->|"checks and books"| node_calcom
node_booking_api -->|"stores history"| node_supabase
node_account_workflow -->|"verifies and reads"| node_supabase
node_contact_api -->|"saves message"| node_supabase
node_db_schema -.->|"defines tables"| node_supabase

click node_home "https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/home.html"
click node_shared "https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/base.html"
click node_services_page "https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/services.html"
click node_booking_ui "https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/booking.js"
click node_account_page "https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/account.html"
click node_admin_page "https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/admin.html"
click node_contact_ui "https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/main.js"
click node_styles "https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/style.css"
click node_server_app "https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py"
click node_booking_api "https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py"
click node_account_workflow "https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py"
click node_contact_api "https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py"
click node_db_schema "https://github.com/joshricaballes2007-create/bright-smile/blob/main/supabase-setup.sql"
click node_legacy_app "https://github.com/joshricaballes2007-create/bright-smile/blob/main/legacy/script-1.js"

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_home,node_shared,node_services_page,node_booking_ui,node_account_page,node_admin_page,node_contact_ui,node_styles toneBlue
class node_server_app,node_booking_api,node_account_workflow,node_contact_api toneAmber
class node_db_schema,node_supabase,node_calcom toneMint
class node_legacy_app toneRose
class node_visitor toneIndigo
```

## Components

### Website experience

- [Clinic pages](https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/home.html): `templates/home.html`
- [Shared layout](https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/base.html): `templates/base.html`
- [Services page](https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/services.html): `templates/services.html`
- [Booking calendar](https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/booking.js): `static/booking.js`
- [Patient account](https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/account.html): `templates/account.html`
- [Admin page](https://github.com/joshricaballes2007-create/bright-smile/blob/main/templates/admin.html): `templates/admin.html`
- [Contact form](https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/main.js): `static/main.js`
- [Responsive styling](https://github.com/joshricaballes2007-create/bright-smile/blob/main/static/style.css): `static/style.css`

### Server workflows

- [FastAPI server](https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py): `app.py`
- [Booking workflow](https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py): `app.py`
- [Accounts and history](https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py): `app.py`
- [Contact handling](https://github.com/joshricaballes2007-create/bright-smile/blob/main/app.py): `app.py`

### External services

- [Database setup](https://github.com/joshricaballes2007-create/bright-smile/blob/main/supabase-setup.sql): `supabase-setup.sql`
- **Supabase**
- **Cal.com**

### Legacy prototype

- [Original prototype](https://github.com/joshricaballes2007-create/bright-smile/blob/main/legacy/script-1.js): `legacy/script-1.js`

### Other components

- **Visitor**

## Connections

- Visitor → Clinic pages: browses (evidence: `README.md`)
- Visitor → Booking calendar: chooses appointment (evidence: `README.md`)
- Visitor → Patient account: uses account (evidence: `README.md`)
- Visitor → Admin page: administers clinic (evidence: `README.md`)
- Visitor → Contact form: sends message (evidence: `README.md`)
- FastAPI server → Shared layout: renders pages (evidence: `app.py`)
- Booking calendar → Booking workflow: requests slots (evidence: `static/booking.js`)
- Booking calendar → Booking workflow: submits booking (evidence: `static/booking.js`)
- Contact form → Contact handling: posts message (evidence: `static/main.js`)
- Booking workflow → Cal.com: checks and books (evidence: `app.py`)
- Booking workflow → Supabase: stores history (evidence: `README.md`)
- Accounts and history → Supabase: verifies and reads (evidence: `app.py`)
- Contact handling → Supabase: saves message
- Database setup → Supabase: defines tables (evidence: `README.md`)
