# palamooradithyagoud/opensmile1 architecture

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

- Interactive diagram: https://gitdiagram.com/palamooradithyagoud/opensmile1
- Repository: https://github.com/palamooradithyagoud/opensmile1

## Overview

OpenSmile is a dental-learning platform combining a BDS curriculum and lesson studio, interactive practice labs, clinical simulations, learner support, and a persistence API. A student enters through the web app, navigates curriculum or practice, and receives lesson content or simulation feedback; progress and attempts can be saved locally and synchronized to the backend. The README documents the FastAPI-to-Supabase architecture. Several frontend-to-backend connections are only visible as API calls or documented capabilities; unsampled route details are not inferred.

Main entry points: [`frontend/src/App.tsx`](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/App.tsx) (Portal and roadmap), [`backend/app/main.py`](https://github.com/palamooradithyagoud/opensmile1/blob/main/backend/app/main.py) (FastAPI endpoints), [`frontend/src/components/ChapterLearningView.tsx`](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ChapterLearningView.tsx) (Chapter learning studio), [`frontend/src/pages/SimPreview.tsx`](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/pages/SimPreview.tsx) (Simulation workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Learning frontend"]
  node_app["Portal and roadmap<br/>[App.tsx]"]
  node_learning["Chapter learning studio"]
  node_anatomy["Anatomy animation"]
  node_materials["Materials animation"]
  node_mux_config["Mux lesson configuration<br/>[mux.ts]"]
end

subgraph group_practice["Practice and simulation"]
  node_morphology["Morphology game"]
  node_tissue["Tissue explorer"]
  node_materials_lab["Materials lab"]
  node_sim_workspace["Simulation workspace<br/>[SimPreview.tsx]"]
  node_sim_scene["Clinical simulation scenes"]
  node_sim_effects["Bleeding effects"]
  node_sim_audio_controller["Simulation sound controller"]
  node_sim_audio["Simulation audio<br/>[simAudio.ts]"]
  node_ortho["Orthodontic biometrics<br/>[orthoBiometrics.ts]"]
  node_sim_state["Simulation state<br/>[useSimStore.ts]"]
end

subgraph group_support["Learner support"]
  node_mentor["AI mentor drawer<br/>[AiMentorDrawer.tsx]"]
  node_mentor_service["Mentor service"]
  node_knowledge["BDS knowledge base"]
  node_free_courses["Free courses"]
  node_dashboard["Learner dashboard"]
end

subgraph group_backend["API service"]
  node_api["FastAPI endpoints<br/>[main.py]"]
  node_youtube["YouTube lecture search<br/>[youtube_service.py]"]
end

subgraph group_persistence["Persistence"]
  node_storage[("Learner profile storage")]
  node_db_connection["SQLAlchemy connection<br/>[connection.py]"]
  node_db_models["Database models<br/>[models.py]"]
end

node_student(("Dental student"))
node_mux["Mux video service"]
node_postgres[("Supabase PostgreSQL")]

node_student -->|"opens portal"| node_app
node_app -->|"opens lessons"| node_learning
node_app -->|"offers practice"| node_morphology
node_app -->|"offers practice"| node_tissue
node_app -->|"offers practice"| node_materials_lab
node_app -->|"routes to"| node_sim_workspace
node_app -->|"opens courses"| node_free_courses
node_app -->|"shows dashboard"| node_dashboard
node_learning -->|"renders"| node_anatomy
node_learning -->|"renders"| node_materials
node_learning -->|"loads playback config"| node_mux_config
node_mux_config -->|"configures playback"| node_mux
node_sim_workspace -->|"reads simulation state"| node_sim_state
node_sim_workspace -->|"renders scene"| node_sim_scene
node_sim_workspace -->|"mounts controller"| node_sim_audio_controller
node_sim_state -->|"computes alignment"| node_ortho
node_sim_state -->|"records attempts"| node_storage
node_sim_audio_controller -->|"plays cues"| node_sim_audio
node_mentor -->|"requests responses"| node_mentor_service
node_mentor_service -->|"retrieves context"| node_knowledge
node_mentor_service -->|"posts chat request"| node_api
node_dashboard -->|"reads metrics"| node_sim_state
node_dashboard -->|"loads saved data"| node_storage
node_storage -->|"syncs attempts"| node_api
node_api -->|"uses lecture search"| node_youtube
node_api -->|"obtains sessions"| node_db_connection
node_api -->|"queries records"| node_db_models
node_db_connection -->|"connects to"| node_postgres
node_db_models -->|"uses ORM base"| node_db_connection
node_api -->|"reads and writes"| node_postgres

click node_app "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/App.tsx"
click node_learning "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ChapterLearningView.tsx"
click node_anatomy "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/DentalAnatomyAnimation.tsx"
click node_materials "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/DentalMaterialsAnimation.tsx"
click node_morphology "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ToothMorphologyGame.tsx"
click node_tissue "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/EnamelDentinPulpGame.tsx"
click node_materials_lab "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/DentalMaterialsLabGame.tsx"
click node_sim_workspace "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/pages/SimPreview.tsx"
click node_sim_scene "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/OperationVisuals.tsx"
click node_sim_effects "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/RealisticBleedEffects.tsx"
click node_sim_audio_controller "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/SimSoundController.tsx"
click node_sim_audio "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/simAudio.ts"
click node_ortho "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/orthoBiometrics.ts"
click node_sim_state "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/store/useSimStore.ts"
click node_mentor "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/mentor/AiMentorDrawer.tsx"
click node_mentor_service "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/services/groqMentorService.ts"
click node_knowledge "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/data/bdsKnowledgeBase.ts"
click node_free_courses "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/FreeCoursesView.tsx"
click node_dashboard "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ui/ProfileDashboardPanel.tsx"
click node_storage "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/utils/studentProfileStorage.ts"
click node_mux_config "https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/config/mux.ts"
click node_api "https://github.com/palamooradithyagoud/opensmile1/blob/main/backend/app/main.py"
click node_youtube "https://github.com/palamooradithyagoud/opensmile1/blob/main/backend/app/youtube_service.py"
click node_db_connection "https://github.com/palamooradithyagoud/opensmile1/blob/main/database/connection.py"
click node_db_models "https://github.com/palamooradithyagoud/opensmile1/blob/main/database/models.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_app,node_learning,node_anatomy,node_materials,node_mux_config toneBlue
class node_morphology,node_tissue,node_materials_lab,node_sim_workspace,node_sim_scene,node_sim_effects,node_sim_audio_controller,node_sim_audio,node_ortho,node_sim_state,node_postgres toneAmber
class node_mentor,node_mentor_service,node_knowledge,node_free_courses,node_dashboard toneMint
class node_api,node_youtube toneRose
class node_storage,node_db_connection,node_db_models,node_student,node_mux toneIndigo
```

## Components

### Learning frontend

- [Portal and roadmap](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Chapter learning studio](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ChapterLearningView.tsx): `frontend/src/components/ChapterLearningView.tsx`
- [Anatomy animation](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/DentalAnatomyAnimation.tsx): `frontend/src/components/DentalAnatomyAnimation.tsx`
- [Materials animation](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/DentalMaterialsAnimation.tsx): `frontend/src/components/DentalMaterialsAnimation.tsx`
- [Mux lesson configuration](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/config/mux.ts): `frontend/src/config/mux.ts`

### Practice and simulation

- [Morphology game](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ToothMorphologyGame.tsx): `frontend/src/components/ToothMorphologyGame.tsx`
- [Tissue explorer](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/EnamelDentinPulpGame.tsx): `frontend/src/components/EnamelDentinPulpGame.tsx`
- [Materials lab](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/DentalMaterialsLabGame.tsx): `frontend/src/components/DentalMaterialsLabGame.tsx`
- [Simulation workspace](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/pages/SimPreview.tsx): `frontend/src/pages/SimPreview.tsx`
- [Clinical simulation scenes](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/OperationVisuals.tsx): `frontend/src/components/sim/OperationVisuals.tsx`
- [Bleeding effects](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/RealisticBleedEffects.tsx): `frontend/src/components/sim/RealisticBleedEffects.tsx`
- [Simulation sound controller](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/SimSoundController.tsx): `frontend/src/components/sim/SimSoundController.tsx`
- [Simulation audio](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/simAudio.ts): `frontend/src/components/sim/simAudio.ts`
- [Orthodontic biometrics](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/sim/orthoBiometrics.ts): `frontend/src/components/sim/orthoBiometrics.ts`
- [Simulation state](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/store/useSimStore.ts): `frontend/src/store/useSimStore.ts`

### Learner support

- [AI mentor drawer](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/mentor/AiMentorDrawer.tsx): `frontend/src/components/mentor/AiMentorDrawer.tsx`
- [Mentor service](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/services/groqMentorService.ts): `frontend/src/services/groqMentorService.ts`
- [BDS knowledge base](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/data/bdsKnowledgeBase.ts): `frontend/src/data/bdsKnowledgeBase.ts`
- [Free courses](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/FreeCoursesView.tsx): `frontend/src/components/FreeCoursesView.tsx`
- [Learner dashboard](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/components/ui/ProfileDashboardPanel.tsx): `frontend/src/components/ui/ProfileDashboardPanel.tsx`

### API service

- [FastAPI endpoints](https://github.com/palamooradithyagoud/opensmile1/blob/main/backend/app/main.py): `backend/app/main.py`
- [YouTube lecture search](https://github.com/palamooradithyagoud/opensmile1/blob/main/backend/app/youtube_service.py): `backend/app/youtube_service.py`

### Persistence

- [Learner profile storage](https://github.com/palamooradithyagoud/opensmile1/blob/main/frontend/src/utils/studentProfileStorage.ts): `frontend/src/utils/studentProfileStorage.ts`
- [SQLAlchemy connection](https://github.com/palamooradithyagoud/opensmile1/blob/main/database/connection.py): `database/connection.py`
- [Database models](https://github.com/palamooradithyagoud/opensmile1/blob/main/database/models.py): `database/models.py`

### Other components

- **Dental student**
- **Mux video service**
- **Supabase PostgreSQL**

## Connections

- Dental student → Portal and roadmap: opens portal (evidence: `README.md`)
- Portal and roadmap → Chapter learning studio: opens lessons (evidence: `frontend/src/App.tsx`)
- Portal and roadmap → Morphology game: offers practice (evidence: `frontend/src/App.tsx`)
- Portal and roadmap → Tissue explorer: offers practice (evidence: `frontend/src/App.tsx`)
- Portal and roadmap → Materials lab: offers practice (evidence: `frontend/src/App.tsx`)
- Portal and roadmap → Simulation workspace: routes to (evidence: `frontend/src/App.tsx`)
- Portal and roadmap → Free courses: opens courses (evidence: `frontend/src/App.tsx`)
- Portal and roadmap → Learner dashboard: shows dashboard (evidence: `frontend/src/App.tsx`)
- Chapter learning studio → Anatomy animation: renders (evidence: `frontend/src/components/ChapterLearningView.tsx`)
- Chapter learning studio → Materials animation: renders (evidence: `frontend/src/components/ChapterLearningView.tsx`)
- Chapter learning studio → Mux lesson configuration: loads playback config (evidence: `frontend/src/components/ChapterLearningView.tsx`)
- Mux lesson configuration → Mux video service: configures playback (evidence: `README.md`)
- Simulation workspace → Simulation state: reads simulation state (evidence: `frontend/src/pages/SimPreview.tsx`)
- Simulation workspace → Clinical simulation scenes: renders scene (evidence: `frontend/src/pages/SimPreview.tsx`)
- Simulation workspace → Simulation sound controller: mounts controller (evidence: `frontend/src/pages/SimPreview.tsx`)
- Simulation state → Orthodontic biometrics: computes alignment (evidence: `frontend/src/store/useSimStore.ts`)
- Simulation state → Learner profile storage: records attempts (evidence: `frontend/src/store/useSimStore.ts`)
- Simulation sound controller → Simulation audio: plays cues (evidence: `frontend/src/components/sim/SimSoundController.tsx`)
- AI mentor drawer → Mentor service: requests responses (evidence: `frontend/src/components/mentor/AiMentorDrawer.tsx`)
- Mentor service → BDS knowledge base: retrieves context (evidence: `frontend/src/services/groqMentorService.ts`)
- Mentor service → FastAPI endpoints: posts chat request (evidence: `frontend/src/services/groqMentorService.ts`)
- Learner dashboard → Simulation state: reads metrics (evidence: `frontend/src/components/ui/ProfileDashboardPanel.tsx`)
- Learner dashboard → Learner profile storage: loads saved data (evidence: `frontend/src/components/ui/ProfileDashboardPanel.tsx`)
- Learner profile storage → FastAPI endpoints: syncs attempts (evidence: `frontend/src/utils/studentProfileStorage.ts`)
- FastAPI endpoints → YouTube lecture search: uses lecture search (evidence: `backend/app/main.py`)
- FastAPI endpoints → SQLAlchemy connection: obtains sessions (evidence: `README.md`)
- FastAPI endpoints → Database models: queries records (evidence: `README.md`)
- SQLAlchemy connection → Supabase PostgreSQL: connects to (evidence: `database/connection.py`)
- Database models → SQLAlchemy connection: uses ORM base (evidence: `database/models.py`)
- FastAPI endpoints → Supabase PostgreSQL: reads and writes (evidence: `README.md`)
