# silvee17/studyvibe architecture

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

- Interactive diagram: https://gitdiagram.com/silvee17/studyvibe
- Repository: https://github.com/silvee17/studyvibe

## Overview

StudyVibe is a study and focus web app with a React client and an Express/Mongoose API. The documented learner workflow is account creation, choosing a theme and ambient track, running focus/break sessions, and tracking progress; admins can view student activity. The sampled client excerpt confirms the homepage and timer/session behavior, while its feature list documents tasks, music, themes, and analytics. Client-to-API wiring is not shown, so no such calls are asserted; room APIs are included as a distinct server capability.

Main entry points: [`server/index.js`](https://github.com/silvee17/studyvibe/blob/main/server/index.js) (HTTP server), [`server/routes/authRoutes.js`](https://github.com/silvee17/studyvibe/blob/main/server/routes/authRoutes.js) (Account and stats API), [`server/routes/roomRoutes.js`](https://github.com/silvee17/studyvibe/blob/main/server/routes/roomRoutes.js) (Study room API), [`client/src/App.jsx`](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx) (Study workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["StudyVibe client"]
  node_app["Study workspace<br/>[App.jsx]"]
  node_focus["Focus sessions<br/>[App.jsx]"]
  node_tasks["Personal tasks<br/>[App.jsx]"]
  node_ambience["Music and themes<br/>[App.jsx]"]
  node_progress["Progress tracking<br/>[App.jsx]"]
  node_analytics["Admin analytics<br/>[App.jsx]"]
end

subgraph group_api["API services"]
  node_auth["Account and stats API<br/>[authRoutes.js]"]
  node_rooms["Study room API<br/>[roomRoutes.js]"]
  node_server["HTTP server<br/>[index.js]"]
end

subgraph group_data["Persistence"]
  node_users[("User records<br/>[User.js]")]
  node_studyrooms[("Study room records<br/>[StudyRoom.js]")]
end

node_learner(("Learner"))
node_admin(("Admin"))
node_mongodb[("MongoDB")]

node_learner -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_server -->|"mounts routes"| node_auth
node_server -->|"mounts routes"| node_rooms
node_server -->|"connects to"| node_mongodb
node_auth -->|"reads and writes"| node_users
node_rooms -->|"reads and writes"| node_studyrooms

click node_app "https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx"
click node_focus "https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx"
click node_tasks "https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx"
click node_ambience "https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx"
click node_progress "https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx"
click node_analytics "https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx"
click node_auth "https://github.com/silvee17/studyvibe/blob/main/server/routes/authRoutes.js"
click node_rooms "https://github.com/silvee17/studyvibe/blob/main/server/routes/roomRoutes.js"
click node_server "https://github.com/silvee17/studyvibe/blob/main/server/index.js"
click node_users "https://github.com/silvee17/studyvibe/blob/main/server/models/User.js"
click node_studyrooms "https://github.com/silvee17/studyvibe/blob/main/server/models/StudyRoom.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_focus,node_tasks,node_ambience,node_progress,node_analytics toneBlue
class node_auth,node_rooms,node_server,node_mongodb toneAmber
class node_users,node_studyrooms toneMint
class node_learner,node_admin toneIndigo
```

## Components

### StudyVibe client

- [Study workspace](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Focus sessions](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Personal tasks](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Music and themes](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Progress tracking](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Admin analytics](https://github.com/silvee17/studyvibe/blob/main/client/src/App.jsx): `client/src/App.jsx`

### API services

- [Account and stats API](https://github.com/silvee17/studyvibe/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Study room API](https://github.com/silvee17/studyvibe/blob/main/server/routes/roomRoutes.js): `server/routes/roomRoutes.js`
- [HTTP server](https://github.com/silvee17/studyvibe/blob/main/server/index.js): `server/index.js`

### Persistence

- [User records](https://github.com/silvee17/studyvibe/blob/main/server/models/User.js): `server/models/User.js`
- [Study room records](https://github.com/silvee17/studyvibe/blob/main/server/models/StudyRoom.js): `server/models/StudyRoom.js`

### Other components

- **Learner**
- **Admin**
- **MongoDB**

## Connections

- Learner → Study workspace: uses (evidence: `client/src/App.jsx`)
- Admin → Study workspace: uses (evidence: `client/src/App.jsx`)
- HTTP server → Account and stats API: mounts routes (evidence: `server/index.js`)
- HTTP server → Study room API: mounts routes (evidence: `server/index.js`)
- HTTP server → MongoDB: connects to (evidence: `server/index.js`)
- Account and stats API → User records: reads and writes (evidence: `server/routes/authRoutes.js`)
- Study room API → Study room records: reads and writes (evidence: `server/routes/roomRoutes.js`)
