# shiva-hub577/womens-pg-website-repo-version2 architecture

> Architecture diagram of the GitHub repository shiva-hub577/womens-pg-website-repo-version2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shiva-hub577/womens-pg-website-repo-version2
- Repository: https://github.com/shiva-hub577/womens-pg-website-repo-version2

## Overview

Pujyasritha’s Living is a role-based women’s PG and hostel management portal. Residents, workers, and administrators enter through authentication and role-specific routes; the application then serves room, rent, complaint, or administrative workflows, with MongoDB-backed records and email notifications. Admin capabilities include occupancy oversight, allotment, payment reporting, complaint assignment, and verified resident departures; workers handle complaint progress and resolution. Monthly rent reminders are a separate API-triggered workflow. The graph follows documented routes and sampled controller dependencies; some template rendering and database wiring are documented only at a high level.

Main entry points: [`controllers/dashboardController.js`](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/dashboardController.js) (Occupancy and Payments), [`controllers/complaintController.js`](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/complaintController.js) (Complaint Lifecycle), [`app.js`](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/app.js) (Express Application), [`routes/tenantRoutes.js`](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/tenantRoutes.js) (Resident and Worker Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and UI"]
  node_authroutes["Authentication Routes<br/>[authRoutes.js]"]
  node_adminroutes["Admin Routes<br/>[adminRoutes.js]"]
  node_tenantworkeroutes["Resident and Worker Routes<br/>[tenantRoutes.js]"]
  node_views["Portal Screens"]
  node_landing["Landing Composition<br/>[LandingPage.jsx]"]
  node_hero["Hero and Navigation<br/>[Hero.jsx]"]
  node_featurepreview["Feature Preview<br/>[FeaturePreview.jsx]"]
  node_api["Reminder API<br/>[apiRoutes.js]"]
end

subgraph group_workflow["Portal Workflows"]
  node_auth["Authentication and OTP<br/>[authController.js]"]
  node_access["Role Protection<br/>[authMiddleware.js]"]
  node_adminops["Occupancy and Payments"]
  node_complaints["Complaint Lifecycle"]
  node_reminders["Rent Reminder Dispatch"]
  node_upload["Evidence Upload"]
end

subgraph group_records["Domain Records"]
  node_accounts[("Role Accounts<br/>[Tenant.js]")]
  node_roomdata[("Rooms and Residents<br/>[Room.js]")]
  node_payments[("Rent Payments<br/>[RentPayment.js]")]
  node_complaintrecords[("Complaint Records<br/>[Complaint.js]")]
  node_workerrecords[("Worker Records<br/>[Worker.js]")]
  node_otprecords[("Verification Records<br/>[Otp.js]")]
  node_removalrecords[("Departure Archive<br/>[RemovedTenant.js]")]
  node_notificationrecords[("Reminder Log<br/>[NotificationLog.js]")]
end

subgraph group_messaging["Notifications"]
  node_email["Email Service<br/>[emailservices.js]"]
end

subgraph group_infrastructure["Runtime"]
  node_webapp["Express Application<br/>[app.js]"]
  node_database[("MongoDB")]
end

node_resident(("Resident"))
node_admin(("Administrator"))
node_worker(("Maintenance Worker"))
node_mailprovider["Resend"]

node_webapp -->|"mounts"| node_authroutes
node_webapp -->|"mounts"| node_adminroutes
node_webapp -->|"mounts"| node_tenantworkeroutes
node_webapp -->|"mounts"| node_api
node_webapp -->|"sets user locals"| node_access
node_webapp -.->|"connects"| node_database
node_authroutes -->|"dispatches"| node_auth
node_authroutes -.->|"serves portal pages"| node_views
node_adminroutes -->|"guards admin routes"| node_access
node_adminroutes -->|"dispatches"| node_adminops
node_adminroutes -->|"dispatches"| node_complaints
node_tenantworkeroutes -->|"role protects"| node_access
node_tenantworkeroutes -->|"dispatches"| node_adminops
node_tenantworkeroutes -->|"dispatches"| node_complaints
node_adminroutes -->|"processes photos"| node_upload
node_tenantworkeroutes -->|"processes photos"| node_upload
node_tenantworkeroutes -->|"processes photos"| node_upload
node_api -->|"dispatches"| node_reminders
node_auth -->|"reads and writes"| node_accounts
node_auth -->|"reads and writes"| node_otprecords
node_auth -->|"looks up residents"| node_roomdata
node_auth -->|"sends verification"| node_email
node_adminops -->|"reads and updates"| node_roomdata
node_adminops -->|"updates accounts"| node_accounts
node_adminops -->|"reads and updates"| node_payments
node_adminops -->|"archives departures"| node_removalrecords
node_adminops -->|"reads complaints"| node_complaintrecords
node_adminops -->|"emails reports"| node_email
node_complaints -->|"reads and updates"| node_complaintrecords
node_complaints -->|"looks up residents"| node_roomdata
node_complaints -->|"looks up residents"| node_accounts
node_complaints -->|"assigns workers"| node_workerrecords
node_complaints -->|"sends alerts"| node_email
node_reminders -->|"reads occupancy"| node_roomdata
node_reminders -->|"reads and creates"| node_payments
node_reminders -->|"logs reminders"| node_notificationrecords
node_reminders -->|"sends reports"| node_email
node_email -->|"sends messages"| node_mailprovider
node_resident -.->|"uses portal"| node_authroutes
node_admin -.->|"uses portal"| node_authroutes
node_worker -.->|"uses portal"| node_authroutes
node_landing -->|"composes"| node_hero
node_landing -.->|"previews features"| node_featurepreview
node_adminops -.->|"renders admin pages"| node_views
node_complaints -.->|"renders complaint pages"| node_views

click node_webapp "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/app.js"
click node_authroutes "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/authRoutes.js"
click node_adminroutes "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/adminRoutes.js"
click node_tenantworkeroutes "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/tenantRoutes.js"
click node_views "https://github.com/shiva-hub577/womens-pg-website-repo-version2/tree/master/views"
click node_landing "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/components/LandingPage.jsx"
click node_hero "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/components/Hero.jsx"
click node_featurepreview "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/components/FeaturePreview.jsx"
click node_auth "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/authController.js"
click node_access "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/middlewares/authMiddleware.js"
click node_adminops "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/dashboardController.js"
click node_complaints "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/complaintController.js"
click node_reminders "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/reminderController.js"
click node_api "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/apiRoutes.js"
click node_upload "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/middlewares/uploadMiddleware.js"
click node_accounts "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Tenant.js"
click node_roomdata "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Room.js"
click node_payments "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/RentPayment.js"
click node_complaintrecords "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Complaint.js"
click node_workerrecords "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Worker.js"
click node_otprecords "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Otp.js"
click node_removalrecords "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/RemovedTenant.js"
click node_notificationrecords "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/NotificationLog.js"
click node_email "https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/services/emailservices.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_authroutes,node_adminroutes,node_tenantworkeroutes,node_views,node_landing,node_hero,node_featurepreview,node_api toneBlue
class node_auth,node_access,node_adminops,node_complaints,node_reminders,node_upload toneAmber
class node_accounts,node_roomdata,node_payments,node_complaintrecords,node_workerrecords,node_otprecords,node_removalrecords,node_notificationrecords toneMint
class node_email,node_worker toneRose
class node_webapp,node_database,node_resident,node_admin,node_mailprovider toneIndigo
```

## Components

### Entry and UI

- [Authentication Routes](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/authRoutes.js): `routes/authRoutes.js`
- [Admin Routes](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/adminRoutes.js): `routes/adminRoutes.js`
- [Resident and Worker Routes](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/tenantRoutes.js): `routes/tenantRoutes.js`
- [Portal Screens](https://github.com/shiva-hub577/womens-pg-website-repo-version2/tree/master/views): `views`
- [Landing Composition](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/components/LandingPage.jsx): `components/LandingPage.jsx`
- [Hero and Navigation](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/components/Hero.jsx): `components/Hero.jsx`
- [Feature Preview](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/components/FeaturePreview.jsx): `components/FeaturePreview.jsx`
- [Reminder API](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/routes/apiRoutes.js): `routes/apiRoutes.js`

### Portal Workflows

- [Authentication and OTP](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/authController.js): `controllers/authController.js`
- [Role Protection](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/middlewares/authMiddleware.js): `middlewares/authMiddleware.js`
- [Occupancy and Payments](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/dashboardController.js): `controllers/dashboardController.js`
- [Complaint Lifecycle](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/complaintController.js): `controllers/complaintController.js`
- [Rent Reminder Dispatch](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/controllers/reminderController.js): `controllers/reminderController.js`
- [Evidence Upload](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/middlewares/uploadMiddleware.js): `middlewares/uploadMiddleware.js`

### Domain Records

- [Role Accounts](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Tenant.js): `models/Tenant.js`
- [Rooms and Residents](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Room.js): `models/Room.js`
- [Rent Payments](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/RentPayment.js): `models/RentPayment.js`
- [Complaint Records](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Complaint.js): `models/Complaint.js`
- [Worker Records](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Worker.js): `models/Worker.js`
- [Verification Records](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/Otp.js): `models/Otp.js`
- [Departure Archive](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/RemovedTenant.js): `models/RemovedTenant.js`
- [Reminder Log](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/models/NotificationLog.js): `models/NotificationLog.js`

### Notifications

- [Email Service](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/services/emailservices.js): `services/emailservices.js`

### Runtime

- [Express Application](https://github.com/shiva-hub577/womens-pg-website-repo-version2/blob/master/app.js): `app.js`
- **MongoDB**

### Other components

- **Resident**
- **Administrator**
- **Maintenance Worker**
- **Resend**

## Connections

- Express Application → Authentication Routes: mounts (evidence: `app.js`)
- Express Application → Admin Routes: mounts (evidence: `app.js`)
- Express Application → Resident and Worker Routes: mounts (evidence: `app.js`)
- Express Application → Reminder API: mounts (evidence: `app.js`)
- Express Application → Role Protection: sets user locals (evidence: `app.js`)
- Express Application → MongoDB: connects
- Authentication Routes → Authentication and OTP: dispatches (evidence: `routes/authRoutes.js`)
- Authentication Routes → Portal Screens: serves portal pages (evidence: `README.md`)
- Admin Routes → Role Protection: guards admin routes (evidence: `routes/adminRoutes.js`)
- Admin Routes → Occupancy and Payments: dispatches (evidence: `routes/adminRoutes.js`)
- Admin Routes → Complaint Lifecycle: dispatches (evidence: `routes/adminRoutes.js`)
- Resident and Worker Routes → Role Protection: role protects (evidence: `routes/tenantRoutes.js`)
- Resident and Worker Routes → Occupancy and Payments: dispatches (evidence: `routes/tenantRoutes.js`)
- Resident and Worker Routes → Complaint Lifecycle: dispatches (evidence: `routes/tenantRoutes.js`)
- Admin Routes → Evidence Upload: processes photos (evidence: `routes/adminRoutes.js`)
- Resident and Worker Routes → Evidence Upload: processes photos (evidence: `routes/tenantRoutes.js`)
- Resident and Worker Routes → Evidence Upload: processes photos (evidence: `routes/tenantRoutes.js`)
- Reminder API → Rent Reminder Dispatch: dispatches (evidence: `routes/apiRoutes.js`)
- Authentication and OTP → Role Accounts: reads and writes (evidence: `controllers/authController.js`)
- Authentication and OTP → Verification Records: reads and writes (evidence: `controllers/authController.js`)
- Authentication and OTP → Rooms and Residents: looks up residents (evidence: `controllers/authController.js`)
- Authentication and OTP → Email Service: sends verification (evidence: `controllers/authController.js`)
- Occupancy and Payments → Rooms and Residents: reads and updates (evidence: `controllers/dashboardController.js`)
- Occupancy and Payments → Role Accounts: updates accounts (evidence: `controllers/dashboardController.js`)
- Occupancy and Payments → Rent Payments: reads and updates (evidence: `controllers/dashboardController.js`)
- Occupancy and Payments → Departure Archive: archives departures (evidence: `controllers/dashboardController.js`)
- Occupancy and Payments → Complaint Records: reads complaints (evidence: `controllers/dashboardController.js`)
- Occupancy and Payments → Email Service: emails reports (evidence: `controllers/dashboardController.js`)
- Complaint Lifecycle → Complaint Records: reads and updates (evidence: `controllers/complaintController.js`)
- Complaint Lifecycle → Rooms and Residents: looks up residents (evidence: `controllers/complaintController.js`)
- Complaint Lifecycle → Role Accounts: looks up residents (evidence: `controllers/complaintController.js`)
- Complaint Lifecycle → Worker Records: assigns workers (evidence: `controllers/complaintController.js`)
- Complaint Lifecycle → Email Service: sends alerts (evidence: `controllers/complaintController.js`)
- Rent Reminder Dispatch → Rooms and Residents: reads occupancy (evidence: `controllers/reminderController.js`)
- Rent Reminder Dispatch → Rent Payments: reads and creates (evidence: `controllers/reminderController.js`)
- Rent Reminder Dispatch → Reminder Log: logs reminders (evidence: `controllers/reminderController.js`)
- Rent Reminder Dispatch → Email Service: sends reports (evidence: `controllers/reminderController.js`)
- Email Service → Resend: sends messages (evidence: `services/emailservices.js`)
- Resident → Authentication Routes: uses portal (evidence: `README.md`)
- Administrator → Authentication Routes: uses portal (evidence: `README.md`)
- Maintenance Worker → Authentication Routes: uses portal (evidence: `README.md`)
- Landing Composition → Hero and Navigation: composes (evidence: `components/LandingPage.jsx`)
- Landing Composition → Feature Preview: previews features
- Occupancy and Payments → Portal Screens: renders admin pages (evidence: `README.md`)
- Complaint Lifecycle → Portal Screens: renders complaint pages (evidence: `README.md`)
