# tiesol/dental architecture

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

- Interactive diagram: https://gitdiagram.com/tiesol/dental
- Repository: https://github.com/tiesol/dental

## Overview

Dental appointment monolith: patients and staff use a React SPA backed by a NestJS API and PostgreSQL. The main patient journey is authentication, choosing a dentist and service, checking availability, booking or managing appointments, then viewing appointment-related clinical records; dentists and administrators manage schedules, appointments, users, and clinic offerings. The graph groups UI features and API domains while showing sampled controller-to-service calls. Repository excerpts do not expose most service implementations, persistence calls, or realtime wiring, so those links are omitted or marked unverified.

Main entry points: [`backend/src/app.module.ts`](https://github.com/tiesol/dental/blob/main/backend/src/app.module.ts) (Nest application modules), [`frontend/src/api`](https://github.com/tiesol/dental/tree/main/frontend/src/api) (HTTP and API endpoints), [`backend/src/prisma`](https://github.com/tiesol/dental/tree/main/backend/src/prisma) (PostgreSQL via Prisma), [`backend/src/modules/appointments`](https://github.com/tiesol/dental/tree/main/backend/src/modules/appointments) (Appointment lifecycle)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_spa["React application<br/>[App.tsx]"]
  node_routing["Role-based routes<br/>[router.tsx]"]
  node_authui["Sign-in and account"]
  node_bookingui["Appointment booking"]
  node_myappointmentsui["My appointments"]
  node_staffui["Staff workspace"]
  node_clinicui["Clinic administration"]
  node_clinicalui["Dental records UI"]
  node_apiclient["HTTP and API endpoints"]
end

subgraph group_api["API foundation"]
  node_appmodule["Nest application modules<br/>[app.module.ts]"]
  node_auth["JWT authentication<br/>[auth.service.ts]"]
  node_users["User accounts<br/>[users.service.ts]"]
  node_postgres[("PostgreSQL via Prisma")]
end

subgraph group_booking["Booking domains"]
  node_appointments["Appointment lifecycle"]
  node_availability["Schedules and slots"]
end

subgraph group_clinic["Clinic operations"]
  node_services["Service catalog"]
  node_dentists["Dentist management"]
end

subgraph group_clinical["Clinical and live care"]
  node_observations["Appointment observations"]
  node_odontograms["Dental charting"]
  node_realtime["Appointment events"]
end

node_patient(("Patient"))
node_staff(("Dentist / admin"))

node_patient -->|"uses"| node_spa
node_staff -->|"uses"| node_spa
node_spa -->|"renders"| node_routing
node_patient -.->|"registers / signs in"| node_authui
node_patient -.->|"books care"| node_bookingui
node_patient -.->|"manages appointments"| node_myappointmentsui
node_staff -.->|"works agenda"| node_staffui
node_staff -.->|"manages clinic"| node_clinicui
node_staff -.->|"records care"| node_clinicalui
node_bookingui -.->|"requests API"| node_apiclient
node_authui -.->|"requests API"| node_apiclient
node_myappointmentsui -.->|"requests API"| node_apiclient
node_staffui -.->|"requests API"| node_apiclient
node_clinicalui -.->|"requests API"| node_apiclient
node_apiclient -->|"calls REST API"| node_appmodule
node_appmodule -->|"registers"| node_auth
node_appmodule -->|"registers"| node_users
node_appmodule -->|"registers"| node_appointments
node_appmodule -->|"registers"| node_availability
node_appmodule -->|"registers"| node_services
node_appmodule -->|"registers"| node_dentists
node_appmodule -->|"registers"| node_observations
node_appmodule -->|"registers"| node_odontograms
node_auth -->|"looks up / creates users"| node_users
node_appointments -.->|"persists appointments"| node_postgres
node_availability -.->|"reads schedules"| node_postgres
node_services -.->|"persists catalog"| node_postgres
node_dentists -.->|"persists dentists"| node_postgres
node_appointments -.->|"emits updates"| node_realtime
node_observations -.->|"stores notes"| node_postgres
node_odontograms -.->|"stores charts"| node_postgres

click node_spa "https://github.com/tiesol/dental/blob/main/frontend/src/app/App.tsx"
click node_routing "https://github.com/tiesol/dental/blob/main/frontend/src/app/router.tsx"
click node_authui "https://github.com/tiesol/dental/tree/main/frontend/src/features/auth"
click node_bookingui "https://github.com/tiesol/dental/tree/main/frontend/src/features/reserva"
click node_myappointmentsui "https://github.com/tiesol/dental/tree/main/frontend/src/features/mis-citas"
click node_staffui "https://github.com/tiesol/dental/tree/main/frontend/src/features/agenda"
click node_clinicui "https://github.com/tiesol/dental/tree/main/frontend/src/features/odontologos"
click node_clinicalui "https://github.com/tiesol/dental/tree/main/frontend/src/features/odontograma"
click node_apiclient "https://github.com/tiesol/dental/tree/main/frontend/src/api"
click node_appmodule "https://github.com/tiesol/dental/blob/main/backend/src/app.module.ts"
click node_auth "https://github.com/tiesol/dental/blob/main/backend/src/modules/auth/auth.service.ts"
click node_users "https://github.com/tiesol/dental/blob/main/backend/src/modules/users/users.service.ts"
click node_appointments "https://github.com/tiesol/dental/tree/main/backend/src/modules/appointments"
click node_availability "https://github.com/tiesol/dental/tree/main/backend/src/modules/availability"
click node_services "https://github.com/tiesol/dental/tree/main/backend/src/modules/services"
click node_dentists "https://github.com/tiesol/dental/tree/main/backend/src/modules/dentists"
click node_observations "https://github.com/tiesol/dental/tree/main/backend/src/modules/observations"
click node_odontograms "https://github.com/tiesol/dental/tree/main/backend/src/modules/odontograms"
click node_realtime "https://github.com/tiesol/dental/tree/main/backend/src/modules/realtime"
click node_postgres "https://github.com/tiesol/dental/tree/main/backend/src/prisma"

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_spa,node_routing,node_authui,node_bookingui,node_myappointmentsui,node_staffui,node_clinicui,node_clinicalui,node_apiclient toneBlue
class node_appmodule,node_auth,node_users,node_postgres toneAmber
class node_appointments,node_availability toneMint
class node_services,node_dentists toneRose
class node_observations,node_odontograms,node_realtime,node_patient,node_staff toneIndigo
```

## Components

### Web application

- [React application](https://github.com/tiesol/dental/blob/main/frontend/src/app/App.tsx): `frontend/src/app/App.tsx`
- [Role-based routes](https://github.com/tiesol/dental/blob/main/frontend/src/app/router.tsx): `frontend/src/app/router.tsx`
- [Sign-in and account](https://github.com/tiesol/dental/tree/main/frontend/src/features/auth): `frontend/src/features/auth`
- [Appointment booking](https://github.com/tiesol/dental/tree/main/frontend/src/features/reserva): `frontend/src/features/reserva`
- [My appointments](https://github.com/tiesol/dental/tree/main/frontend/src/features/mis-citas): `frontend/src/features/mis-citas`
- [Staff workspace](https://github.com/tiesol/dental/tree/main/frontend/src/features/agenda): `frontend/src/features/agenda`
- [Clinic administration](https://github.com/tiesol/dental/tree/main/frontend/src/features/odontologos): `frontend/src/features/odontologos`
- [Dental records UI](https://github.com/tiesol/dental/tree/main/frontend/src/features/odontograma): `frontend/src/features/odontograma`
- [HTTP and API endpoints](https://github.com/tiesol/dental/tree/main/frontend/src/api): `frontend/src/api`

### API foundation

- [Nest application modules](https://github.com/tiesol/dental/blob/main/backend/src/app.module.ts): `backend/src/app.module.ts`
- [JWT authentication](https://github.com/tiesol/dental/blob/main/backend/src/modules/auth/auth.service.ts): `backend/src/modules/auth/auth.service.ts`
- [User accounts](https://github.com/tiesol/dental/blob/main/backend/src/modules/users/users.service.ts): `backend/src/modules/users/users.service.ts`
- [PostgreSQL via Prisma](https://github.com/tiesol/dental/tree/main/backend/src/prisma): `backend/src/prisma`

### Booking domains

- [Appointment lifecycle](https://github.com/tiesol/dental/tree/main/backend/src/modules/appointments): `backend/src/modules/appointments`
- [Schedules and slots](https://github.com/tiesol/dental/tree/main/backend/src/modules/availability): `backend/src/modules/availability`

### Clinic operations

- [Service catalog](https://github.com/tiesol/dental/tree/main/backend/src/modules/services): `backend/src/modules/services`
- [Dentist management](https://github.com/tiesol/dental/tree/main/backend/src/modules/dentists): `backend/src/modules/dentists`

### Clinical and live care

- [Appointment observations](https://github.com/tiesol/dental/tree/main/backend/src/modules/observations): `backend/src/modules/observations`
- [Dental charting](https://github.com/tiesol/dental/tree/main/backend/src/modules/odontograms): `backend/src/modules/odontograms`
- [Appointment events](https://github.com/tiesol/dental/tree/main/backend/src/modules/realtime): `backend/src/modules/realtime`

### Other components

- **Patient**
- **Dentist / admin**

## Connections

- Patient → React application: uses (evidence: `README.md`)
- Dentist / admin → React application: uses (evidence: `README.md`)
- React application → Role-based routes: renders (evidence: `frontend/src/app/App.tsx`)
- Patient → Sign-in and account: registers / signs in
- Patient → Appointment booking: books care
- Patient → My appointments: manages appointments
- Dentist / admin → Staff workspace: works agenda
- Dentist / admin → Clinic administration: manages clinic
- Dentist / admin → Dental records UI: records care
- Appointment booking → HTTP and API endpoints: requests API
- Sign-in and account → HTTP and API endpoints: requests API
- My appointments → HTTP and API endpoints: requests API
- Staff workspace → HTTP and API endpoints: requests API
- Dental records UI → HTTP and API endpoints: requests API
- HTTP and API endpoints → Nest application modules: calls REST API (evidence: `README.md`)
- Nest application modules → JWT authentication: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → User accounts: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → Appointment lifecycle: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → Schedules and slots: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → Service catalog: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → Dentist management: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → Appointment observations: registers (evidence: `backend/src/app.module.ts`)
- Nest application modules → Dental charting: registers (evidence: `backend/src/app.module.ts`)
- JWT authentication → User accounts: looks up / creates users (evidence: `backend/src/modules/auth/auth.service.ts`)
- Appointment lifecycle → PostgreSQL via Prisma: persists appointments (evidence: `backend/src/modules/appointments/appointments.service.ts`)
- Schedules and slots → PostgreSQL via Prisma: reads schedules
- Service catalog → PostgreSQL via Prisma: persists catalog
- Dentist management → PostgreSQL via Prisma: persists dentists
- Appointment lifecycle → Appointment events: emits updates (evidence: `backend/src/modules/appointments/appointments.module.ts`)
- Appointment observations → PostgreSQL via Prisma: stores notes
- Dental charting → PostgreSQL via Prisma: stores charts
