# subhashdoc234xyz/cognifix architecture

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

- Interactive diagram: https://gitdiagram.com/subhashdoc234xyz/cognifix
- Repository: https://github.com/subhashdoc234xyz/cognifix

## Overview

CogniFix is an adaptive STEM tutoring web application. A learner practices or uploads marked work; the backend diagnoses misconceptions and generates targeted remediation, while the app presents mastery and follow-up study tools. The README documents the agent and integration architecture, but the backend source was not excerpted, so backend relationships below cite that documentation rather than implying its internals were inspected.

Main entry points: [`src/App.tsx`](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/App.tsx) (View orchestration), [`server.ts`](https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts) (Misconception diagnosis), [`src/components/DashboardView.tsx`](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/DashboardView.tsx) (Learning dashboard), [`src/main.tsx`](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/main.tsx) (React application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_browser["React application<br/>[main.tsx]"]
  node_app["View orchestration<br/>[App.tsx]"]
  node_landing["Landing page<br/>[LandingView.tsx]"]
  node_auth["Google sign-in<br/>[AuthModal.tsx]"]
end

subgraph group_learning["Learner study tools"]
  node_dashboard["Learning dashboard<br/>[DashboardView.tsx]"]
  node_practice["Practice and diagnosis"]
  node_flashcards["Spaced flashcards<br/>[FlashcardsView.tsx]"]
  node_mindmap["Knowledge mind map<br/>[MindMapView.tsx]"]
  node_roadmap["Skill roadmaps<br/>[RoadmapView.tsx]"]
  node_teacher["Teacher analytics"]
end

subgraph group_services["Learning services"]
  node_diagnoser["Misconception diagnosis<br/>[server.ts]"]
  node_generator["Remediation generation<br/>[server.ts]"]
  node_explainer["Socratic explanations<br/>[server.ts]"]
  node_roadmap_agent["Roadmap generation<br/>[server.ts]"]
  node_document_agent["Document analysis<br/>[server.ts]"]
end

subgraph group_platform["Identity and data"]
  node_google["Google OAuth"]
  node_groq_gemini["LLM providers"]
  node_duckduckgo["DuckDuckGo search"]
  node_supabase[("Supabase storage and database")]
  node_seed_data["Initial learning data<br/>[initialData.ts]"]
end

node_learner(("Student or teacher"))

node_learner -->|"uses"| node_browser
node_browser -->|"renders"| node_app
node_app -->|"selects view"| node_landing
node_app -->|"opens sign-in"| node_auth
node_auth -->|"redirects to"| node_google
node_app -->|"selects view"| node_dashboard
node_app -->|"selects view"| node_practice
node_app -->|"selects view"| node_flashcards
node_app -->|"selects view"| node_mindmap
node_app -->|"selects view"| node_roadmap
node_app -->|"selects view"| node_teacher
node_app -->|"initializes state"| node_seed_data
node_dashboard -->|"requests upload diagnosis"| node_diagnoser
node_practice -.->|"submits thought trace"| node_diagnoser
node_diagnoser -->|"flags trap for"| node_generator
node_generator -->|"supports remediation"| node_explainer
node_diagnoser -->|"uses models"| node_groq_gemini
node_generator -->|"uses models"| node_groq_gemini
node_explainer -->|"uses models"| node_groq_gemini
node_roadmap -.->|"requests roadmap"| node_roadmap_agent
node_roadmap_agent -->|"grounds resources"| node_duckduckgo
node_dashboard -->|"uploads work for"| node_document_agent
node_document_agent -->|"analyzes with vision"| node_groq_gemini
node_diagnoser -.->|"persists learning data"| node_supabase
node_document_agent -.->|"stores uploads"| node_supabase
node_teacher -.->|"uses class data"| node_supabase
node_app -.->|"uses sessions and data"| node_supabase

click node_browser "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/main.tsx"
click node_app "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/App.tsx"
click node_landing "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/LandingView.tsx"
click node_auth "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/AuthModal.tsx"
click node_dashboard "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/DashboardView.tsx"
click node_practice "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/PracticeQuizView.tsx"
click node_flashcards "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/FlashcardsView.tsx"
click node_mindmap "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/MindMapView.tsx"
click node_roadmap "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/RoadmapView.tsx"
click node_teacher "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/TeacherPortalView.tsx"
click node_diagnoser "https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts"
click node_generator "https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts"
click node_explainer "https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts"
click node_roadmap_agent "https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts"
click node_document_agent "https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts"
click node_seed_data "https://github.com/subhashdoc234xyz/cognifix/blob/main/src/data/initialData.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_browser,node_app,node_landing,node_auth toneBlue
class node_dashboard,node_practice,node_flashcards,node_mindmap,node_roadmap,node_teacher toneAmber
class node_diagnoser,node_generator,node_explainer,node_roadmap_agent,node_document_agent toneMint
class node_google,node_groq_gemini,node_duckduckgo,node_supabase,node_seed_data toneRose
class node_learner toneIndigo
```

## Components

### Application entry

- [React application](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/main.tsx): `src/main.tsx`
- [View orchestration](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/App.tsx): `src/App.tsx`
- [Landing page](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/LandingView.tsx): `src/components/LandingView.tsx`
- [Google sign-in](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/AuthModal.tsx): `src/components/AuthModal.tsx`

### Learner study tools

- [Learning dashboard](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/DashboardView.tsx): `src/components/DashboardView.tsx`
- [Practice and diagnosis](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/PracticeQuizView.tsx): `src/components/PracticeQuizView.tsx`
- [Spaced flashcards](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/FlashcardsView.tsx): `src/components/FlashcardsView.tsx`
- [Knowledge mind map](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/MindMapView.tsx): `src/components/MindMapView.tsx`
- [Skill roadmaps](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/RoadmapView.tsx): `src/components/RoadmapView.tsx`
- [Teacher analytics](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/components/TeacherPortalView.tsx): `src/components/TeacherPortalView.tsx`

### Learning services

- [Misconception diagnosis](https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts): `server.ts`
- [Remediation generation](https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts): `server.ts`
- [Socratic explanations](https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts): `server.ts`
- [Roadmap generation](https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts): `server.ts`
- [Document analysis](https://github.com/subhashdoc234xyz/cognifix/blob/main/server.ts): `server.ts`

### Identity and data

- **Google OAuth**
- **LLM providers**
- **DuckDuckGo search**
- **Supabase storage and database**
- [Initial learning data](https://github.com/subhashdoc234xyz/cognifix/blob/main/src/data/initialData.ts): `src/data/initialData.ts`

### Other components

- **Student or teacher**

## Connections

- Student or teacher → React application: uses (evidence: `README.md`)
- React application → View orchestration: renders (evidence: `src/main.tsx`)
- View orchestration → Landing page: selects view (evidence: `src/App.tsx`)
- View orchestration → Google sign-in: opens sign-in (evidence: `src/App.tsx`)
- Google sign-in → Google OAuth: redirects to (evidence: `src/components/AuthModal.tsx`)
- View orchestration → Learning dashboard: selects view (evidence: `src/App.tsx`)
- View orchestration → Practice and diagnosis: selects view (evidence: `src/App.tsx`)
- View orchestration → Spaced flashcards: selects view (evidence: `src/App.tsx`)
- View orchestration → Knowledge mind map: selects view (evidence: `src/App.tsx`)
- View orchestration → Skill roadmaps: selects view (evidence: `src/App.tsx`)
- View orchestration → Teacher analytics: selects view (evidence: `src/App.tsx`)
- View orchestration → Initial learning data: initializes state (evidence: `src/App.tsx`)
- Learning dashboard → Misconception diagnosis: requests upload diagnosis (evidence: `src/components/DashboardView.tsx`)
- Practice and diagnosis → Misconception diagnosis: submits thought trace (evidence: `README.md`)
- Misconception diagnosis → Remediation generation: flags trap for (evidence: `README.md`)
- Remediation generation → Socratic explanations: supports remediation (evidence: `README.md`)
- Misconception diagnosis → LLM providers: uses models (evidence: `README.md`)
- Remediation generation → LLM providers: uses models (evidence: `README.md`)
- Socratic explanations → LLM providers: uses models (evidence: `README.md`)
- Skill roadmaps → Roadmap generation: requests roadmap (evidence: `README.md`)
- Roadmap generation → DuckDuckGo search: grounds resources (evidence: `README.md`)
- Learning dashboard → Document analysis: uploads work for (evidence: `README.md`)
- Document analysis → LLM providers: analyzes with vision (evidence: `README.md`)
- Misconception diagnosis → Supabase storage and database: persists learning data (evidence: `README.md`)
- Document analysis → Supabase storage and database: stores uploads (evidence: `README.md`)
- Teacher analytics → Supabase storage and database: uses class data (evidence: `README.md`)
- View orchestration → Supabase storage and database: uses sessions and data (evidence: `README.md`)
