# amandubey923/dentiva-ai architecture

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

- Interactive diagram: https://gitdiagram.com/amandubey923/dentiva-ai
- Repository: https://github.com/amandubey923/dentiva-ai

## Overview

Dentiva is a dental-practice application for patient appointment booking, patient dashboards, doctor administration, and a Pro voice experience. The main patient workflow selects a dentist, chooses a date and time, confirms a booking, persists it, and requests an email confirmation. Server actions provide appointment and doctor operations over Prisma; hooks expose these operations to client pages. The tree also documents landing, admin, dashboard, and voice features. Some subsystem internals were not sampled, so their relationships are included only where excerpts, indexed references, or explicit documentation support them.

Main entry points: [`src/app/appointments/page.tsx`](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/appointments/page.tsx) (Booking flow), [`src/lib/prisma.ts`](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/prisma.ts) (Prisma client), [`src/components/Navbar.tsx`](https://github.com/amandubey923/dentiva-ai/blob/main/src/components/Navbar.tsx) (Navigation), [`src/app/page.tsx`](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/page.tsx) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public experience"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_landing_content["Landing content"]
  node_navbar["Navigation<br/>[Navbar.tsx]"]
end

subgraph group_booking["Appointment booking"]
  node_appointments_page["Booking flow<br/>[page.tsx]"]
  node_booking_steps["Booking steps"]
  node_appointment_hooks["Appointment hooks<br/>[use-appointment.ts]"]
  node_doctor_hooks["Doctor hooks<br/>[use-doctors.ts]"]
  node_email_route["Email endpoint<br/>[route.ts]"]
  node_email_template["Confirmation email"]
end

subgraph group_practice["Practice operations"]
  node_dashboard_page["Patient dashboard<br/>[page.tsx]"]
  node_dashboard_content["Dashboard panels"]
  node_admin_page["Admin dashboard"]
  node_admin_components["Admin panels"]
end

subgraph group_voice["Voice experience"]
  node_voice_page["Voice page<br/>[page.tsx]"]
  node_voice_components["Voice interface"]
  node_vapi_config["Vapi client config<br/>[vapi.ts]"]
  node_pro_page["Pro page<br/>[page.tsx]"]
end

subgraph group_data["Application data"]
  node_appointment_actions["Appointment actions<br/>[appointments.ts]"]
  node_doctor_actions["Doctor actions<br/>[doctors.ts]"]
  node_dashboard_actions["Dashboard action<br/>[dashboard.ts]"]
  node_user_actions["User sync<br/>[users.ts]"]
  node_prisma["Prisma client<br/>[prisma.ts]"]
  node_database[("Application database")]
  node_utility["Shared utilities<br/>[utils.ts]"]
end

node_visitor(("Visitor"))
node_patient(("Patient"))
node_resend["Resend service<br/>[resend.ts]"]
node_vapi["Vapi service"]

node_visitor -->|"visits"| node_landing
node_landing -->|"renders"| node_landing_content
node_landing -->|"syncs user"| node_user_actions
node_landing -->|"redirects signed-in"| node_dashboard_page
node_patient -.->|"books through"| node_appointments_page
node_appointments_page -->|"renders"| node_booking_steps
node_appointments_page -->|"uses"| node_appointment_hooks
node_appointments_page -->|"posts confirmation"| node_email_route
node_appointment_hooks -->|"invokes"| node_appointment_actions
node_appointments_page -->|"selects doctors"| node_doctor_hooks
node_doctor_hooks -->|"invokes"| node_doctor_actions
node_appointment_actions -->|"queries"| node_prisma
node_doctor_actions -->|"queries"| node_prisma
node_prisma -.->|"reads and writes"| node_database
node_email_route -->|"renders"| node_email_template
node_email_route -->|"sends email"| node_resend
node_dashboard_page -->|"fetches data"| node_dashboard_actions
node_dashboard_page -->|"renders"| node_dashboard_content
node_dashboard_actions -->|"queries"| node_prisma
node_dashboard_actions -->|"uses"| node_appointment_actions
node_admin_page -->|"loads appointments"| node_appointment_hooks
node_admin_page -->|"loads doctors"| node_doctor_hooks
node_admin_page -->|"renders"| node_admin_components
node_admin_components -->|"manages appointments"| node_appointment_hooks
node_admin_components -->|"manages doctors"| node_doctor_hooks
node_user_actions -->|"syncs records"| node_prisma
node_voice_page -->|"renders"| node_voice_components
node_voice_components -->|"uses"| node_vapi_config
node_vapi_config -.->|"configures"| node_vapi
node_patient -.->|"opens"| node_voice_page
node_pro_page -.->|"presents Pro"| node_patient
node_appointments_page -->|"uses booking types"| node_utility
node_navbar -->|"links to"| node_appointments_page
node_navbar -->|"links to"| node_dashboard_page
node_navbar -->|"links to"| node_voice_page
node_navbar -->|"links to"| node_pro_page

click node_landing "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/page.tsx"
click node_landing_content "https://github.com/amandubey923/dentiva-ai/tree/main/src/components/landing"
click node_dashboard_page "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/dashboard/page.tsx"
click node_dashboard_content "https://github.com/amandubey923/dentiva-ai/tree/main/src/components/dashboard"
click node_admin_page "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/admin/AdminDashboardClient.tsx"
click node_admin_components "https://github.com/amandubey923/dentiva-ai/tree/main/src/components/admin"
click node_appointments_page "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/appointments/page.tsx"
click node_booking_steps "https://github.com/amandubey923/dentiva-ai/tree/main/src/components/appointments"
click node_appointment_hooks "https://github.com/amandubey923/dentiva-ai/blob/main/src/hooks/use-appointment.ts"
click node_appointment_actions "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/appointments.ts"
click node_doctor_hooks "https://github.com/amandubey923/dentiva-ai/blob/main/src/hooks/use-doctors.ts"
click node_doctor_actions "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/doctors.ts"
click node_email_route "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/api/send-appointment-email/route.ts"
click node_email_template "https://github.com/amandubey923/dentiva-ai/blob/main/src/components/emails/AppointmentConfirmationEmail.tsx"
click node_resend "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/resend.ts"
click node_dashboard_actions "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/dashboard.ts"
click node_user_actions "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/users.ts"
click node_prisma "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/prisma.ts"
click node_voice_page "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/voice/page.tsx"
click node_voice_components "https://github.com/amandubey923/dentiva-ai/tree/main/src/components/voice"
click node_vapi_config "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/vapi.ts"
click node_pro_page "https://github.com/amandubey923/dentiva-ai/blob/main/src/app/pro/page.tsx"
click node_navbar "https://github.com/amandubey923/dentiva-ai/blob/main/src/components/Navbar.tsx"
click node_utility "https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/utils.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_landing,node_landing_content,node_navbar toneBlue
class node_appointments_page,node_booking_steps,node_appointment_hooks,node_doctor_hooks,node_email_route,node_email_template toneAmber
class node_dashboard_page,node_dashboard_content,node_admin_page,node_admin_components,node_vapi toneMint
class node_voice_page,node_voice_components,node_vapi_config,node_pro_page toneRose
class node_appointment_actions,node_doctor_actions,node_dashboard_actions,node_user_actions,node_prisma,node_database,node_utility,node_visitor,node_patient toneIndigo
class node_resend toneTeal
```

## Components

### Public experience

- [Landing page](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/page.tsx): `src/app/page.tsx`
- [Landing content](https://github.com/amandubey923/dentiva-ai/tree/main/src/components/landing): `src/components/landing`
- [Navigation](https://github.com/amandubey923/dentiva-ai/blob/main/src/components/Navbar.tsx): `src/components/Navbar.tsx`

### Appointment booking

- [Booking flow](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/appointments/page.tsx): `src/app/appointments/page.tsx`
- [Booking steps](https://github.com/amandubey923/dentiva-ai/tree/main/src/components/appointments): `src/components/appointments`
- [Appointment hooks](https://github.com/amandubey923/dentiva-ai/blob/main/src/hooks/use-appointment.ts): `src/hooks/use-appointment.ts`
- [Doctor hooks](https://github.com/amandubey923/dentiva-ai/blob/main/src/hooks/use-doctors.ts): `src/hooks/use-doctors.ts`
- [Email endpoint](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/api/send-appointment-email/route.ts): `src/app/api/send-appointment-email/route.ts`
- [Confirmation email](https://github.com/amandubey923/dentiva-ai/blob/main/src/components/emails/AppointmentConfirmationEmail.tsx): `src/components/emails/AppointmentConfirmationEmail.tsx`

### Practice operations

- [Patient dashboard](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/dashboard/page.tsx): `src/app/dashboard/page.tsx`
- [Dashboard panels](https://github.com/amandubey923/dentiva-ai/tree/main/src/components/dashboard): `src/components/dashboard`
- [Admin dashboard](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/admin/AdminDashboardClient.tsx): `src/app/admin/AdminDashboardClient.tsx`
- [Admin panels](https://github.com/amandubey923/dentiva-ai/tree/main/src/components/admin): `src/components/admin`

### Voice experience

- [Voice page](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/voice/page.tsx): `src/app/voice/page.tsx`
- [Voice interface](https://github.com/amandubey923/dentiva-ai/tree/main/src/components/voice): `src/components/voice`
- [Vapi client config](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/vapi.ts): `src/lib/vapi.ts`
- [Pro page](https://github.com/amandubey923/dentiva-ai/blob/main/src/app/pro/page.tsx): `src/app/pro/page.tsx`

### Application data

- [Appointment actions](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/appointments.ts): `src/lib/actions/appointments.ts`
- [Doctor actions](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/doctors.ts): `src/lib/actions/doctors.ts`
- [Dashboard action](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/dashboard.ts): `src/lib/actions/dashboard.ts`
- [User sync](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/actions/users.ts): `src/lib/actions/users.ts`
- [Prisma client](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`
- **Application database**
- [Shared utilities](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/utils.ts): `src/lib/utils.ts`

### Other components

- **Visitor**
- **Patient**
- [Resend service](https://github.com/amandubey923/dentiva-ai/blob/main/src/lib/resend.ts): `src/lib/resend.ts`
- **Vapi service**

## Connections

- Visitor → Landing page: visits (evidence: `src/app/page.tsx`)
- Landing page → Landing content: renders (evidence: `src/app/page.tsx`)
- Landing page → User sync: syncs user (evidence: `src/app/page.tsx`)
- Landing page → Patient dashboard: redirects signed-in (evidence: `src/app/page.tsx`)
- Patient → Booking flow: books through
- Booking flow → Booking steps: renders (evidence: `src/app/appointments/page.tsx`)
- Booking flow → Appointment hooks: uses (evidence: `src/app/appointments/page.tsx`)
- Booking flow → Email endpoint: posts confirmation (evidence: `src/app/appointments/page.tsx`)
- Appointment hooks → Appointment actions: invokes (evidence: `src/hooks/use-appointment.ts`)
- Booking flow → Doctor hooks: selects doctors (evidence: `src/app/appointments/page.tsx`)
- Doctor hooks → Doctor actions: invokes (evidence: `src/hooks/use-doctors.ts`)
- Appointment actions → Prisma client: queries (evidence: `src/lib/actions/appointments.ts`)
- Doctor actions → Prisma client: queries (evidence: `src/lib/actions/doctors.ts`)
- Prisma client → Application database: reads and writes
- Email endpoint → Confirmation email: renders (evidence: `src/app/api/send-appointment-email/route.ts`)
- Email endpoint → Resend service: sends email (evidence: `src/app/api/send-appointment-email/route.ts`)
- Patient dashboard → Dashboard action: fetches data (evidence: `src/app/dashboard/page.tsx`)
- Patient dashboard → Dashboard panels: renders (evidence: `src/app/dashboard/page.tsx`)
- Dashboard action → Prisma client: queries (evidence: `src/lib/actions/dashboard.ts`)
- Dashboard action → Appointment actions: uses (evidence: `src/lib/actions/dashboard.ts`)
- Admin dashboard → Appointment hooks: loads appointments (evidence: `src/app/admin/AdminDashboardClient.tsx`)
- Admin dashboard → Doctor hooks: loads doctors (evidence: `src/app/admin/AdminDashboardClient.tsx`)
- Admin dashboard → Admin panels: renders (evidence: `src/app/admin/AdminDashboardClient.tsx`)
- Admin panels → Appointment hooks: manages appointments (evidence: `src/components/admin/RecentAppointments.tsx`)
- Admin panels → Doctor hooks: manages doctors (evidence: `src/components/admin/DoctorsManagement.tsx`)
- User sync → Prisma client: syncs records (evidence: `src/lib/actions/users.ts`)
- Voice page → Voice interface: renders (evidence: `src/app/voice/page.tsx`)
- Voice interface → Vapi client config: uses (evidence: `src/components/voice/VapiWidget.tsx`)
- Vapi client config → Vapi service: configures
- Patient → Voice page: opens
- Pro page → Patient: presents Pro
- Booking flow → Shared utilities: uses booking types (evidence: `src/app/appointments/page.tsx`)
- Navigation → Booking flow: links to (evidence: `src/components/Navbar.tsx`)
- Navigation → Patient dashboard: links to (evidence: `src/components/Navbar.tsx`)
- Navigation → Voice page: links to (evidence: `src/components/Navbar.tsx`)
- Navigation → Pro page: links to (evidence: `src/components/Navbar.tsx`)
