# jashvanthan/csemastery architecture

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

- Interactive diagram: https://gitdiagram.com/jashvanthan/csemastery
- Repository: https://github.com/jashvanthan/csemastery

## Overview

CSEMastery is a multi-user learning and habit-tracking platform built around a 200-day CS curriculum. A learner signs in or uses the demo profile, explores tracks, weeks, and days, completes study tasks, and tracks progress through dashboards and analytics. Separate features support LeetCode practice, notes, projects, revision, and community rankings. The graph follows the documented React-to-API-to-controller-to-database structure; several feature connections rely on the README and SOURCE INDEX because their source excerpts were not provided.

Main entry points: [`backend/src/routes/api.ts`](https://github.com/jashvanthan/csemastery/blob/main/backend/src/routes/api.ts) (API routes), [`frontend/src/App.tsx`](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/App.tsx) (App routing), [`frontend/src/services/api.ts`](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/services/api.ts) (API client), [`backend/src/db/index.ts`](https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/index.ts) (Database access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Learner experience"]
  node_app["App routing<br/>[App.tsx]"]
  node_authpage["Sign-in and demo<br/>[AuthPage.tsx]"]
  node_authctx["Session state<br/>[AuthContext.tsx]"]
  node_dashboardui["Dashboard and analytics<br/>[DashboardPage.tsx]"]
  node_planui["Plan and tracks<br/>[PlanPage.tsx]"]
  node_dayui["Day and task study<br/>[DayDetailPage.tsx]"]
  node_communityui["Community rankings<br/>[CommunityPage.tsx]"]
  node_leetcodeui["LeetCode tracker<br/>[LeetcodePage.tsx]"]
  node_projectsui["Projects<br/>[ProjectsPage.tsx]"]
  node_notesui["Notes and revision<br/>[NotesPage.tsx]"]
end

subgraph group_api["API and security"]
  node_client["API client<br/>[api.ts]"]
  node_routes["API routes<br/>[api.ts]"]
  node_authmw["JWT guard<br/>[auth.ts]"]
  node_authctrl["Authentication<br/>[authController.ts]"]
  node_server["Express server<br/>[index.ts]"]
end

subgraph group_curriculum["Curriculum progress"]
  node_planctrl["Plan and curriculum<br/>[planController.ts]"]
  node_taskctrl["Task progress<br/>[taskController.ts]"]
  node_dashboardctrl["Progress analytics"]
end

subgraph group_features["Study features"]
  node_leetcodectrl["Problem tracking"]
  node_notesctrl["Study notes<br/>[notesController.ts]"]
  node_projectsctrl["Project progress"]
  node_communityctrl["Leaderboard"]
end

subgraph group_data["Data platform"]
  node_builder["Curriculum generator"]
  node_seed["Seed data<br/>[seed.ts]"]
  node_db[("Database access<br/>[index.ts]")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"routes to"| node_authpage
node_app -->|"routes to"| node_dashboardui
node_app -->|"routes to"| node_planui
node_app -->|"routes to"| node_dayui
node_app -->|"routes to"| node_communityui
node_app -->|"routes to"| node_leetcodeui
node_app -->|"routes to"| node_projectsui
node_app -->|"routes to"| node_notesui
node_app -->|"provides session"| node_authctx
node_authpage -->|"authenticates through"| node_authctx
node_authctx -->|"calls"| node_client
node_dashboardui -->|"requests data"| node_client
node_planui -->|"requests data"| node_client
node_dayui -->|"requests data"| node_client
node_communityui -->|"requests data"| node_client
node_leetcodeui -->|"requests data"| node_client
node_projectsui -->|"requests data"| node_client
node_notesui -->|"requests data"| node_client
node_client -->|"sends API requests"| node_routes
node_server -->|"mounts"| node_routes
node_routes -->|"dispatches auth"| node_authctrl
node_routes -->|"dispatches plan"| node_planctrl
node_routes -->|"dispatches tasks"| node_taskctrl
node_routes -->|"dispatches dashboard"| node_dashboardctrl
node_routes -->|"dispatches problems"| node_leetcodectrl
node_routes -->|"dispatches notes"| node_notesctrl
node_routes -->|"dispatches projects"| node_projectsctrl
node_routes -->|"dispatches leaderboard"| node_communityctrl
node_routes -->|"guards protected routes"| node_authmw
node_authctrl -->|"creates JWTs"| node_authmw
node_planctrl -->|"reads curriculum"| node_db
node_taskctrl -->|"reads and writes progress"| node_db
node_dashboardctrl -->|"reads metrics"| node_db
node_leetcodectrl -->|"reads and writes records"| node_db
node_notesctrl -->|"persists notes"| node_db
node_projectsctrl -->|"uses database"| node_db
node_communityctrl -->|"queries rankings"| node_db
node_server -->|"initializes"| node_db
node_seed -->|"seeds records"| node_db
node_seed -->|"uses curriculum generator"| node_builder

click node_app "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/App.tsx"
click node_authpage "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/AuthPage.tsx"
click node_authctx "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/context/AuthContext.tsx"
click node_dashboardui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/DashboardPage.tsx"
click node_planui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/PlanPage.tsx"
click node_dayui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/DayDetailPage.tsx"
click node_communityui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/CommunityPage.tsx"
click node_leetcodeui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/LeetcodePage.tsx"
click node_projectsui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/ProjectsPage.tsx"
click node_notesui "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/NotesPage.tsx"
click node_client "https://github.com/jashvanthan/csemastery/blob/main/frontend/src/services/api.ts"
click node_routes "https://github.com/jashvanthan/csemastery/blob/main/backend/src/routes/api.ts"
click node_authmw "https://github.com/jashvanthan/csemastery/blob/main/backend/src/middleware/auth.ts"
click node_authctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/authController.ts"
click node_planctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/planController.ts"
click node_taskctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/taskController.ts"
click node_dashboardctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/dashboardController.ts"
click node_leetcodectrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/leetcodeController.ts"
click node_notesctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/notesController.ts"
click node_projectsctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/projectsController.ts"
click node_communityctrl "https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/communityController.ts"
click node_builder "https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/curriculumBuilder.ts"
click node_seed "https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/seed.ts"
click node_db "https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/index.ts"
click node_server "https://github.com/jashvanthan/csemastery/blob/main/backend/src/index.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_authpage,node_authctx,node_dashboardui,node_planui,node_dayui,node_communityui,node_leetcodeui,node_projectsui,node_notesui toneBlue
class node_client,node_routes,node_authmw,node_authctrl,node_server toneAmber
class node_planctrl,node_taskctrl,node_dashboardctrl toneMint
class node_leetcodectrl,node_notesctrl,node_projectsctrl,node_communityctrl toneRose
class node_builder,node_seed,node_db,node_learner toneIndigo
```

## Components

### Learner experience

- [App routing](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Sign-in and demo](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/AuthPage.tsx): `frontend/src/pages/AuthPage.tsx`
- [Session state](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/context/AuthContext.tsx): `frontend/src/context/AuthContext.tsx`
- [Dashboard and analytics](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/DashboardPage.tsx): `frontend/src/pages/DashboardPage.tsx`
- [Plan and tracks](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/PlanPage.tsx): `frontend/src/pages/PlanPage.tsx`
- [Day and task study](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/DayDetailPage.tsx): `frontend/src/pages/DayDetailPage.tsx`
- [Community rankings](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/CommunityPage.tsx): `frontend/src/pages/CommunityPage.tsx`
- [LeetCode tracker](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/LeetcodePage.tsx): `frontend/src/pages/LeetcodePage.tsx`
- [Projects](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/ProjectsPage.tsx): `frontend/src/pages/ProjectsPage.tsx`
- [Notes and revision](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/pages/NotesPage.tsx): `frontend/src/pages/NotesPage.tsx`

### API and security

- [API client](https://github.com/jashvanthan/csemastery/blob/main/frontend/src/services/api.ts): `frontend/src/services/api.ts`
- [API routes](https://github.com/jashvanthan/csemastery/blob/main/backend/src/routes/api.ts): `backend/src/routes/api.ts`
- [JWT guard](https://github.com/jashvanthan/csemastery/blob/main/backend/src/middleware/auth.ts): `backend/src/middleware/auth.ts`
- [Authentication](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/authController.ts): `backend/src/controllers/authController.ts`
- [Express server](https://github.com/jashvanthan/csemastery/blob/main/backend/src/index.ts): `backend/src/index.ts`

### Curriculum progress

- [Plan and curriculum](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/planController.ts): `backend/src/controllers/planController.ts`
- [Task progress](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/taskController.ts): `backend/src/controllers/taskController.ts`
- [Progress analytics](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/dashboardController.ts): `backend/src/controllers/dashboardController.ts`

### Study features

- [Problem tracking](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/leetcodeController.ts): `backend/src/controllers/leetcodeController.ts`
- [Study notes](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/notesController.ts): `backend/src/controllers/notesController.ts`
- [Project progress](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/projectsController.ts): `backend/src/controllers/projectsController.ts`
- [Leaderboard](https://github.com/jashvanthan/csemastery/blob/main/backend/src/controllers/communityController.ts): `backend/src/controllers/communityController.ts`

### Data platform

- [Curriculum generator](https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/curriculumBuilder.ts): `backend/src/db/curriculumBuilder.ts`
- [Seed data](https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/seed.ts): `backend/src/db/seed.ts`
- [Database access](https://github.com/jashvanthan/csemastery/blob/main/backend/src/db/index.ts): `backend/src/db/index.ts`

### Other components

- **Learner**

## Connections

- Learner → App routing: uses (evidence: `README.md`)
- App routing → Sign-in and demo: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Dashboard and analytics: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Plan and tracks: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Day and task study: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Community rankings: routes to (evidence: `frontend/src/App.tsx`)
- App routing → LeetCode tracker: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Projects: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Notes and revision: routes to (evidence: `frontend/src/App.tsx`)
- App routing → Session state: provides session (evidence: `frontend/src/App.tsx`)
- Sign-in and demo → Session state: authenticates through (evidence: `frontend/src/context/AuthContext.tsx`)
- Session state → API client: calls (evidence: `frontend/src/context/AuthContext.tsx`)
- Dashboard and analytics → API client: requests data (evidence: `frontend/src/pages/DashboardPage.tsx`)
- Plan and tracks → API client: requests data (evidence: `frontend/src/pages/PlanPage.tsx`)
- Day and task study → API client: requests data (evidence: `frontend/src/pages/DayDetailPage.tsx`)
- Community rankings → API client: requests data (evidence: `frontend/src/pages/CommunityPage.tsx`)
- LeetCode tracker → API client: requests data (evidence: `frontend/src/pages/LeetcodePage.tsx`)
- Projects → API client: requests data (evidence: `frontend/src/pages/ProjectsPage.tsx`)
- Notes and revision → API client: requests data (evidence: `frontend/src/pages/NotesPage.tsx`)
- API client → API routes: sends API requests (evidence: `frontend/src/services/api.ts`)
- Express server → API routes: mounts (evidence: `backend/src/index.ts`)
- API routes → Authentication: dispatches auth (evidence: `backend/src/routes/api.ts`)
- API routes → Plan and curriculum: dispatches plan (evidence: `backend/src/routes/api.ts`)
- API routes → Task progress: dispatches tasks (evidence: `backend/src/routes/api.ts`)
- API routes → Progress analytics: dispatches dashboard (evidence: `backend/src/routes/api.ts`)
- API routes → Problem tracking: dispatches problems (evidence: `backend/src/routes/api.ts`)
- API routes → Study notes: dispatches notes (evidence: `backend/src/routes/api.ts`)
- API routes → Project progress: dispatches projects (evidence: `backend/src/routes/api.ts`)
- API routes → Leaderboard: dispatches leaderboard (evidence: `backend/src/routes/api.ts`)
- API routes → JWT guard: guards protected routes (evidence: `backend/src/routes/api.ts`)
- Authentication → JWT guard: creates JWTs (evidence: `backend/src/controllers/authController.ts`)
- Plan and curriculum → Database access: reads curriculum (evidence: `backend/src/controllers/planController.ts`)
- Task progress → Database access: reads and writes progress (evidence: `backend/src/controllers/taskController.ts`)
- Progress analytics → Database access: reads metrics (evidence: `backend/src/controllers/dashboardController.ts`)
- Problem tracking → Database access: reads and writes records (evidence: `backend/src/controllers/leetcodeController.ts`)
- Study notes → Database access: persists notes (evidence: `backend/src/controllers/notesController.ts`)
- Project progress → Database access: uses database (evidence: `backend/src/controllers/projectsController.ts`)
- Leaderboard → Database access: queries rankings (evidence: `backend/src/controllers/communityController.ts`)
- Express server → Database access: initializes (evidence: `backend/src/index.ts`)
- Seed data → Database access: seeds records (evidence: `backend/src/db/seed.ts`)
- Seed data → Curriculum generator: uses curriculum generator (evidence: `backend/src/db/seed.ts`)
