# spradhan-code/ai-studyplanner architecture

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

- Interactive diagram: https://gitdiagram.com/spradhan-code/ai-studyplanner
- Repository: https://github.com/spradhan-code/ai-studyplanner

## Overview

This React study workspace takes students from account/profile and syllabus setup through personalized scheduling, daily topic tracking, and preparation feedback. The README documents those product stages, while the sampled App.jsx confirms it owns authentication, planner/storage calls, and the dashboard views. The planner and Firebase adapter are separate internal layers. ThreeCanvas is present as a substantial visualization component, but the available evidence does not show where it is mounted. App.jsx is partial, so some UI relationships rely on README documentation.

Main entry points: [`src/App.jsx`](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx) (Study workspace), [`src/utils/aiPlanner.js`](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js) (Live coach), [`src/main.jsx`](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/main.jsx) (React entry), [`src/utils/firebase.js`](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/firebase.js) (Firebase adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Student experience"]
  node_app_entry["React entry<br/>[main.jsx]"]
  node_workspace["Study workspace<br/>[App.jsx]"]
  node_account_setup["Account and profile<br/>[App.jsx]"]
  node_subject_setup["Subject setup<br/>[App.jsx]"]
  node_topic_tracker["Topic checklist<br/>[App.jsx]"]
  node_study_calendar["Study calendar<br/>[App.jsx]"]
end

subgraph group_planning["Planning and coaching"]
  node_planner_engine["Plan generation<br/>[aiPlanner.js]"]
  node_coach_rules["Rule-based coach<br/>[aiPlanner.js]"]
  node_live_coach["Live coach<br/>[aiPlanner.js]"]
  node_gemini["Gemini API"]
end

subgraph group_persistence["Identity and data"]
  node_firebase_adapter["Firebase adapter<br/>[firebase.js]"]
  node_firebase_auth["Firebase Auth"]
  node_firestore[("Firestore")]
  node_local_backup[("Local backup")]
end

subgraph group_visualization["Progress visualization"]
  node_subject_visual["3D subject view<br/>[ThreeCanvas.jsx]"]
end

node_student(("Student"))

node_student -->|"uses"| node_app_entry
node_app_entry -->|"renders"| node_workspace
node_student -->|"configures"| node_account_setup
node_account_setup -->|"sets profile"| node_workspace
node_student -->|"defines syllabus"| node_subject_setup
node_subject_setup -->|"provides inputs"| node_planner_engine
node_student -->|"sets constraints"| node_study_calendar
node_workspace -->|"generates plan"| node_planner_engine
node_planner_engine -->|"returns schedule"| node_study_calendar
node_student -->|"marks topics"| node_topic_tracker
node_topic_tracker -->|"updates progress"| node_workspace
node_workspace -->|"requests feedback"| node_live_coach
node_live_coach -->|"falls back"| node_coach_rules
node_live_coach -->|"requests advice"| node_gemini
node_workspace -->|"loads and saves"| node_firebase_adapter
node_account_setup -->|"authenticates"| node_firebase_auth
node_firebase_adapter -->|"reads and writes"| node_firestore
node_workspace -.->|"backs up"| node_local_backup
node_topic_tracker -.->|"visualizes progress"| node_subject_visual

click node_app_entry "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/main.jsx"
click node_workspace "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx"
click node_account_setup "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx"
click node_subject_setup "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx"
click node_topic_tracker "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx"
click node_study_calendar "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx"
click node_planner_engine "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js"
click node_coach_rules "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js"
click node_live_coach "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js"
click node_firebase_adapter "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/firebase.js"
click node_subject_visual "https://github.com/spradhan-code/ai-studyplanner/blob/main/src/components/ThreeCanvas.jsx"

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_workspace,node_account_setup,node_subject_setup,node_topic_tracker,node_study_calendar toneBlue
class node_planner_engine,node_coach_rules,node_live_coach,node_gemini toneAmber
class node_firebase_adapter,node_firebase_auth,node_firestore,node_local_backup toneMint
class node_subject_visual toneRose
class node_student toneIndigo
```

## Components

### Student experience

- [React entry](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/main.jsx): `src/main.jsx`
- [Study workspace](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx): `src/App.jsx`
- [Account and profile](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx): `src/App.jsx`
- [Subject setup](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx): `src/App.jsx`
- [Topic checklist](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx): `src/App.jsx`
- [Study calendar](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/App.jsx): `src/App.jsx`

### Planning and coaching

- [Plan generation](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js): `src/utils/aiPlanner.js`
- [Rule-based coach](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js): `src/utils/aiPlanner.js`
- [Live coach](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/aiPlanner.js): `src/utils/aiPlanner.js`
- **Gemini API**

### Identity and data

- [Firebase adapter](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/utils/firebase.js): `src/utils/firebase.js`
- **Firebase Auth**
- **Firestore**
- **Local backup**

### Progress visualization

- [3D subject view](https://github.com/spradhan-code/ai-studyplanner/blob/main/src/components/ThreeCanvas.jsx): `src/components/ThreeCanvas.jsx`

### Other components

- **Student**

## Connections

- Student → React entry: uses (evidence: `README.md`)
- React entry → Study workspace: renders (evidence: `src/main.jsx`)
- Student → Account and profile: configures (evidence: `README.md`)
- Account and profile → Study workspace: sets profile (evidence: `README.md`)
- Student → Subject setup: defines syllabus (evidence: `README.md`)
- Subject setup → Plan generation: provides inputs (evidence: `README.md`)
- Student → Study calendar: sets constraints (evidence: `README.md`)
- Study workspace → Plan generation: generates plan (evidence: `README.md`)
- Plan generation → Study calendar: returns schedule (evidence: `README.md`)
- Student → Topic checklist: marks topics (evidence: `README.md`)
- Topic checklist → Study workspace: updates progress (evidence: `README.md`)
- Study workspace → Live coach: requests feedback (evidence: `README.md`)
- Live coach → Rule-based coach: falls back (evidence: `src/utils/aiPlanner.js`)
- Live coach → Gemini API: requests advice (evidence: `src/utils/aiPlanner.js`)
- Study workspace → Firebase adapter: loads and saves (evidence: `src/App.jsx`)
- Account and profile → Firebase Auth: authenticates (evidence: `src/App.jsx`)
- Firebase adapter → Firestore: reads and writes (evidence: `src/utils/firebase.js`)
- Study workspace → Local backup: backs up (evidence: `README.md`)
- Topic checklist → 3D subject view: visualizes progress
