# elatedpk/forgex-ai architecture

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

- Interactive diagram: https://gitdiagram.com/elatedpk/forgex-ai
- Repository: https://github.com/elatedpk/forgex-ai

## Overview

CogniFix is an adaptive STEM tutoring application: learners practice or upload marked work, receive misconception diagnosis and targeted remediation, then review progress through flashcards, knowledge maps, and roadmaps. Teachers have a separate class-analytics portal. The React entry point and several API calls are visible in excerpts; the README documents backend agents and integrations, but server.ts was not sampled, so backend links reflect documented architecture rather than inspected implementation.

Main entry points: [`src/App.tsx`](https://github.com/elatedpk/forgex-ai/blob/main/src/App.tsx) (App coordinator), [`server.ts`](https://github.com/elatedpk/forgex-ai/blob/main/server.ts) (Misconception diagnosis), [`src/components/PracticeQuizView.tsx`](https://github.com/elatedpk/forgex-ai/blob/main/src/components/PracticeQuizView.tsx) (Practice quiz), [`src/components/RoadmapView.tsx`](https://github.com/elatedpk/forgex-ai/blob/main/src/components/RoadmapView.tsx) (Skill roadmaps)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Learner application"]
  node_app_entry["React entry<br/>[main.tsx]"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_landing["Landing and sign-in<br/>[LandingView.tsx]"]
  node_auth["Authentication modal<br/>[AuthModal.tsx]"]
  node_dashboard["Student dashboard<br/>[DashboardView.tsx]"]
end

subgraph group_learning["Adaptive learning"]
  node_practice["Practice quiz"]
  node_flashcards["Spaced flashcards<br/>[FlashcardsView.tsx]"]
  node_mindmap["Knowledge mind map<br/>[MindMapView.tsx]"]
  node_roadmap["Skill roadmaps<br/>[RoadmapView.tsx]"]
end

subgraph group_backend["AI and services"]
  node_diagnosis{{"Misconception diagnosis<br/>[server.ts]"}}
  node_remediation{{"Remediation generation<br/>[server.ts]"}}
  node_upload_analysis{{"Uploaded-work analysis<br/>[server.ts]"}}
end

subgraph group_teaching["Teacher tools"]
  node_teacher_portal["Class analytics"]
end

node_student(("Student"))
node_teacher(("Teacher"))
node_ai_models{{"Groq / Gemini"}}
node_web_search["DuckDuckGo search"]
node_supabase[("Supabase platform")]

node_student -->|"opens app"| node_app_entry
node_app_entry -->|"renders"| node_app
node_app -->|"renders"| node_landing
node_app -->|"renders"| node_auth
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_practice
node_app -->|"renders"| node_flashcards
node_app -->|"renders"| node_mindmap
node_app -->|"renders"| node_roadmap
node_app -->|"renders"| node_teacher_portal
node_student -->|"answers questions"| node_practice
node_practice -->|"submits responses"| node_diagnosis
node_diagnosis -->|"flags misconception"| node_remediation
node_remediation -->|"uses models"| node_ai_models
node_dashboard -->|"requests diagnosis"| node_upload_analysis
node_app -->|"sends upload diagnosis"| node_upload_analysis
node_upload_analysis -->|"uses vision models"| node_ai_models
node_app -->|"requests map data"| node_mindmap
node_roadmap -->|"grounds resources"| node_web_search
node_diagnosis -->|"persists learning data"| node_supabase
node_student -->|"reviews concepts"| node_flashcards
node_student -->|"chooses skill"| node_roadmap
node_teacher -->|"reviews class"| node_teacher_portal
node_teacher_portal -.->|"reads class data"| node_supabase

click node_app_entry "https://github.com/elatedpk/forgex-ai/blob/main/src/main.tsx"
click node_app "https://github.com/elatedpk/forgex-ai/blob/main/src/App.tsx"
click node_landing "https://github.com/elatedpk/forgex-ai/blob/main/src/components/LandingView.tsx"
click node_auth "https://github.com/elatedpk/forgex-ai/blob/main/src/components/AuthModal.tsx"
click node_dashboard "https://github.com/elatedpk/forgex-ai/blob/main/src/components/DashboardView.tsx"
click node_practice "https://github.com/elatedpk/forgex-ai/blob/main/src/components/PracticeQuizView.tsx"
click node_diagnosis "https://github.com/elatedpk/forgex-ai/blob/main/server.ts"
click node_remediation "https://github.com/elatedpk/forgex-ai/blob/main/server.ts"
click node_upload_analysis "https://github.com/elatedpk/forgex-ai/blob/main/server.ts"
click node_flashcards "https://github.com/elatedpk/forgex-ai/blob/main/src/components/FlashcardsView.tsx"
click node_mindmap "https://github.com/elatedpk/forgex-ai/blob/main/src/components/MindMapView.tsx"
click node_roadmap "https://github.com/elatedpk/forgex-ai/blob/main/src/components/RoadmapView.tsx"
click node_teacher_portal "https://github.com/elatedpk/forgex-ai/blob/main/src/components/TeacherPortalView.tsx"

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_entry,node_app,node_landing,node_auth,node_dashboard toneBlue
class node_practice,node_flashcards,node_mindmap,node_roadmap,node_supabase toneAmber
class node_diagnosis,node_remediation,node_upload_analysis toneMint
class node_teacher_portal toneRose
class node_student,node_teacher,node_ai_models,node_web_search toneIndigo
```

## Components

### Learner application

- [React entry](https://github.com/elatedpk/forgex-ai/blob/main/src/main.tsx): `src/main.tsx`
- [App coordinator](https://github.com/elatedpk/forgex-ai/blob/main/src/App.tsx): `src/App.tsx`
- [Landing and sign-in](https://github.com/elatedpk/forgex-ai/blob/main/src/components/LandingView.tsx): `src/components/LandingView.tsx`
- [Authentication modal](https://github.com/elatedpk/forgex-ai/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`
- [Student dashboard](https://github.com/elatedpk/forgex-ai/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`

### Adaptive learning

- [Practice quiz](https://github.com/elatedpk/forgex-ai/blob/main/src/components/PracticeQuizView.tsx): `src/components/PracticeQuizView.tsx`
- [Spaced flashcards](https://github.com/elatedpk/forgex-ai/blob/main/src/components/FlashcardsView.tsx): `src/components/FlashcardsView.tsx`
- [Knowledge mind map](https://github.com/elatedpk/forgex-ai/blob/main/src/components/MindMapView.tsx): `src/components/MindMapView.tsx`
- [Skill roadmaps](https://github.com/elatedpk/forgex-ai/blob/main/src/components/RoadmapView.tsx): `src/components/RoadmapView.tsx`

### AI and services

- [Misconception diagnosis](https://github.com/elatedpk/forgex-ai/blob/main/server.ts): `server.ts`
- [Remediation generation](https://github.com/elatedpk/forgex-ai/blob/main/server.ts): `server.ts`
- [Uploaded-work analysis](https://github.com/elatedpk/forgex-ai/blob/main/server.ts): `server.ts`

### Teacher tools

- [Class analytics](https://github.com/elatedpk/forgex-ai/blob/main/src/components/TeacherPortalView.tsx): `src/components/TeacherPortalView.tsx`

### Other components

- **Student**
- **Teacher**
- **Groq / Gemini**
- **DuckDuckGo search**
- **Supabase platform**

## Connections

- Student → React entry: opens app (evidence: `README.md`)
- React entry → App coordinator: renders (evidence: `src/main.tsx`)
- App coordinator → Landing and sign-in: renders (evidence: `src/App.tsx`)
- App coordinator → Authentication modal: renders (evidence: `src/App.tsx`)
- App coordinator → Student dashboard: renders (evidence: `src/App.tsx`)
- App coordinator → Practice quiz: renders (evidence: `src/App.tsx`)
- App coordinator → Spaced flashcards: renders (evidence: `src/App.tsx`)
- App coordinator → Knowledge mind map: renders (evidence: `src/App.tsx`)
- App coordinator → Skill roadmaps: renders (evidence: `src/App.tsx`)
- App coordinator → Class analytics: renders (evidence: `src/App.tsx`)
- Student → Practice quiz: answers questions (evidence: `README.md`)
- Practice quiz → Misconception diagnosis: submits responses (evidence: `README.md`)
- Misconception diagnosis → Remediation generation: flags misconception (evidence: `README.md`)
- Remediation generation → Groq / Gemini: uses models (evidence: `README.md`)
- Student dashboard → Uploaded-work analysis: requests diagnosis (evidence: `src/components/DashboardView.tsx`)
- App coordinator → Uploaded-work analysis: sends upload diagnosis (evidence: `src/App.tsx`)
- Uploaded-work analysis → Groq / Gemini: uses vision models (evidence: `README.md`)
- App coordinator → Knowledge mind map: requests map data (evidence: `src/App.tsx`)
- Skill roadmaps → DuckDuckGo search: grounds resources (evidence: `README.md`)
- Misconception diagnosis → Supabase platform: persists learning data (evidence: `README.md`)
- Student → Spaced flashcards: reviews concepts (evidence: `README.md`)
- Student → Skill roadmaps: chooses skill (evidence: `README.md`)
- Teacher → Class analytics: reviews class (evidence: `README.md`)
- Class analytics → Supabase platform: reads class data
