# g-ganesh83/student-productivity architecture

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

- Interactive diagram: https://gitdiagram.com/g-ganesh83/student-productivity
- Repository: https://github.com/g-ganesh83/student-productivity

## Overview

LEARN EASY combines authenticated personal productivity tools with room-based collaboration. Users enter through the React app, authenticate, then manage tasks and focus sessions or create/join rooms for chat, shared code, and Python execution; study resources remain a frontend-local library. The graph distinguishes REST routing from Socket.IO events and database persistence. Some feature paths are documented but their source was not sampled, so those links rely on README statements; unsampled implementation details are not inferred.

Main entry points: [`src/App.jsx`](https://github.com/g-ganesh83/student-productivity/blob/main/src/App.jsx) (App routing), [`backend/app.js`](https://github.com/g-ganesh83/student-productivity/blob/main/backend/app.js) (Express app), [`backend/models`](https://github.com/g-ganesh83/student-productivity/tree/main/backend/models) (MongoDB models), [`backend/middleware/validateMiddleware.js`](https://github.com/g-ganesh83/student-productivity/blob/main/backend/middleware/validateMiddleware.js) (Request validation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["App routing<br/>[App.jsx]"]
  node_auth["Auth state<br/>[AuthContext.jsx]"]
  node_authutils["Token storage<br/>[auth.js]"]
  node_httpclient["HTTP client<br/>[api.js]"]
end

subgraph group_productivity["Productivity features"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_tasks["Task management<br/>[Productivity.jsx]"]
  node_taskgroup["Task grouping<br/>[taskGrouping.js]"]
  node_focus["Focus sessions"]
  node_analytics["Session analytics"]
  node_resources["Resource library<br/>[Resources.jsx]"]
end

subgraph group_collab["Collaboration features"]
  node_collaboration["Room discovery<br/>[Collaboration.jsx]"]
  node_roomui["Room workspace<br/>[Room.jsx]"]
  node_socketclient["Socket client<br/>[socket.js]"]
  node_socketserver["Socket events<br/>[socketManager.js]"]
  node_code["Python execution<br/>[codeController.js]"]
end

subgraph group_backend["Backend services"]
  node_server["Express app<br/>[app.js]"]
  node_authapi["Authentication API<br/>[authRoutes.js]"]
  node_taskapi["Task API<br/>[taskRoutes.js]"]
  node_sessionapi["Session API<br/>[sessionRoutes.js]"]
  node_roomapi["Room API<br/>[roomRoutes.js]"]
  node_codeapi["Code API<br/>[codeRoutes.js]"]
  node_models[("MongoDB models")]
  node_validation["Request validation"]
end

node_student(("Student"))

node_student -->|"uses"| node_app
node_app -->|"provides routes"| node_auth
node_auth -->|"stores tokens"| node_authutils
node_auth -->|"sets auth"| node_httpclient
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_tasks
node_tasks -->|"groups tasks"| node_taskgroup
node_student -->|"manages tasks"| node_tasks
node_student -->|"tracks study"| node_focus
node_focus -->|"reads/writes sessions"| node_models
node_focus -->|"reads tasks"| node_models
node_tasks -->|"shows timeline"| node_analytics
node_student -->|"uses library"| node_resources
node_app -->|"routes to"| node_collaboration
node_app -->|"routes to"| node_roomui
node_student -->|"creates or joins"| node_collaboration
node_roomui -->|"fetches room"| node_roomapi
node_roomui -->|"runs code"| node_code
node_roomui -->|"sends events"| node_socketclient
node_socketclient -->|"exchanges events"| node_socketserver
node_socketserver -->|"checks membership"| node_models
node_socketserver -->|"persists chat"| node_models
node_server -->|"mounts routes"| node_authapi
node_server -->|"mounts routes"| node_taskapi
node_server -->|"mounts routes"| node_sessionapi
node_server -->|"mounts routes"| node_roomapi
node_server -->|"mounts routes"| node_codeapi
node_roomapi -->|"validates input"| node_validation
node_authapi -->|"validates input"| node_validation
node_taskapi -->|"validates input"| node_validation
node_sessionapi -->|"validates input"| node_validation
node_codeapi -->|"validates input"| node_validation
node_student -->|"registers or logs in"| node_authapi
node_student -->|"uses task API"| node_taskapi
node_student -->|"uses session API"| node_sessionapi
node_code -->|"executes Python"| node_codeapi
node_resources -.->|"persists locally"| node_models

click node_app "https://github.com/g-ganesh83/student-productivity/blob/main/src/App.jsx"
click node_auth "https://github.com/g-ganesh83/student-productivity/blob/main/src/context/AuthContext.jsx"
click node_authutils "https://github.com/g-ganesh83/student-productivity/blob/main/src/utils/auth.js"
click node_httpclient "https://github.com/g-ganesh83/student-productivity/blob/main/src/services/api.js"
click node_dashboard "https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Dashboard.jsx"
click node_tasks "https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Productivity.jsx"
click node_taskgroup "https://github.com/g-ganesh83/student-productivity/blob/main/src/utils/taskGrouping.js"
click node_focus "https://github.com/g-ganesh83/student-productivity/blob/main/backend/controllers/sessionController.js"
click node_analytics "https://github.com/g-ganesh83/student-productivity/blob/main/src/utils/sessionAnalytics.js"
click node_resources "https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Resources.jsx"
click node_collaboration "https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Collaboration.jsx"
click node_roomui "https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Room.jsx"
click node_socketclient "https://github.com/g-ganesh83/student-productivity/blob/main/src/socket/socket.js"
click node_socketserver "https://github.com/g-ganesh83/student-productivity/blob/main/backend/socket/socketManager.js"
click node_code "https://github.com/g-ganesh83/student-productivity/blob/main/backend/controllers/codeController.js"
click node_server "https://github.com/g-ganesh83/student-productivity/blob/main/backend/app.js"
click node_authapi "https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/authRoutes.js"
click node_taskapi "https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/taskRoutes.js"
click node_sessionapi "https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/sessionRoutes.js"
click node_roomapi "https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/roomRoutes.js"
click node_codeapi "https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/codeRoutes.js"
click node_models "https://github.com/g-ganesh83/student-productivity/tree/main/backend/models"
click node_validation "https://github.com/g-ganesh83/student-productivity/blob/main/backend/middleware/validateMiddleware.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_app,node_auth,node_authutils,node_httpclient toneBlue
class node_dashboard,node_tasks,node_taskgroup,node_focus,node_analytics,node_resources toneAmber
class node_collaboration,node_roomui,node_socketclient,node_socketserver,node_code toneMint
class node_server,node_authapi,node_taskapi,node_sessionapi,node_roomapi,node_codeapi,node_models,node_validation toneRose
class node_student toneIndigo
```

## Components

### Frontend experience

- [App routing](https://github.com/g-ganesh83/student-productivity/blob/main/src/App.jsx): `src/App.jsx`
- [Auth state](https://github.com/g-ganesh83/student-productivity/blob/main/src/context/AuthContext.jsx): `src/context/AuthContext.jsx`
- [Token storage](https://github.com/g-ganesh83/student-productivity/blob/main/src/utils/auth.js): `src/utils/auth.js`
- [HTTP client](https://github.com/g-ganesh83/student-productivity/blob/main/src/services/api.js): `src/services/api.js`

### Productivity features

- [Dashboard](https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Dashboard.jsx): `src/pages/Dashboard.jsx`
- [Task management](https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Productivity.jsx): `src/pages/Productivity.jsx`
- [Task grouping](https://github.com/g-ganesh83/student-productivity/blob/main/src/utils/taskGrouping.js): `src/utils/taskGrouping.js`
- [Focus sessions](https://github.com/g-ganesh83/student-productivity/blob/main/backend/controllers/sessionController.js): `backend/controllers/sessionController.js`
- [Session analytics](https://github.com/g-ganesh83/student-productivity/blob/main/src/utils/sessionAnalytics.js): `src/utils/sessionAnalytics.js`
- [Resource library](https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Resources.jsx): `src/pages/Resources.jsx`

### Collaboration features

- [Room discovery](https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Collaboration.jsx): `src/pages/Collaboration.jsx`
- [Room workspace](https://github.com/g-ganesh83/student-productivity/blob/main/src/pages/Room.jsx): `src/pages/Room.jsx`
- [Socket client](https://github.com/g-ganesh83/student-productivity/blob/main/src/socket/socket.js): `src/socket/socket.js`
- [Socket events](https://github.com/g-ganesh83/student-productivity/blob/main/backend/socket/socketManager.js): `backend/socket/socketManager.js`
- [Python execution](https://github.com/g-ganesh83/student-productivity/blob/main/backend/controllers/codeController.js): `backend/controllers/codeController.js`

### Backend services

- [Express app](https://github.com/g-ganesh83/student-productivity/blob/main/backend/app.js): `backend/app.js`
- [Authentication API](https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Task API](https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/taskRoutes.js): `backend/routes/taskRoutes.js`
- [Session API](https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/sessionRoutes.js): `backend/routes/sessionRoutes.js`
- [Room API](https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/roomRoutes.js): `backend/routes/roomRoutes.js`
- [Code API](https://github.com/g-ganesh83/student-productivity/blob/main/backend/routes/codeRoutes.js): `backend/routes/codeRoutes.js`
- [MongoDB models](https://github.com/g-ganesh83/student-productivity/tree/main/backend/models): `backend/models`
- [Request validation](https://github.com/g-ganesh83/student-productivity/blob/main/backend/middleware/validateMiddleware.js): `backend/middleware/validateMiddleware.js`

### Other components

- **Student**

## Connections

- Student → App routing: uses (evidence: `README.md`)
- App routing → Auth state: provides routes (evidence: `src/App.jsx`)
- Auth state → Token storage: stores tokens (evidence: `src/context/AuthContext.jsx`)
- Auth state → HTTP client: sets auth (evidence: `src/context/AuthContext.jsx`)
- App routing → Dashboard: routes to (evidence: `src/App.jsx`)
- App routing → Task management: routes to (evidence: `src/App.jsx`)
- Task management → Task grouping: groups tasks (evidence: `src/pages/Productivity.jsx`)
- Student → Task management: manages tasks (evidence: `README.md`)
- Student → Focus sessions: tracks study (evidence: `README.md`)
- Focus sessions → MongoDB models: reads/writes sessions (evidence: `backend/controllers/sessionController.js`)
- Focus sessions → MongoDB models: reads tasks (evidence: `backend/controllers/sessionController.js`)
- Task management → Session analytics: shows timeline
- Student → Resource library: uses library (evidence: `README.md`)
- App routing → Room discovery: routes to (evidence: `src/App.jsx`)
- App routing → Room workspace: routes to (evidence: `src/App.jsx`)
- Student → Room discovery: creates or joins (evidence: `README.md`)
- Room workspace → Room API: fetches room (evidence: `src/pages/Room.jsx`)
- Room workspace → Python execution: runs code (evidence: `README.md`)
- Room workspace → Socket client: sends events (evidence: `README.md`)
- Socket client → Socket events: exchanges events (evidence: `README.md`)
- Socket events → MongoDB models: checks membership (evidence: `backend/socket/socketManager.js`)
- Socket events → MongoDB models: persists chat (evidence: `backend/socket/socketManager.js`)
- Express app → Authentication API: mounts routes (evidence: `backend/app.js`)
- Express app → Task API: mounts routes (evidence: `backend/app.js`)
- Express app → Session API: mounts routes (evidence: `backend/app.js`)
- Express app → Room API: mounts routes (evidence: `backend/app.js`)
- Express app → Code API: mounts routes (evidence: `backend/app.js`)
- Room API → Request validation: validates input (evidence: `backend/routes/roomRoutes.js`)
- Authentication API → Request validation: validates input (evidence: `backend/routes/authRoutes.js`)
- Task API → Request validation: validates input (evidence: `backend/routes/taskRoutes.js`)
- Session API → Request validation: validates input (evidence: `backend/routes/sessionRoutes.js`)
- Code API → Request validation: validates input (evidence: `backend/routes/codeRoutes.js`)
- Student → Authentication API: registers or logs in (evidence: `README.md`)
- Student → Task API: uses task API (evidence: `README.md`)
- Student → Session API: uses session API (evidence: `README.md`)
- Python execution → Code API: executes Python (evidence: `README.md`)
- Resource library → MongoDB models: persists locally (evidence: `README.md`)
