# iron00036gmail/medha-protype architecture

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

- Interactive diagram: https://gitdiagram.com/iron00036gmail/medha-protype
- Repository: https://github.com/iron00036gmail/medha-protype

## Overview

MEDHA is a subject-centered learning and memory application. A learner enters through the home dashboard or subject navigation, opens a subject workspace, and works its knowledge spine through lecture capture, concept teaching, mathematical exploration, and spaced recall. The application coordinator supplies seed learning data and routes among these views; the workspace delegates to its distinct learning tools. Authentication uses server endpoints and SQLite, while retention scheduling and AI-assisted learning are supporting capabilities. Some subsystem links reflect README descriptions or indexed imports; unsampled internals are not inferred.

Main entry points: [`src/components/subject/SubjectWorkspace.tsx`](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectWorkspace.tsx) (Subject workspace), [`src/App.tsx`](https://github.com/iron00036gmail/medha-protype/blob/main/src/App.tsx) (App coordinator), [`src/components/HomeDashboard.tsx`](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/HomeDashboard.tsx) (Home dashboard), [`src/components/TopNav.tsx`](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/TopNav.tsx) (Subject navigation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application shell"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_home["Home dashboard<br/>[HomeDashboard.tsx]"]
  node_navigation["Subject navigation<br/>[TopNav.tsx]"]
end

subgraph group_learning["Subject learning"]
  node_workspace["Subject workspace"]
  node_roadmap["Knowledge spine<br/>[RoadmapTree.tsx]"]
  node_lecture["Lecture ingestion"]
  node_teach["Teach and master"]
  node_tutor["Socratic tutor<br/>[SubjectAiChat.tsx]"]
  node_island["Workspace dial"]
end

subgraph group_memory["Recall and planning"]
  node_recall["Active recall"]
  node_scheduler["Review scheduler<br/>[scheduler.ts]"]
  node_assignments["Assignment pacing"]
  node_daily["Daily cockpit<br/>[DailyCockpit.tsx]"]
end

subgraph group_knowledge["Knowledge exploration"]
  node_ecosystem["Interdisciplinary graph"]
  node_complexity["Complexity explorer"]
  node_concept["Concept detail"]
  node_formula["Formula renderer<br/>[MathFormula.tsx]"]
  node_next["Next concept preview<br/>[WhatsNextHover.tsx]"]
end

subgraph group_platform["Data and services"]
  node_seed["Learning seed data<br/>[initialData.ts]"]
  node_api["Learning API client<br/>[api.ts]"]
  node_auth["Authentication context<br/>[AuthContext.tsx]"]
  node_authui["Scholar sign-in"]
  node_server["API server<br/>[server.ts]"]
  node_dbhelper["SQLite access<br/>[db.ts]"]
  node_database[("SQLite database<br/>[medha.sqlite]")]
  node_theme["Theme context<br/>[ThemeContext.tsx]"]
  node_focus["Focus navigation<br/>[navigation.ts]"]
end

node_learner(("Learner"))

node_learner -->|"opens overview"| node_home
node_learner -->|"selects subject"| node_navigation
node_navigation -->|"selects view"| node_app
node_app -->|"renders"| node_home
node_app -->|"routes to"| node_workspace
node_app -->|"renders"| node_navigation
node_app -->|"initializes state"| node_seed
node_app -->|"focuses destination"| node_focus
node_home -->|"renders graph"| node_ecosystem
node_workspace -->|"renders spine"| node_roadmap
node_workspace -->|"renders ingest"| node_lecture
node_workspace -->|"renders workbench"| node_teach
node_workspace -->|"renders tutor"| node_tutor
node_workspace -->|"renders dial"| node_island
node_workspace -->|"renders arena"| node_recall
node_workspace -->|"renders explorer"| node_complexity
node_workspace -->|"renders detail"| node_concept
node_workspace -->|"renders formulas"| node_formula
node_workspace -->|"renders preview"| node_next
node_lecture -->|"chunks notes"| node_api
node_lecture -->|"transcribes audio"| node_api
node_assignments -->|"decomposes tasks"| node_api
node_recall -->|"schedules reviews"| node_scheduler
node_assignments -->|"appears in routing"| node_app
node_home -->|"uses ecosystem data"| node_seed
node_navigation -->|"reads theme"| node_theme
node_navigation -->|"opens sign-in"| node_auth
node_authui -->|"uses context"| node_auth
node_auth -->|"calls auth endpoints"| node_server
node_server -->|"uses database access"| node_dbhelper
node_dbhelper -.->|"reads and writes"| node_database
node_home -->|"navigates sections"| node_focus
node_ecosystem -->|"renders equations"| node_formula
node_roadmap -->|"renders equations"| node_formula
node_roadmap -->|"previews sequence"| node_next

click node_app "https://github.com/iron00036gmail/medha-protype/blob/main/src/App.tsx"
click node_home "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/HomeDashboard.tsx"
click node_navigation "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/TopNav.tsx"
click node_workspace "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectWorkspace.tsx"
click node_roadmap "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/RoadmapTree.tsx"
click node_lecture "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/ClassInputIngest.tsx"
click node_teach "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/ConceptTeachMaster.tsx"
click node_tutor "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectAiChat.tsx"
click node_island "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectDynamicIsland.tsx"
click node_recall "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/ActiveRecallArena.tsx"
click node_scheduler "https://github.com/iron00036gmail/medha-protype/blob/main/src/services/scheduler.ts"
click node_assignments "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/AssignmentGentleManager.tsx"
click node_daily "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/DailyCockpit.tsx"
click node_ecosystem "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/EcosystemRoadmap.tsx"
click node_complexity "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SystemComplexityExplorer.tsx"
click node_concept "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/ConceptDetailPane.tsx"
click node_formula "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/common/MathFormula.tsx"
click node_next "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/common/WhatsNextHover.tsx"
click node_seed "https://github.com/iron00036gmail/medha-protype/blob/main/src/data/initialData.ts"
click node_api "https://github.com/iron00036gmail/medha-protype/blob/main/src/services/api.ts"
click node_auth "https://github.com/iron00036gmail/medha-protype/blob/main/src/context/AuthContext.tsx"
click node_authui "https://github.com/iron00036gmail/medha-protype/blob/main/src/components/common/SqliteAuthModal.tsx"
click node_server "https://github.com/iron00036gmail/medha-protype/blob/main/server.ts"
click node_dbhelper "https://github.com/iron00036gmail/medha-protype/blob/main/src/server/db.ts"
click node_database "https://github.com/iron00036gmail/medha-protype/blob/main/data/medha.sqlite"
click node_theme "https://github.com/iron00036gmail/medha-protype/blob/main/src/context/ThemeContext.tsx"
click node_focus "https://github.com/iron00036gmail/medha-protype/blob/main/src/services/navigation.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_app,node_home,node_navigation toneBlue
class node_workspace,node_roadmap,node_lecture,node_teach,node_tutor,node_island toneAmber
class node_recall,node_scheduler,node_assignments,node_daily toneMint
class node_ecosystem,node_complexity,node_concept,node_formula,node_next toneRose
class node_seed,node_api,node_auth,node_authui,node_server,node_dbhelper,node_database,node_theme,node_focus,node_learner toneIndigo
```

## Components

### Application shell

- [App coordinator](https://github.com/iron00036gmail/medha-protype/blob/main/src/App.tsx): `src/App.tsx`
- [Home dashboard](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/HomeDashboard.tsx): `src/components/HomeDashboard.tsx`
- [Subject navigation](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/TopNav.tsx): `src/components/TopNav.tsx`

### Subject learning

- [Subject workspace](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectWorkspace.tsx): `src/components/subject/SubjectWorkspace.tsx`
- [Knowledge spine](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/RoadmapTree.tsx): `src/components/subject/RoadmapTree.tsx`
- [Lecture ingestion](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/ClassInputIngest.tsx): `src/components/subject/ClassInputIngest.tsx`
- [Teach and master](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/ConceptTeachMaster.tsx): `src/components/subject/ConceptTeachMaster.tsx`
- [Socratic tutor](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectAiChat.tsx): `src/components/subject/SubjectAiChat.tsx`
- [Workspace dial](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SubjectDynamicIsland.tsx): `src/components/subject/SubjectDynamicIsland.tsx`

### Recall and planning

- [Active recall](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/ActiveRecallArena.tsx): `src/components/ActiveRecallArena.tsx`
- [Review scheduler](https://github.com/iron00036gmail/medha-protype/blob/main/src/services/scheduler.ts): `src/services/scheduler.ts`
- [Assignment pacing](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/AssignmentGentleManager.tsx): `src/components/AssignmentGentleManager.tsx`
- [Daily cockpit](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/DailyCockpit.tsx): `src/components/DailyCockpit.tsx`

### Knowledge exploration

- [Interdisciplinary graph](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/EcosystemRoadmap.tsx): `src/components/EcosystemRoadmap.tsx`
- [Complexity explorer](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/SystemComplexityExplorer.tsx): `src/components/subject/SystemComplexityExplorer.tsx`
- [Concept detail](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/subject/ConceptDetailPane.tsx): `src/components/subject/ConceptDetailPane.tsx`
- [Formula renderer](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/common/MathFormula.tsx): `src/components/common/MathFormula.tsx`
- [Next concept preview](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/common/WhatsNextHover.tsx): `src/components/common/WhatsNextHover.tsx`

### Data and services

- [Learning seed data](https://github.com/iron00036gmail/medha-protype/blob/main/src/data/initialData.ts): `src/data/initialData.ts`
- [Learning API client](https://github.com/iron00036gmail/medha-protype/blob/main/src/services/api.ts): `src/services/api.ts`
- [Authentication context](https://github.com/iron00036gmail/medha-protype/blob/main/src/context/AuthContext.tsx): `src/context/AuthContext.tsx`
- [Scholar sign-in](https://github.com/iron00036gmail/medha-protype/blob/main/src/components/common/SqliteAuthModal.tsx): `src/components/common/SqliteAuthModal.tsx`
- [API server](https://github.com/iron00036gmail/medha-protype/blob/main/server.ts): `server.ts`
- [SQLite access](https://github.com/iron00036gmail/medha-protype/blob/main/src/server/db.ts): `src/server/db.ts`
- [SQLite database](https://github.com/iron00036gmail/medha-protype/blob/main/data/medha.sqlite): `data/medha.sqlite`
- [Theme context](https://github.com/iron00036gmail/medha-protype/blob/main/src/context/ThemeContext.tsx): `src/context/ThemeContext.tsx`
- [Focus navigation](https://github.com/iron00036gmail/medha-protype/blob/main/src/services/navigation.ts): `src/services/navigation.ts`

### Other components

- **Learner**

## Connections

- Learner → Home dashboard: opens overview (evidence: `README.md`)
- Learner → Subject navigation: selects subject (evidence: `README.md`)
- Subject navigation → App coordinator: selects view (evidence: `src/components/TopNav.tsx`)
- App coordinator → Home dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Subject workspace: routes to (evidence: `src/App.tsx`)
- App coordinator → Subject navigation: renders (evidence: `src/App.tsx`)
- App coordinator → Learning seed data: initializes state (evidence: `src/App.tsx`)
- App coordinator → Focus navigation: focuses destination (evidence: `src/App.tsx`)
- Home dashboard → Interdisciplinary graph: renders graph (evidence: `src/components/HomeDashboard.tsx`)
- Subject workspace → Knowledge spine: renders spine (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Lecture ingestion: renders ingest (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Teach and master: renders workbench (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Socratic tutor: renders tutor (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Workspace dial: renders dial (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Active recall: renders arena (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Complexity explorer: renders explorer (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Concept detail: renders detail (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Formula renderer: renders formulas (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Subject workspace → Next concept preview: renders preview (evidence: `src/components/subject/SubjectWorkspace.tsx`)
- Lecture ingestion → Learning API client: chunks notes (evidence: `src/components/subject/ClassInputIngest.tsx`)
- Lecture ingestion → Learning API client: transcribes audio (evidence: `src/components/subject/ClassInputIngest.tsx`)
- Assignment pacing → Learning API client: decomposes tasks (evidence: `src/components/AssignmentGentleManager.tsx`)
- Active recall → Review scheduler: schedules reviews (evidence: `src/components/ActiveRecallArena.tsx`)
- Assignment pacing → App coordinator: appears in routing (evidence: `src/App.tsx`)
- Home dashboard → Learning seed data: uses ecosystem data (evidence: `src/components/HomeDashboard.tsx`)
- Subject navigation → Theme context: reads theme (evidence: `src/components/TopNav.tsx`)
- Subject navigation → Authentication context: opens sign-in (evidence: `src/components/TopNav.tsx`)
- Scholar sign-in → Authentication context: uses context (evidence: `src/components/common/SqliteAuthModal.tsx`)
- Authentication context → API server: calls auth endpoints (evidence: `src/context/AuthContext.tsx`)
- API server → SQLite access: uses database access (evidence: `server.ts`)
- SQLite access → SQLite database: reads and writes
- Home dashboard → Focus navigation: navigates sections (evidence: `src/components/HomeDashboard.tsx`)
- Interdisciplinary graph → Formula renderer: renders equations (evidence: `src/components/EcosystemRoadmap.tsx`)
- Knowledge spine → Formula renderer: renders equations (evidence: `src/components/subject/RoadmapTree.tsx`)
- Knowledge spine → Next concept preview: previews sequence (evidence: `src/components/subject/RoadmapTree.tsx`)
