# suhas-panthoji/dentafloiw architecture

> Architecture diagram of the GitHub repository suhas-panthoji/dentafloiw, 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/suhas-panthoji/dentafloiw
- Repository: https://github.com/suhas-panthoji/dentafloiw

## Overview

DentaFlow is a dental-practice management suite: clinic staff sign in, find or create patient records, document treatment and visits, and manage follow-ups, pricing, finances, and accounts. The main web app uses a FastAPI backend with MongoDB and private object storage; image uploads are validated and transformed before storage. The repository also contains a separate odontogram application. Its detailed runtime wiring, and several unsampled page-to-API relationships, are not established by the excerpts, so those links are omitted or marked unverified.

Main entry points: [`frontend/src/components/odontogram/Odontogram.jsx`](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/Odontogram.jsx) (Dental chart), [`backend/server.py`](https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/server.py) (Clinic API), [`frontend/src/lib/auth.jsx`](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/auth.jsx) (Session and roles), [`odontogram/frontend/src/App.js`](https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/App.js) (Odontogram frontend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clinic_ui["Clinic workspace"]
  node_clinic_pages["Clinic pages"]
  node_accounts["Account management"]
  node_auth_ui["Session and roles<br/>[auth.jsx]"]
  node_browser_storage["Token storage<br/>[storage.js]"]
  node_clinic_api["API client<br/>[api.js]"]
end

subgraph group_clinical["Clinical records"]
  node_patient_records["Patient records"]
  node_patient_list["Patient list"]
  node_odontogram_ui["Dental chart<br/>[Odontogram.jsx]"]
  node_tooth_view["Tooth view<br/>[Tooth.jsx]"]
  node_tooth_popup["Tooth details<br/>[ToothPopup.jsx]"]
  node_tooth_menu["Tooth actions"]
  node_tooth_config["Tooth configuration<br/>[toothConfig.js]"]
  node_prescriptions["Prescriptions"]
  node_visits["Visits<br/>[VisitForm.jsx]"]
  node_patient_modal["Patient detail view"]
end

subgraph group_backend["API and persistence"]
  node_api_server["Clinic API<br/>[server.py]"]
  node_image_pipeline["Image preparation<br/>[image_pipeline.py]"]
  node_object_storage["Object storage<br/>[storage.py]"]
end

subgraph group_standalone["Odontogram app"]
  node_odont_app["Odontogram frontend<br/>[App.js]"]
  node_odont_chart["Standalone dental chart<br/>[OdontogramPage.jsx]"]
  node_odont_auth["Standalone login<br/>[auth.jsx]"]
  node_odont_api["Standalone API client<br/>[api.js]"]
  node_odont_server["Standalone backend<br/>[server.py]"]
end

node_staff(("Clinic staff"))
node_mongo[("MongoDB")]
node_object_store[("R2 or local objects")]
node_odont_user(("Odontogram user"))

node_staff -->|"signs in"| node_auth_ui
node_auth_ui -->|"stores token"| node_browser_storage
node_auth_ui -->|"auth requests"| node_clinic_api
node_clinic_pages -.->|"uses API"| node_clinic_api
node_patient_records -.->|"renders chart"| node_odontogram_ui
node_odontogram_ui -->|"renders teeth"| node_tooth_view
node_odontogram_ui -->|"renders details"| node_tooth_popup
node_odontogram_ui -->|"renders actions"| node_tooth_menu
node_odontogram_ui -->|"uses configuration"| node_tooth_config
node_patient_list -.->|"opens records"| node_patient_records
node_clinic_api -.->|"sends requests"| node_api_server
node_api_server -->|"reads and writes"| node_mongo
node_api_server -->|"prepares uploads"| node_image_pipeline
node_api_server -->|"manages files"| node_object_storage
node_object_storage -->|"stores objects"| node_object_store
node_odont_user -->|"opens app"| node_odont_app
node_odont_app -.->|"provides auth"| node_odont_auth
node_odont_app -.->|"routes to chart"| node_odont_chart
node_odont_auth -->|"calls auth endpoints"| node_odont_api
node_odont_api -.->|"sends requests"| node_odont_server

click node_clinic_pages "https://github.com/suhas-panthoji/dentafloiw/tree/main/frontend/src/pages"
click node_accounts "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/pages/AccountManagementPage.jsx"
click node_auth_ui "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/auth.jsx"
click node_browser_storage "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/storage.js"
click node_clinic_api "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/api.js"
click node_patient_records "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/pages/PatientFormPage.jsx"
click node_patient_list "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/pages/PatientsListPage.jsx"
click node_odontogram_ui "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/Odontogram.jsx"
click node_tooth_view "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/Tooth.jsx"
click node_tooth_popup "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/ToothPopup.jsx"
click node_tooth_menu "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/ToothContextMenu.jsx"
click node_tooth_config "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/toothConfig.js"
click node_prescriptions "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/PrescriptionWriter.jsx"
click node_visits "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/VisitForm.jsx"
click node_patient_modal "https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/PatientViewModal.jsx"
click node_api_server "https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/server.py"
click node_image_pipeline "https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/image_pipeline.py"
click node_object_storage "https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/storage.py"
click node_odont_app "https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/App.js"
click node_odont_chart "https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/pages/OdontogramPage.jsx"
click node_odont_auth "https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/lib/auth.jsx"
click node_odont_api "https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/lib/api.js"
click node_odont_server "https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/backend/server.py"

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_clinic_pages,node_accounts,node_auth_ui,node_browser_storage,node_clinic_api,node_odont_user toneBlue
class node_patient_records,node_patient_list,node_odontogram_ui,node_tooth_view,node_tooth_popup,node_tooth_menu,node_tooth_config,node_prescriptions,node_visits,node_patient_modal,node_mongo,node_object_store toneAmber
class node_api_server,node_image_pipeline,node_object_storage toneMint
class node_odont_app,node_odont_chart,node_odont_auth,node_odont_api,node_odont_server toneRose
class node_staff toneIndigo
```

## Components

### Clinic workspace

- [Clinic pages](https://github.com/suhas-panthoji/dentafloiw/tree/main/frontend/src/pages): `frontend/src/pages`
- [Account management](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/pages/AccountManagementPage.jsx): `frontend/src/pages/AccountManagementPage.jsx`
- [Session and roles](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/auth.jsx): `frontend/src/lib/auth.jsx`
- [Token storage](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/storage.js): `frontend/src/lib/storage.js`
- [API client](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`

### Clinical records

- [Patient records](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/pages/PatientFormPage.jsx): `frontend/src/pages/PatientFormPage.jsx`
- [Patient list](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/pages/PatientsListPage.jsx): `frontend/src/pages/PatientsListPage.jsx`
- [Dental chart](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/Odontogram.jsx): `frontend/src/components/odontogram/Odontogram.jsx`
- [Tooth view](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/Tooth.jsx): `frontend/src/components/odontogram/Tooth.jsx`
- [Tooth details](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/ToothPopup.jsx): `frontend/src/components/odontogram/ToothPopup.jsx`
- [Tooth actions](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/ToothContextMenu.jsx): `frontend/src/components/odontogram/ToothContextMenu.jsx`
- [Tooth configuration](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/odontogram/toothConfig.js): `frontend/src/components/odontogram/toothConfig.js`
- [Prescriptions](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/PrescriptionWriter.jsx): `frontend/src/components/PrescriptionWriter.jsx`
- [Visits](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/VisitForm.jsx): `frontend/src/components/VisitForm.jsx`
- [Patient detail view](https://github.com/suhas-panthoji/dentafloiw/blob/main/frontend/src/components/PatientViewModal.jsx): `frontend/src/components/PatientViewModal.jsx`

### API and persistence

- [Clinic API](https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/server.py): `backend/server.py`
- [Image preparation](https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/image_pipeline.py): `backend/image_pipeline.py`
- [Object storage](https://github.com/suhas-panthoji/dentafloiw/blob/main/backend/storage.py): `backend/storage.py`

### Odontogram app

- [Odontogram frontend](https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/App.js): `odontogram/frontend/src/App.js`
- [Standalone dental chart](https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/pages/OdontogramPage.jsx): `odontogram/frontend/src/pages/OdontogramPage.jsx`
- [Standalone login](https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/lib/auth.jsx): `odontogram/frontend/src/lib/auth.jsx`
- [Standalone API client](https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/frontend/src/lib/api.js): `odontogram/frontend/src/lib/api.js`
- [Standalone backend](https://github.com/suhas-panthoji/dentafloiw/blob/main/odontogram/backend/server.py): `odontogram/backend/server.py`

### Other components

- **Clinic staff**
- **MongoDB**
- **R2 or local objects**
- **Odontogram user**

## Connections

- Clinic staff → Session and roles: signs in
- Session and roles → Token storage: stores token (evidence: `frontend/src/lib/auth.jsx`)
- Session and roles → API client: auth requests (evidence: `frontend/src/lib/auth.jsx`)
- Clinic pages → API client: uses API
- Patient records → Dental chart: renders chart
- Dental chart → Tooth view: renders teeth (evidence: `frontend/src/components/odontogram/Odontogram.jsx`)
- Dental chart → Tooth details: renders details (evidence: `frontend/src/components/odontogram/Odontogram.jsx`)
- Dental chart → Tooth actions: renders actions (evidence: `frontend/src/components/odontogram/Odontogram.jsx`)
- Dental chart → Tooth configuration: uses configuration (evidence: `frontend/src/components/odontogram/Odontogram.jsx`)
- Patient list → Patient records: opens records
- API client → Clinic API: sends requests
- Clinic API → MongoDB: reads and writes (evidence: `backend/server.py`)
- Clinic API → Image preparation: prepares uploads (evidence: `backend/server.py`)
- Clinic API → Object storage: manages files (evidence: `backend/server.py`)
- Object storage → R2 or local objects: stores objects (evidence: `backend/storage.py`)
- Odontogram user → Odontogram frontend: opens app (evidence: `odontogram/frontend/src/App.js`)
- Odontogram frontend → Standalone login: provides auth
- Odontogram frontend → Standalone dental chart: routes to chart
- Standalone login → Standalone API client: calls auth endpoints (evidence: `odontogram/frontend/src/lib/auth.jsx`)
- Standalone API client → Standalone backend: sends requests
