# hemant-kumar24/studnest architecture

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

- Interactive diagram: https://gitdiagram.com/hemant-kumar24/studnest
- Repository: https://github.com/hemant-kumar24/studnest

## Overview

StudNest connects student accommodation discovery to room bookings and payments, with ongoing account, review, complaint, and notification workflows. Students and admins use the React client, which calls Express APIs backed by MongoDB; payment and image storage also rely on external providers. The README documents broader management features than the sampled controller excerpts, so those are represented at their documented module paths without inferring internal calls beyond the evidence.

Main entry points: [`Backend/index.js`](https://github.com/hemant-kumar24/studnest/blob/main/Backend/index.js) (REST API server), [`Backend/config/db.js`](https://github.com/hemant-kumar24/studnest/blob/main/Backend/config/db.js) (MongoDB records), [`Backend/controllers/reviewController.js`](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/reviewController.js) (Reviews and ratings), [`Backend/controllers/hostelController.js`](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/hostelController.js) (Hostel discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_web["Web application<br/>[App.jsx]"]
  node_routes["Role-based pages<br/>[AppRoutes.jsx]"]
end

subgraph group_api["API and access"]
  node_auth["Authentication<br/>[authController.js]"]
  node_server["REST API server<br/>[index.js]"]
  node_mongo[("MongoDB records<br/>[db.js]")]
end

subgraph group_accommodation["Accommodation lifecycle"]
  node_booking["Booking management"]
  node_hostels["Hostel discovery"]
  node_rooms["Room management<br/>[roomController.js]"]
  node_location["Nearby search"]
  node_payments["Booking payments"]
end

subgraph group_engagement["Student services"]
  node_reviews["Reviews and ratings"]
  node_complaints["Complaint support"]
  node_notifications["Notifications"]
  node_userdash["Student account"]
end

subgraph group_operations["Admin operations"]
  node_admin_management["Admin management<br/>[adminController.js]"]
  node_adminbook["Booking oversight"]
  node_adminhostel["Listing oversight"]
  node_adminpay["Payment oversight"]
  node_adminreview["Review moderation"]
  node_admincomplaint["Complaint handling"]
  node_analytics["Dashboard analytics"]
end

node_student(("Student"))
node_admin(("Admin"))
node_razorpay["Razorpay"]
node_cloudinary["Cloudinary"]

node_student -->|"uses"| node_web
node_admin -->|"uses"| node_web
node_web -->|"renders"| node_routes
node_routes -->|"calls APIs"| node_server
node_server -->|"dispatches"| node_auth
node_server -->|"dispatches"| node_hostels
node_server -->|"dispatches"| node_rooms
node_server -->|"dispatches"| node_location
node_server -->|"dispatches"| node_booking
node_server -->|"dispatches"| node_payments
node_server -->|"dispatches"| node_reviews
node_server -->|"dispatches"| node_complaints
node_server -->|"dispatches"| node_notifications
node_server -->|"dispatches"| node_userdash
node_server -->|"dispatches"| node_admin_management
node_server -->|"dispatches"| node_adminbook
node_server -->|"dispatches"| node_adminhostel
node_server -->|"dispatches"| node_adminpay
node_server -->|"dispatches"| node_adminreview
node_server -->|"dispatches"| node_admincomplaint
node_server -->|"dispatches"| node_analytics
node_auth -->|"reads/writes"| node_mongo
node_booking -->|"reads/writes"| node_mongo
node_hostels -->|"reads/writes"| node_mongo
node_rooms -->|"reads/writes"| node_mongo
node_location -->|"queries"| node_mongo
node_payments -->|"reads/writes"| node_mongo
node_payments -.->|"processes payments"| node_razorpay
node_hostels -.->|"uploads images"| node_cloudinary
node_reviews -->|"reads/writes"| node_mongo
node_reviews -->|"checks eligibility"| node_booking
node_reviews -->|"notifies admins"| node_notifications
node_complaints -->|"reads/writes"| node_mongo
node_notifications -->|"stores notices"| node_mongo
node_userdash -->|"reads/writes"| node_mongo
node_admin_management -->|"reads/writes"| node_mongo
node_adminbook -->|"reads/writes"| node_mongo
node_adminhostel -->|"reads/writes"| node_mongo
node_adminpay -->|"reads"| node_mongo
node_adminreview -->|"reads/writes"| node_mongo
node_admincomplaint -->|"reads/writes"| node_mongo
node_analytics -->|"queries"| node_mongo

click node_web "https://github.com/hemant-kumar24/studnest/blob/main/Frontend/src/App.jsx"
click node_routes "https://github.com/hemant-kumar24/studnest/blob/main/Frontend/src/routes/AppRoutes.jsx"
click node_auth "https://github.com/hemant-kumar24/studnest/blob/main/Backend/config/authController.js"
click node_server "https://github.com/hemant-kumar24/studnest/blob/main/Backend/index.js"
click node_booking "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/bookingController.js"
click node_hostels "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/hostelController.js"
click node_rooms "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/roomController.js"
click node_location "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/locationController.js"
click node_payments "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/paymentController.js"
click node_reviews "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/reviewController.js"
click node_complaints "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/complaintController.js"
click node_notifications "https://github.com/hemant-kumar24/studnest/blob/main/Backend/utils/notificationService.js"
click node_userdash "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/dashboardController.js"
click node_admin_management "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminController.js"
click node_adminbook "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/bookingController.js"
click node_adminhostel "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminHostelController.js"
click node_adminpay "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminPaymentController.js"
click node_adminreview "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminReviewController.js"
click node_admincomplaint "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminComplaintController.js"
click node_analytics "https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminDashboardController.js"
click node_mongo "https://github.com/hemant-kumar24/studnest/blob/main/Backend/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_web,node_routes toneBlue
class node_auth,node_server,node_mongo toneAmber
class node_booking,node_hostels,node_rooms,node_location,node_payments toneMint
class node_reviews,node_complaints,node_notifications,node_userdash toneRose
class node_admin_management,node_adminbook,node_adminhostel,node_adminpay,node_adminreview,node_admincomplaint,node_analytics,node_student,node_admin,node_razorpay,node_cloudinary toneIndigo
```

## Components

### React client

- [Web application](https://github.com/hemant-kumar24/studnest/blob/main/Frontend/src/App.jsx): `Frontend/src/App.jsx`
- [Role-based pages](https://github.com/hemant-kumar24/studnest/blob/main/Frontend/src/routes/AppRoutes.jsx): `Frontend/src/routes/AppRoutes.jsx`

### API and access

- [Authentication](https://github.com/hemant-kumar24/studnest/blob/main/Backend/config/authController.js): `Backend/config/authController.js`
- [REST API server](https://github.com/hemant-kumar24/studnest/blob/main/Backend/index.js): `Backend/index.js`
- [MongoDB records](https://github.com/hemant-kumar24/studnest/blob/main/Backend/config/db.js): `Backend/config/db.js`

### Accommodation lifecycle

- [Booking management](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/bookingController.js): `Backend/controllers/bookingController.js`
- [Hostel discovery](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/hostelController.js): `Backend/controllers/hostelController.js`
- [Room management](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/roomController.js): `Backend/controllers/roomController.js`
- [Nearby search](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/locationController.js): `Backend/controllers/locationController.js`
- [Booking payments](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/paymentController.js): `Backend/controllers/paymentController.js`

### Student services

- [Reviews and ratings](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/reviewController.js): `Backend/controllers/reviewController.js`
- [Complaint support](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/complaintController.js): `Backend/controllers/complaintController.js`
- [Notifications](https://github.com/hemant-kumar24/studnest/blob/main/Backend/utils/notificationService.js): `Backend/utils/notificationService.js`
- [Student account](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/dashboardController.js): `Backend/controllers/dashboardController.js`

### Admin operations

- [Admin management](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminController.js): `Backend/controllers/adminController.js`
- [Booking oversight](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/bookingController.js): `Backend/controllers/bookingController.js`
- [Listing oversight](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminHostelController.js): `Backend/controllers/adminHostelController.js`
- [Payment oversight](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminPaymentController.js): `Backend/controllers/adminPaymentController.js`
- [Review moderation](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminReviewController.js): `Backend/controllers/adminReviewController.js`
- [Complaint handling](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminComplaintController.js): `Backend/controllers/adminComplaintController.js`
- [Dashboard analytics](https://github.com/hemant-kumar24/studnest/blob/main/Backend/controllers/adminDashboardController.js): `Backend/controllers/adminDashboardController.js`

### Other components

- **Student**
- **Admin**
- **Razorpay**
- **Cloudinary**

## Connections

- Student → Web application: uses
- Admin → Web application: uses
- Web application → Role-based pages: renders
- Role-based pages → REST API server: calls APIs
- REST API server → Authentication: dispatches
- REST API server → Hostel discovery: dispatches
- REST API server → Room management: dispatches
- REST API server → Nearby search: dispatches
- REST API server → Booking management: dispatches
- REST API server → Booking payments: dispatches
- REST API server → Reviews and ratings: dispatches
- REST API server → Complaint support: dispatches
- REST API server → Notifications: dispatches
- REST API server → Student account: dispatches
- REST API server → Admin management: dispatches
- REST API server → Booking oversight: dispatches
- REST API server → Listing oversight: dispatches
- REST API server → Payment oversight: dispatches
- REST API server → Review moderation: dispatches
- REST API server → Complaint handling: dispatches
- REST API server → Dashboard analytics: dispatches
- Authentication → MongoDB records: reads/writes
- Booking management → MongoDB records: reads/writes
- Hostel discovery → MongoDB records: reads/writes
- Room management → MongoDB records: reads/writes
- Nearby search → MongoDB records: queries
- Booking payments → MongoDB records: reads/writes
- Booking payments → Razorpay: processes payments
- Hostel discovery → Cloudinary: uploads images
- Reviews and ratings → MongoDB records: reads/writes
- Reviews and ratings → Booking management: checks eligibility
- Reviews and ratings → Notifications: notifies admins
- Complaint support → MongoDB records: reads/writes
- Notifications → MongoDB records: stores notices
- Student account → MongoDB records: reads/writes
- Admin management → MongoDB records: reads/writes
- Booking oversight → MongoDB records: reads/writes
- Listing oversight → MongoDB records: reads/writes
- Payment oversight → MongoDB records: reads
- Review moderation → MongoDB records: reads/writes
- Complaint handling → MongoDB records: reads/writes
- Dashboard analytics → MongoDB records: queries
