# pranav-1403/scholarspace architecture

> Architecture diagram of the GitHub repository pranav-1403/scholarspace, 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/pranav-1403/scholarspace
- Repository: https://github.com/pranav-1403/scholarspace

## Overview

ScholarSpace is a personal academic planner: users create an account, organize subjects and tasks, record focused study sessions and notes, then review progress in the dashboard and weekly planner. The React app presents these capabilities and sends authenticated requests through a small API client to Express routes; MongoDB-backed models persist user-scoped records. The sampled code shows authentication, data routes, timer behavior and summary calculations. Several frontend feature details are documented in the README but lie outside the excerpted App source.

Main entry points: [`frontend/src/api.js`](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/api.js) (API client), [`backend/routes/data.js`](https://github.com/pranav-1403/scholarspace/blob/main/backend/routes/data.js) (Planner data routes), [`backend/server.js`](https://github.com/pranav-1403/scholarspace/blob/main/backend/server.js) (Express server), [`backend/routes/auth.js`](https://github.com/pranav-1403/scholarspace/blob/main/backend/routes/auth.js) (Account routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Learning workspace"]
  node_workspace["Planner interface<br/>[App.jsx]"]
  node_dashboard["Progress dashboard<br/>[App.jsx]"]
  node_subjects_ui["Subject library<br/>[App.jsx]"]
  node_tasks_ui["Task planner<br/>[App.jsx]"]
  node_focus_ui["Focus timer<br/>[App.jsx]"]
  node_notes_ui["Notes editor<br/>[App.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_backend["API and domain"]
  node_server["Express server<br/>[server.js]"]
  node_auth_routes["Account routes<br/>[auth.js]"]
  node_data_routes["Planner data routes<br/>[data.js]"]
  node_auth_middleware["JWT middleware<br/>[auth.js]"]
end

subgraph group_persistence["Persistence"]
  node_user_model["User records<br/>[User.js]"]
  node_subject_model["Subject records<br/>[Subject.js]"]
  node_task_model["Task records<br/>[Task.js]"]
  node_session_model["Study session records<br/>[StudySession.js]"]
  node_note_model["Note records<br/>[Note.js]"]
end

subgraph group_external["External systems"]
  node_mongodb[("MongoDB")]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_workspace
node_workspace -->|"sends requests"| node_api_client
node_api_client -->|"calls API"| node_server
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_data_routes
node_server -->|"connects"| node_mongodb
node_auth_routes -->|"reads and writes"| node_user_model
node_auth_routes -->|"protects profile"| node_auth_middleware
node_data_routes -->|"protects routes"| node_auth_middleware
node_data_routes -->|"queries"| node_subject_model
node_data_routes -->|"queries"| node_task_model
node_data_routes -->|"queries"| node_session_model
node_data_routes -->|"queries"| node_note_model
node_dashboard -.->|"loads progress"| node_api_client
node_subjects_ui -.->|"manages subjects"| node_api_client
node_tasks_ui -.->|"manages tasks"| node_api_client
node_focus_ui -.->|"controls sessions"| node_api_client
node_notes_ui -.->|"manages notes"| node_api_client

click node_workspace "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx"
click node_subjects_ui "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx"
click node_tasks_ui "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx"
click node_focus_ui "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx"
click node_notes_ui "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx"
click node_api_client "https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/api.js"
click node_server "https://github.com/pranav-1403/scholarspace/blob/main/backend/server.js"
click node_auth_routes "https://github.com/pranav-1403/scholarspace/blob/main/backend/routes/auth.js"
click node_data_routes "https://github.com/pranav-1403/scholarspace/blob/main/backend/routes/data.js"
click node_auth_middleware "https://github.com/pranav-1403/scholarspace/blob/main/backend/middleware/auth.js"
click node_user_model "https://github.com/pranav-1403/scholarspace/blob/main/backend/models/User.js"
click node_subject_model "https://github.com/pranav-1403/scholarspace/blob/main/backend/models/Subject.js"
click node_task_model "https://github.com/pranav-1403/scholarspace/blob/main/backend/models/Task.js"
click node_session_model "https://github.com/pranav-1403/scholarspace/blob/main/backend/models/StudySession.js"
click node_note_model "https://github.com/pranav-1403/scholarspace/blob/main/backend/models/Note.js"

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_workspace,node_dashboard,node_subjects_ui,node_tasks_ui,node_focus_ui,node_notes_ui,node_api_client toneBlue
class node_server,node_auth_routes,node_data_routes,node_auth_middleware toneAmber
class node_user_model,node_subject_model,node_task_model,node_session_model,node_note_model toneMint
class node_mongodb toneRose
class node_learner toneIndigo
```

## Components

### Learning workspace

- [Planner interface](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Progress dashboard](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Subject library](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Task planner](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Focus timer](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Notes editor](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [API client](https://github.com/pranav-1403/scholarspace/blob/main/frontend/src/api.js): `frontend/src/api.js`

### API and domain

- [Express server](https://github.com/pranav-1403/scholarspace/blob/main/backend/server.js): `backend/server.js`
- [Account routes](https://github.com/pranav-1403/scholarspace/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Planner data routes](https://github.com/pranav-1403/scholarspace/blob/main/backend/routes/data.js): `backend/routes/data.js`
- [JWT middleware](https://github.com/pranav-1403/scholarspace/blob/main/backend/middleware/auth.js): `backend/middleware/auth.js`

### Persistence

- [User records](https://github.com/pranav-1403/scholarspace/blob/main/backend/models/User.js): `backend/models/User.js`
- [Subject records](https://github.com/pranav-1403/scholarspace/blob/main/backend/models/Subject.js): `backend/models/Subject.js`
- [Task records](https://github.com/pranav-1403/scholarspace/blob/main/backend/models/Task.js): `backend/models/Task.js`
- [Study session records](https://github.com/pranav-1403/scholarspace/blob/main/backend/models/StudySession.js): `backend/models/StudySession.js`
- [Note records](https://github.com/pranav-1403/scholarspace/blob/main/backend/models/Note.js): `backend/models/Note.js`

### External systems

- **MongoDB**

### Other components

- **Learner**

## Connections

- Learner → Planner interface: uses (evidence: `README.md`)
- Planner interface → API client: sends requests (evidence: `frontend/src/App.jsx`)
- API client → Express server: calls API (evidence: `README.md`)
- Express server → Account routes: mounts routes (evidence: `backend/server.js`)
- Express server → Planner data routes: mounts routes (evidence: `backend/server.js`)
- Express server → MongoDB: connects (evidence: `backend/server.js`)
- Account routes → User records: reads and writes (evidence: `backend/routes/auth.js`)
- Account routes → JWT middleware: protects profile (evidence: `backend/routes/auth.js`)
- Planner data routes → JWT middleware: protects routes (evidence: `backend/routes/data.js`)
- Planner data routes → Subject records: queries (evidence: `backend/routes/data.js`)
- Planner data routes → Task records: queries (evidence: `backend/routes/data.js`)
- Planner data routes → Study session records: queries (evidence: `backend/routes/data.js`)
- Planner data routes → Note records: queries (evidence: `backend/routes/data.js`)
- Progress dashboard → API client: loads progress (evidence: `frontend/src/App.jsx`)
- Subject library → API client: manages subjects (evidence: `frontend/src/App.jsx`)
- Task planner → API client: manages tasks (evidence: `frontend/src/App.jsx`)
- Focus timer → API client: controls sessions (evidence: `frontend/src/App.jsx`)
- Notes editor → API client: manages notes (evidence: `frontend/src/App.jsx`)
