# sushant-didwagh/fsd-complete-project architecture

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

- Interactive diagram: https://gitdiagram.com/sushant-didwagh/fsd-complete-project
- Repository: https://github.com/sushant-didwagh/fsd-complete-project

## Overview

Student Buddy is a role-based mentorship platform for students, mentors, and admins. Students register or sign in, discover mentors and mentorships, then use shared notes, real-time chat, and an AI assistant; mentors manage profiles, students, and notes, while admins review mentor applications. The React app routes role-specific pages to an Express API, whose controllers use MongoDB models and external services. Several domain modules were not sampled, so their internal call relationships are omitted; README-documented capabilities are retained without asserting unverified wiring.

Main entry points: [`client/src/App.jsx`](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/App.jsx) (Role-based pages), [`client/src/pages/student`](https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages/student) (Student workspace), [`server/models`](https://github.com/sushant-didwagh/fsd-complete-project/tree/main/server/models) (MongoDB domain records), [`server/routes/noteRoutes.js`](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/routes/noteRoutes.js) (Notes endpoints)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Role-based pages<br/>[App.jsx]"]
  node_authui["Login and registration"]
  node_studentui["Student workspace"]
  node_mentorui["Mentor workspace"]
  node_adminui["Admin panel<br/>[AdminPanel.jsx]"]
  node_authstate["Session state<br/>[AuthContext.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authroutes["Auth endpoints<br/>[authRoutes.js]"]
  node_authlogic["Registration and login<br/>[authController.js]"]
  node_authguard["JWT role guard<br/>[authMiddleware.js]"]
  node_otp["OTP email<br/>[sendOTP.js]"]
end

subgraph group_mentorship["Mentorship operations"]
  node_mentorops["Mentor discovery and profile"]
  node_mentorshipops["Mentorship management"]
  node_adminops["Application review<br/>[adminController.js]"]
end

subgraph group_learning["Learning services"]
  node_noteroutes["Notes endpoints<br/>[noteRoutes.js]"]
  node_noteops["Notes and downloads<br/>[noteController.js]"]
  node_aiops["AI assistant<br/>[aiController.js]"]
  node_chatops["Chat history<br/>[chatController.js]"]
  node_socket["Live chat events<br/>[chatSocket.js]"]
end

subgraph group_platform["API and persistence"]
  node_cloudinary["Cloudinary storage<br/>[cloudinary.js]"]
  node_models[("MongoDB domain records")]
  node_server["Express API and socket host<br/>[server.js]"]
  node_db[("MongoDB connection<br/>[db.js]")]
end

node_student(("Student"))
node_mentor(("Mentor"))
node_admin(("Admin"))

node_student -->|"uses"| node_app
node_mentor -->|"uses"| node_app
node_admin -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_studentui
node_app -->|"routes to"| node_mentorui
node_app -->|"routes to"| node_adminui
node_app -->|"provides"| node_authstate
node_authui -->|"updates session"| node_authstate
node_authui -.->|"submits auth"| node_authroutes
node_studentui -.->|"browses mentors"| node_mentorops
node_studentui -.->|"requests sessions"| node_mentorshipops
node_mentorui -.->|"manages students"| node_mentorshipops
node_adminui -.->|"reviews mentors"| node_adminops
node_studentui -.->|"uses notes"| node_noteroutes
node_mentorui -.->|"uploads notes"| node_noteroutes
node_studentui -.->|"asks questions"| node_aiops
node_studentui -.->|"chats live"| node_socket
node_mentorui -.->|"chats live"| node_socket
node_server -->|"connects"| node_db
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_noteroutes
node_server -->|"initializes"| node_socket
node_authroutes -->|"dispatches"| node_authlogic
node_authroutes -->|"protects"| node_authguard
node_authlogic -->|"reads and writes"| node_models
node_authlogic -->|"sends code"| node_otp
node_noteroutes -->|"dispatches"| node_noteops
node_noteroutes -->|"protects"| node_authguard
node_noteops -->|"reads and writes"| node_models
node_noteops -->|"stores and deletes files"| node_cloudinary
node_adminops -->|"reads and updates"| node_models
node_mentorops -->|"reads and updates"| node_models
node_mentorshipops -->|"reads and updates"| node_models
node_chatops -->|"reads messages"| node_models
node_socket -->|"persists messages"| node_models

click node_app "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/App.jsx"
click node_authui "https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages"
click node_studentui "https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages/student"
click node_mentorui "https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages/mentor"
click node_adminui "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/pages/admin/AdminPanel.jsx"
click node_authstate "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/context/AuthContext.jsx"
click node_authroutes "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/routes/authRoutes.js"
click node_authlogic "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/authController.js"
click node_authguard "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/middlewares/authMiddleware.js"
click node_otp "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/utils/sendOTP.js"
click node_mentorops "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/mentorController.js"
click node_mentorshipops "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/mentorshipController.js"
click node_adminops "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/adminController.js"
click node_noteroutes "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/routes/noteRoutes.js"
click node_noteops "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/noteController.js"
click node_aiops "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/aiController.js"
click node_chatops "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/chatController.js"
click node_socket "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/sockets/chatSocket.js"
click node_cloudinary "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/config/cloudinary.js"
click node_models "https://github.com/sushant-didwagh/fsd-complete-project/tree/main/server/models"
click node_server "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/server.js"
click node_db "https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/config/db.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_authui,node_studentui,node_mentorui,node_adminui,node_authstate toneBlue
class node_authroutes,node_authlogic,node_authguard,node_otp toneAmber
class node_mentorops,node_mentorshipops,node_adminops toneMint
class node_noteroutes,node_noteops,node_aiops,node_chatops,node_socket toneRose
class node_cloudinary,node_models,node_server,node_db,node_student,node_mentor,node_admin toneIndigo
```

## Components

### Web application

- [Role-based pages](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Login and registration](https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages): `client/src/pages`
- [Student workspace](https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages/student): `client/src/pages/student`
- [Mentor workspace](https://github.com/sushant-didwagh/fsd-complete-project/tree/main/client/src/pages/mentor): `client/src/pages/mentor`
- [Admin panel](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/pages/admin/AdminPanel.jsx): `client/src/pages/admin/AdminPanel.jsx`
- [Session state](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`

### Identity and access

- [Auth endpoints](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Registration and login](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [JWT role guard](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/middlewares/authMiddleware.js): `server/middlewares/authMiddleware.js`
- [OTP email](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/utils/sendOTP.js): `server/utils/sendOTP.js`

### Mentorship operations

- [Mentor discovery and profile](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/mentorController.js): `server/controllers/mentorController.js`
- [Mentorship management](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/mentorshipController.js): `server/controllers/mentorshipController.js`
- [Application review](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/adminController.js): `server/controllers/adminController.js`

### Learning services

- [Notes endpoints](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/routes/noteRoutes.js): `server/routes/noteRoutes.js`
- [Notes and downloads](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/noteController.js): `server/controllers/noteController.js`
- [AI assistant](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/aiController.js): `server/controllers/aiController.js`
- [Chat history](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/controllers/chatController.js): `server/controllers/chatController.js`
- [Live chat events](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/sockets/chatSocket.js): `server/sockets/chatSocket.js`

### API and persistence

- [Cloudinary storage](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/config/cloudinary.js): `server/config/cloudinary.js`
- [MongoDB domain records](https://github.com/sushant-didwagh/fsd-complete-project/tree/main/server/models): `server/models`
- [Express API and socket host](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/server.js): `server/server.js`
- [MongoDB connection](https://github.com/sushant-didwagh/fsd-complete-project/blob/main/server/config/db.js): `server/config/db.js`

### Other components

- **Student**
- **Mentor**
- **Admin**

## Connections

- Student → Role-based pages: uses (evidence: `README.md`)
- Mentor → Role-based pages: uses (evidence: `README.md`)
- Admin → Role-based pages: uses (evidence: `README.md`)
- Role-based pages → Login and registration: routes to (evidence: `client/src/App.jsx`)
- Role-based pages → Student workspace: routes to (evidence: `client/src/App.jsx`)
- Role-based pages → Mentor workspace: routes to (evidence: `client/src/App.jsx`)
- Role-based pages → Admin panel: routes to (evidence: `client/src/App.jsx`)
- Role-based pages → Session state: provides (evidence: `client/src/App.jsx`)
- Login and registration → Session state: updates session (evidence: `client/src/pages/LoginMentor.jsx`)
- Login and registration → Auth endpoints: submits auth
- Student workspace → Mentor discovery and profile: browses mentors
- Student workspace → Mentorship management: requests sessions
- Mentor workspace → Mentorship management: manages students
- Admin panel → Application review: reviews mentors
- Student workspace → Notes endpoints: uses notes
- Mentor workspace → Notes endpoints: uploads notes
- Student workspace → AI assistant: asks questions
- Student workspace → Live chat events: chats live
- Mentor workspace → Live chat events: chats live
- Express API and socket host → MongoDB connection: connects (evidence: `server/server.js`)
- Express API and socket host → Auth endpoints: mounts (evidence: `server/server.js`)
- Express API and socket host → Notes endpoints: mounts (evidence: `server/server.js`)
- Express API and socket host → Live chat events: initializes (evidence: `server/server.js`)
- Auth endpoints → Registration and login: dispatches (evidence: `server/routes/authRoutes.js`)
- Auth endpoints → JWT role guard: protects (evidence: `server/routes/authRoutes.js`)
- Registration and login → MongoDB domain records: reads and writes (evidence: `server/controllers/authController.js`)
- Registration and login → OTP email: sends code (evidence: `server/controllers/authController.js`)
- Notes endpoints → Notes and downloads: dispatches (evidence: `server/routes/noteRoutes.js`)
- Notes endpoints → JWT role guard: protects (evidence: `server/routes/noteRoutes.js`)
- Notes and downloads → MongoDB domain records: reads and writes (evidence: `server/controllers/noteController.js`)
- Notes and downloads → Cloudinary storage: stores and deletes files (evidence: `server/controllers/noteController.js`)
- Application review → MongoDB domain records: reads and updates (evidence: `server/controllers/adminController.js`)
- Mentor discovery and profile → MongoDB domain records: reads and updates (evidence: `server/controllers/mentorController.js`)
- Mentorship management → MongoDB domain records: reads and updates (evidence: `server/controllers/mentorshipController.js`)
- Chat history → MongoDB domain records: reads messages (evidence: `server/controllers/chatController.js`)
- Live chat events → MongoDB domain records: persists messages (evidence: `server/sockets/chatSocket.js`)
