# rohitchintalapudi/learnflowai-frontend architecture

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

- Interactive diagram: https://gitdiagram.com/rohitchintalapudi/learnflowai-frontend
- Repository: https://github.com/rohitchintalapudi/learnflowai-frontend

## Overview

Learnflow AI is a student learning platform centered on an authenticated document workspace: students upload or open material, select concepts, generate learning aids, and review progress. The frontend also provides account management, analytics, learning history, and guided onboarding. The README documents backend AI workflows and persistence; sampled sources confirm selected frontend API and simulation paths, but the backend implementation is not present in this tree.

Main entry points: [`src/lib/api.ts`](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/lib/api.ts) (Document and workflow API), [`src/routes/_authenticated/workspace.$documentId.tsx`](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/workspace.%24documentId.tsx) (Document workspace), [`src/components/DashboardLayout.tsx`](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/DashboardLayout.tsx) (Dashboard shell), [`src/lib/auth-client.ts`](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/lib/auth-client.ts) (Session auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access &amp; Shell"]
  node_public["Public pages<br/>[_public.tsx]"]
  node_signup["Sign up<br/>[signup.tsx]"]
  node_login["Login<br/>[login.tsx]"]
  node_guard["Route guard<br/>[_authenticated.tsx]"]
  node_shell["Dashboard shell"]
end

subgraph group_learning["Learning Workspace"]
  node_workspace["Document workspace"]
  node_documents["Document library<br/>[documents.tsx]"]
  node_simulation["Simulation generator"]
  node_mindmap["Interactive mind maps"]
  node_notes["Study notes<br/>[notes.tsx]"]
  node_quizzes["Targeted quizzes<br/>[quizzes.tsx]"]
end

subgraph group_insight["Progress &amp; Review"]
  node_analytics["Readiness analytics<br/>[analytics.tsx]"]
  node_history["Learning history"]
  node_historydrawer["History details<br/>[HistoryDrawer.tsx]"]
end

subgraph group_account["Account &amp; Guidance"]
  node_profile["Profile management<br/>[ProfileModal.tsx]"]
  node_settings["Account settings<br/>[settings.tsx]"]
  node_tourcontext["Tour state"]
  node_tour["Guided tour<br/>[ProductTour.tsx]"]
end

subgraph group_services["Client Services"]
  node_auth["Session auth<br/>[auth-client.ts]"]
  node_authstore["Auth state<br/>[authStore.ts]"]
  node_documentapi["Document and workflow API<br/>[api.ts]"]
  node_simulationhook["Simulation mutation"]
  node_simulationservice["Simulation service"]
end

node_student(("Student"))
node_backend{{"Learnflow backend"}}
node_llm{{"Groq LLM"}}
node_database[("Neon database")]

node_student -->|"visits"| node_public
node_student -->|"registers"| node_signup
node_student -->|"signs in"| node_login
node_signup -->|"authenticates"| node_auth
node_login -->|"authenticates"| node_auth
node_auth -->|"syncs session"| node_authstore
node_guard -->|"checks session"| node_auth
node_guard -->|"checks state"| node_authstore
node_guard -.->|"renders pages"| node_shell
node_shell -->|"opens profile"| node_profile
node_student -->|"uploads material"| node_documents
node_documents -.->|"requests documents"| node_documentapi
node_student -->|"selects concepts"| node_workspace
node_workspace -->|"requests workflows"| node_documentapi
node_workspace -->|"renders simulation"| node_simulation
node_simulation -->|"requests generation"| node_simulationhook
node_simulationhook -->|"calls service"| node_simulationservice
node_simulationservice -->|"posts simulation"| node_backend
node_backend -->|"generates outputs"| node_llm
node_backend -->|"persists outputs"| node_database
node_workspace -->|"renders nodes"| node_mindmap
node_student -->|"reviews notes"| node_notes
node_student -->|"takes quizzes"| node_quizzes
node_quizzes -->|"uses layout"| node_shell
node_quizzes -->|"requests quiz data"| node_documentapi
node_student -->|"checks readiness"| node_analytics
node_student -->|"reviews activity"| node_history
node_history -->|"opens details"| node_historydrawer
node_history -->|"requests history"| node_documentapi
node_student -->|"manages account"| node_settings
node_student -->|"starts onboarding"| node_tour
node_tour -->|"uses tour state"| node_tourcontext
node_shell -->|"loads profile and alerts"| node_documentapi

click node_public "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_public.tsx"
click node_signup "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_public/signup.tsx"
click node_login "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_public/login.tsx"
click node_auth "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/lib/auth-client.ts"
click node_authstore "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/store/authStore.ts"
click node_guard "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated.tsx"
click node_shell "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/DashboardLayout.tsx"
click node_workspace "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/workspace.%24documentId.tsx"
click node_documents "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/documents.tsx"
click node_documentapi "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/lib/api.ts"
click node_simulation "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/SimulationGenerator.tsx"
click node_simulationhook "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/hooks/useGenerateSimulation.ts"
click node_simulationservice "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/services/simulation.service.ts"
click node_mindmap "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/CustomMindMapNode.tsx"
click node_notes "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/notes.tsx"
click node_quizzes "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/quizzes.tsx"
click node_analytics "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/analytics.tsx"
click node_history "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/learning-history.tsx"
click node_historydrawer "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/LearningHistory/HistoryDrawer.tsx"
click node_profile "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/ProfileModal.tsx"
click node_settings "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/settings.tsx"
click node_tourcontext "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/contexts/ProductTourContext.tsx"
click node_tour "https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/Tour/ProductTour.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_public,node_signup,node_login,node_guard,node_shell toneBlue
class node_workspace,node_documents,node_simulation,node_mindmap,node_notes,node_quizzes,node_database toneAmber
class node_analytics,node_history,node_historydrawer toneMint
class node_profile,node_settings,node_tourcontext,node_tour toneRose
class node_auth,node_authstore,node_documentapi,node_simulationhook,node_simulationservice,node_student,node_backend,node_llm toneIndigo
```

## Components

### Access & Shell

- [Public pages](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_public.tsx): `src/routes/_public.tsx`
- [Sign up](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_public/signup.tsx): `src/routes/_public/signup.tsx`
- [Login](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_public/login.tsx): `src/routes/_public/login.tsx`
- [Route guard](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated.tsx): `src/routes/_authenticated.tsx`
- [Dashboard shell](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/DashboardLayout.tsx): `src/components/DashboardLayout.tsx`

### Learning Workspace

- [Document workspace](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/workspace.%24documentId.tsx): `src/routes/_authenticated/workspace.$documentId.tsx`
- [Document library](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/documents.tsx): `src/routes/_authenticated/documents.tsx`
- [Simulation generator](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/SimulationGenerator.tsx): `src/components/SimulationGenerator.tsx`
- [Interactive mind maps](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/CustomMindMapNode.tsx): `src/components/CustomMindMapNode.tsx`
- [Study notes](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/notes.tsx): `src/routes/_authenticated/notes.tsx`
- [Targeted quizzes](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/quizzes.tsx): `src/routes/_authenticated/quizzes.tsx`

### Progress & Review

- [Readiness analytics](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/analytics.tsx): `src/routes/_authenticated/analytics.tsx`
- [Learning history](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/learning-history.tsx): `src/routes/_authenticated/learning-history.tsx`
- [History details](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/LearningHistory/HistoryDrawer.tsx): `src/components/LearningHistory/HistoryDrawer.tsx`

### Account & Guidance

- [Profile management](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/ProfileModal.tsx): `src/components/ProfileModal.tsx`
- [Account settings](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/routes/_authenticated/settings.tsx): `src/routes/_authenticated/settings.tsx`
- [Tour state](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/contexts/ProductTourContext.tsx): `src/contexts/ProductTourContext.tsx`
- [Guided tour](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/components/Tour/ProductTour.tsx): `src/components/Tour/ProductTour.tsx`

### Client Services

- [Session auth](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/lib/auth-client.ts): `src/lib/auth-client.ts`
- [Auth state](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/store/authStore.ts): `src/store/authStore.ts`
- [Document and workflow API](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/lib/api.ts): `src/lib/api.ts`
- [Simulation mutation](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/hooks/useGenerateSimulation.ts): `src/hooks/useGenerateSimulation.ts`
- [Simulation service](https://github.com/rohitchintalapudi/learnflowai-frontend/blob/main/src/services/simulation.service.ts): `src/services/simulation.service.ts`

### Other components

- **Student**
- **Learnflow backend**
- **Groq LLM**
- **Neon database**

## Connections

- Student → Public pages: visits (evidence: `README.md`)
- Student → Sign up: registers (evidence: `README.md`)
- Student → Login: signs in (evidence: `README.md`)
- Sign up → Session auth: authenticates (evidence: `src/routes/_public/signup.tsx`)
- Login → Session auth: authenticates (evidence: `src/routes/_public/login.tsx`)
- Session auth → Auth state: syncs session (evidence: `README.md`)
- Route guard → Session auth: checks session (evidence: `src/routes/_authenticated.tsx`)
- Route guard → Auth state: checks state (evidence: `src/routes/_authenticated.tsx`)
- Route guard → Dashboard shell: renders pages
- Dashboard shell → Profile management: opens profile (evidence: `src/components/DashboardLayout.tsx`)
- Student → Document library: uploads material (evidence: `README.md`)
- Document library → Document and workflow API: requests documents
- Student → Document workspace: selects concepts (evidence: `README.md`)
- Document workspace → Document and workflow API: requests workflows (evidence: `src/routes/_authenticated/workspace.$documentId.tsx`)
- Document workspace → Simulation generator: renders simulation (evidence: `src/routes/_authenticated/workspace.$documentId.tsx`)
- Simulation generator → Simulation mutation: requests generation (evidence: `src/components/SimulationGenerator.tsx`)
- Simulation mutation → Simulation service: calls service (evidence: `src/hooks/useGenerateSimulation.ts`)
- Simulation service → Learnflow backend: posts simulation (evidence: `src/services/simulation.service.ts`)
- Learnflow backend → Groq LLM: generates outputs (evidence: `README.md`)
- Learnflow backend → Neon database: persists outputs (evidence: `README.md`)
- Document workspace → Interactive mind maps: renders nodes (evidence: `src/routes/_authenticated/workspace.$documentId.tsx`)
- Student → Study notes: reviews notes (evidence: `README.md`)
- Student → Targeted quizzes: takes quizzes (evidence: `README.md`)
- Targeted quizzes → Dashboard shell: uses layout (evidence: `src/routes/_authenticated/quizzes.tsx`)
- Targeted quizzes → Document and workflow API: requests quiz data (evidence: `src/routes/_authenticated/quizzes.tsx`)
- Student → Readiness analytics: checks readiness (evidence: `README.md`)
- Student → Learning history: reviews activity (evidence: `README.md`)
- Learning history → History details: opens details (evidence: `src/routes/_authenticated/learning-history.tsx`)
- Learning history → Document and workflow API: requests history (evidence: `src/routes/_authenticated/learning-history.tsx`)
- Student → Account settings: manages account (evidence: `README.md`)
- Student → Guided tour: starts onboarding
- Guided tour → Tour state: uses tour state (evidence: `src/components/Tour/ProductTour.tsx`)
- Dashboard shell → Document and workflow API: loads profile and alerts (evidence: `src/components/DashboardLayout.tsx`)
