# alsoufi0/dentalec architecture

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

- Interactive diagram: https://gitdiagram.com/alsoufi0/dentalec
- Repository: https://github.com/alsoufi0/dentalec

## Overview

Simav Dental Tutor is a full-stack study app: students add dental PDFs or text, then use grounded tutoring and active-recall tools, with generated study artifacts and optional voice interaction. Accounts preserve private study state; a separate radiology area supports teaching cases, image review, and formative interpretation feedback. The sampled source confirms the radiology wiring and selected server behavior; README-described study modes are retained, but their detailed internal wiring is not inferred from incomplete excerpts.

Main entry points: [`src/main.jsx`](https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx) (Study workspace), [`server/index.js`](https://github.com/alsoufi0/dentalec/blob/main/server/index.js) (Application API), [`src/radiology/index.jsx`](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/index.jsx) (Radiology pages), [`src/radiology/CaseLibrary.jsx`](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/CaseLibrary.jsx) (Teaching case library)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Study experience"]
  node_webapp["Study workspace<br/>[main.jsx]"]
  node_source["Source library<br/>[main.jsx]"]
  node_tutoring["Tutor and study modes<br/>[main.jsx]"]
  node_artifacts["Notes and recall<br/>[main.jsx]"]
  node_voice["Study Buddy voice<br/>[main.jsx]"]
end

subgraph group_backend["Tutor services"]
  node_api["Application API<br/>[index.js]"]
  node_engines["Dental learning engines<br/>[dentalosEngines.js]"]
end

subgraph group_identity["Accounts and state"]
  node_accounts["Sign-in and sessions<br/>[index.js]"]
  node_state[("Saved study state<br/>[index.js]")]
  node_postgres[("Postgres persistence<br/>[schema.sql]")]
end

subgraph group_radiology["Radiology learning"]
  node_radiologyroutes["Radiology pages<br/>[index.jsx]"]
  node_caselist["Teaching case library<br/>[CaseLibrary.jsx]"]
  node_manifest["Case manifest<br/>[manifest.json]"]
  node_usercases["Uploaded X-rays<br/>[userCases.js]"]
  node_viewer["Radiograph viewer"]
  node_interpreter["X-ray interpreter"]
  node_radapi["Interpretation feedback API<br/>[index.js]"]
  node_localstore["Radiology bookmarks<br/>[useLocalStore.js]"]
end

node_student(("Student"))
node_professor(("Professor"))
node_openai["OpenAI services"]
node_vectorstore[("Hosted source search")]
node_speech["Browser speech APIs"]
node_localstorage[("Browser local storage")]

node_student -->|"uses"| node_webapp
node_professor -->|"uses"| node_webapp
node_webapp -->|"opens"| node_source
node_source -->|"uploads sources"| node_api
node_api -->|"indexes and searches"| node_vectorstore
node_api -->|"requests tutoring"| node_openai
node_webapp -->|"selects study modes"| node_tutoring
node_tutoring -->|"requests answers"| node_api
node_api -->|"gets engine prompts"| node_engines
node_tutoring -->|"creates study aids"| node_artifacts
node_webapp -->|"starts voice study"| node_voice
node_voice -->|"uses speech recognition"| node_speech
node_voice -->|"sends questions"| node_api
node_api -.->|"transcribes and speaks"| node_openai
node_webapp -->|"signs in"| node_accounts
node_accounts -->|"loads and saves"| node_state
node_state -.->|"persists optionally"| node_postgres
node_webapp -->|"opens radiology"| node_radiologyroutes
node_radiologyroutes -->|"loads cases"| node_manifest
node_radiologyroutes -->|"loads user cases"| node_usercases
node_radiologyroutes -->|"renders library"| node_caselist
node_radiologyroutes -->|"renders selected case"| node_viewer
node_radiologyroutes -->|"renders interpreter"| node_interpreter
node_caselist -->|"uses bookmarks"| node_localstore
node_localstore -->|"reads and writes"| node_localstorage
node_interpreter -->|"requests feedback"| node_radapi
node_radapi -->|"evaluates image and reading"| node_openai

click node_webapp "https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx"
click node_source "https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx"
click node_tutoring "https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx"
click node_artifacts "https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx"
click node_voice "https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx"
click node_api "https://github.com/alsoufi0/dentalec/blob/main/server/index.js"
click node_engines "https://github.com/alsoufi0/dentalec/blob/main/server/dentalosEngines.js"
click node_accounts "https://github.com/alsoufi0/dentalec/blob/main/server/index.js"
click node_state "https://github.com/alsoufi0/dentalec/blob/main/server/index.js"
click node_postgres "https://github.com/alsoufi0/dentalec/blob/main/db/schema.sql"
click node_radiologyroutes "https://github.com/alsoufi0/dentalec/blob/main/src/radiology/index.jsx"
click node_caselist "https://github.com/alsoufi0/dentalec/blob/main/src/radiology/CaseLibrary.jsx"
click node_manifest "https://github.com/alsoufi0/dentalec/blob/main/public/radiology/manifest.json"
click node_usercases "https://github.com/alsoufi0/dentalec/blob/main/src/radiology/userCases.js"
click node_viewer "https://github.com/alsoufi0/dentalec/blob/main/src/radiology/RadiologyViewer.jsx"
click node_interpreter "https://github.com/alsoufi0/dentalec/blob/main/src/radiology/XrayInterpreter.jsx"
click node_radapi "https://github.com/alsoufi0/dentalec/blob/main/server/index.js"
click node_localstore "https://github.com/alsoufi0/dentalec/blob/main/src/radiology/useLocalStore.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_webapp,node_source,node_tutoring,node_artifacts,node_voice,node_speech toneBlue
class node_api,node_engines,node_vectorstore,node_localstorage toneAmber
class node_accounts,node_state,node_postgres toneMint
class node_radiologyroutes,node_caselist,node_manifest,node_usercases,node_viewer,node_interpreter,node_radapi,node_localstore toneRose
class node_student,node_professor,node_openai toneIndigo
```

## Components

### Study experience

- [Study workspace](https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx): `src/main.jsx`
- [Source library](https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx): `src/main.jsx`
- [Tutor and study modes](https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx): `src/main.jsx`
- [Notes and recall](https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx): `src/main.jsx`
- [Study Buddy voice](https://github.com/alsoufi0/dentalec/blob/main/src/main.jsx): `src/main.jsx`

### Tutor services

- [Application API](https://github.com/alsoufi0/dentalec/blob/main/server/index.js): `server/index.js`
- [Dental learning engines](https://github.com/alsoufi0/dentalec/blob/main/server/dentalosEngines.js): `server/dentalosEngines.js`

### Accounts and state

- [Sign-in and sessions](https://github.com/alsoufi0/dentalec/blob/main/server/index.js): `server/index.js`
- [Saved study state](https://github.com/alsoufi0/dentalec/blob/main/server/index.js): `server/index.js`
- [Postgres persistence](https://github.com/alsoufi0/dentalec/blob/main/db/schema.sql): `db/schema.sql`

### Radiology learning

- [Radiology pages](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/index.jsx): `src/radiology/index.jsx`
- [Teaching case library](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/CaseLibrary.jsx): `src/radiology/CaseLibrary.jsx`
- [Case manifest](https://github.com/alsoufi0/dentalec/blob/main/public/radiology/manifest.json): `public/radiology/manifest.json`
- [Uploaded X-rays](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/userCases.js): `src/radiology/userCases.js`
- [Radiograph viewer](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/RadiologyViewer.jsx): `src/radiology/RadiologyViewer.jsx`
- [X-ray interpreter](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/XrayInterpreter.jsx): `src/radiology/XrayInterpreter.jsx`
- [Interpretation feedback API](https://github.com/alsoufi0/dentalec/blob/main/server/index.js): `server/index.js`
- [Radiology bookmarks](https://github.com/alsoufi0/dentalec/blob/main/src/radiology/useLocalStore.js): `src/radiology/useLocalStore.js`

### Other components

- **Student**
- **Professor**
- **OpenAI services**
- **Hosted source search**
- **Browser speech APIs**
- **Browser local storage**

## Connections

- Student → Study workspace: uses
- Professor → Study workspace: uses
- Study workspace → Source library: opens
- Source library → Application API: uploads sources
- Application API → Hosted source search: indexes and searches
- Application API → OpenAI services: requests tutoring
- Study workspace → Tutor and study modes: selects study modes
- Tutor and study modes → Application API: requests answers
- Application API → Dental learning engines: gets engine prompts
- Tutor and study modes → Notes and recall: creates study aids
- Study workspace → Study Buddy voice: starts voice study
- Study Buddy voice → Browser speech APIs: uses speech recognition
- Study Buddy voice → Application API: sends questions
- Application API → OpenAI services: transcribes and speaks
- Study workspace → Sign-in and sessions: signs in
- Sign-in and sessions → Saved study state: loads and saves
- Saved study state → Postgres persistence: persists optionally
- Study workspace → Radiology pages: opens radiology
- Radiology pages → Case manifest: loads cases
- Radiology pages → Uploaded X-rays: loads user cases
- Radiology pages → Teaching case library: renders library
- Radiology pages → Radiograph viewer: renders selected case
- Radiology pages → X-ray interpreter: renders interpreter
- Teaching case library → Radiology bookmarks: uses bookmarks
- Radiology bookmarks → Browser local storage: reads and writes
- X-ray interpreter → Interpretation feedback API: requests feedback
- Interpretation feedback API → OpenAI services: evaluates image and reading
