# snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system architecture

> Architecture diagram of the GitHub repository snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system
- Repository: https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system

## Overview

Atharva Society is a residential-community management web application for residents, managers, administrators, and watch staff. Users enter through role-specific web pages to handle maintenance payments, complaints, emergencies, assets, notices, services, and visitor logs; the Express API applies authentication and domain operations, with MongoDB-backed records and scheduled billing/reminder jobs. The README describes these capabilities, while the supplied source excerpts and index expose selected backend wiring. Client-to-endpoint details and several unsampled controllers are not verified, so those links are omitted or marked unverified.

Main entry points: [`server/models`](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/models) (Society records), [`server/server.js`](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/server.js) (REST API server), [`server/services/email.service.js`](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/services/email.service.js) (Email notifications), [`server/controllers/payment.controller.js`](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/payment.controller.js) (Payment verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_web_portals["Role portals"]
  node_complaint_ui["Complaint tracking<br/>[page.tsx]"]
  node_maintenance_ui["Maintenance payments<br/>[page.tsx]"]
  node_emergency_ui["Emergency response<br/>[page.tsx]"]
  node_watchman_ui["Gate and watchman<br/>[page.tsx]"]
end

subgraph group_api["API and access"]
  node_api_server["REST API server<br/>[server.js]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.js]"]
  node_auth_logic["Authentication<br/>[auth.controller.js]"]
  node_access_control["Role access control<br/>[auth.middleware.js]"]
end

subgraph group_operations["Society operations"]
  node_complaint_logic["Complaint resolution"]
  node_emergency_logic["Emergency dispatch"]
  node_asset_logic["Asset tracking"]
  node_community_features["Notices and services"]
  node_gate_events["Gate visitor logs"]
  node_records[("Society records")]
end

subgraph group_billing["Billing and messaging"]
  node_maintenance_logic["Maintenance operations"]
  node_payment_logic["Payment verification"]
  node_billing_jobs["Billing schedules"]
  node_email_service["Email notifications<br/>[email.service.js]"]
end

node_residents(("Residents"))
node_staff(("Society staff"))
node_razorpay["Razorpay"]
node_mongodb[("MongoDB")]

node_residents -->|"use"| node_web_portals
node_staff -->|"manage through"| node_web_portals
node_residents -->|"submit complaints"| node_complaint_ui
node_residents -->|"pay maintenance"| node_maintenance_ui
node_residents -->|"trigger SOS"| node_emergency_ui
node_staff -->|"log visitors"| node_watchman_ui
node_web_portals -.->|"calls API"| node_api_server
node_api_server -->|"mounts routes"| node_auth_routes
node_api_server -.->|"routes requests"| node_maintenance_logic
node_api_server -.->|"routes requests"| node_complaint_logic
node_api_server -.->|"routes requests"| node_emergency_logic
node_auth_routes -->|"dispatches to"| node_auth_logic
node_auth_routes -->|"protects session route"| node_access_control
node_auth_logic -->|"reads and writes users"| node_records
node_access_control -->|"loads user"| node_records
node_maintenance_logic -->|"reads and writes billing"| node_records
node_maintenance_logic -->|"creates orders"| node_razorpay
node_payment_logic -->|"updates payment records"| node_records
node_payment_logic -->|"verifies payments"| node_razorpay
node_payment_logic -->|"sends confirmation"| node_email_service
node_billing_jobs -->|"generates and updates billing"| node_records
node_billing_jobs -->|"sends reminders"| node_email_service
node_complaint_logic -->|"reads and writes complaints"| node_records
node_complaint_logic -->|"sends updates"| node_email_service
node_asset_logic -->|"reads and writes assets"| node_records
node_emergency_logic -.->|"sends alerts"| node_email_service
node_records -->|"persists documents"| node_mongodb

click node_web_portals "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/client/src/app"
click node_complaint_ui "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/(dashboard)/complaints/page.tsx"
click node_maintenance_ui "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/(dashboard)/maintenance/page.tsx"
click node_emergency_ui "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/(dashboard)/emergency/page.tsx"
click node_watchman_ui "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/watchman/gate-log/page.tsx"
click node_api_server "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/server.js"
click node_auth_routes "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/routes/auth.routes.js"
click node_auth_logic "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/auth.controller.js"
click node_access_control "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/middleware/auth.middleware.js"
click node_complaint_logic "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/complaint.controller.js"
click node_emergency_logic "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/emergency.controller.js"
click node_asset_logic "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/asset.controller.js"
click node_community_features "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/controllers"
click node_gate_events "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/gatelog.controller.js"
click node_maintenance_logic "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/maintenance.controller.js"
click node_payment_logic "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/payment.controller.js"
click node_billing_jobs "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/jobs"
click node_email_service "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/services/email.service.js"
click node_records "https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/models"

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_portals,node_complaint_ui,node_maintenance_ui,node_emergency_ui,node_watchman_ui toneBlue
class node_api_server,node_auth_routes,node_auth_logic,node_access_control,node_mongodb toneAmber
class node_complaint_logic,node_emergency_logic,node_asset_logic,node_community_features,node_gate_events,node_records toneMint
class node_maintenance_logic,node_payment_logic,node_billing_jobs,node_email_service toneRose
class node_residents,node_staff,node_razorpay toneIndigo
```

## Components

### Web application

- [Role portals](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/client/src/app): `client/src/app`
- [Complaint tracking](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/(dashboard)/complaints/page.tsx): `client/src/app/(dashboard)/complaints/page.tsx`
- [Maintenance payments](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/(dashboard)/maintenance/page.tsx): `client/src/app/(dashboard)/maintenance/page.tsx`
- [Emergency response](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/(dashboard)/emergency/page.tsx): `client/src/app/(dashboard)/emergency/page.tsx`
- [Gate and watchman](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/client/src/app/watchman/gate-log/page.tsx): `client/src/app/watchman/gate-log/page.tsx`

### API and access

- [REST API server](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/server.js): `server/server.js`
- [Authentication routes](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/routes/auth.routes.js): `server/routes/auth.routes.js`
- [Authentication](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/auth.controller.js): `server/controllers/auth.controller.js`
- [Role access control](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/middleware/auth.middleware.js): `server/middleware/auth.middleware.js`

### Society operations

- [Complaint resolution](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/complaint.controller.js): `server/controllers/complaint.controller.js`
- [Emergency dispatch](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/emergency.controller.js): `server/controllers/emergency.controller.js`
- [Asset tracking](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/asset.controller.js): `server/controllers/asset.controller.js`
- [Notices and services](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/controllers): `server/controllers`
- [Gate visitor logs](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/gatelog.controller.js): `server/controllers/gatelog.controller.js`
- [Society records](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/models): `server/models`

### Billing and messaging

- [Maintenance operations](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/maintenance.controller.js): `server/controllers/maintenance.controller.js`
- [Payment verification](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/controllers/payment.controller.js): `server/controllers/payment.controller.js`
- [Billing schedules](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/tree/main/server/jobs): `server/jobs`
- [Email notifications](https://github.com/snehalkrushnabandal/atharva-society-ai-powered-smart-society-management-system/blob/main/server/services/email.service.js): `server/services/email.service.js`

### Other components

- **Residents**
- **Society staff**
- **Razorpay**
- **MongoDB**

## Connections

- Residents → Role portals: use (evidence: `README.md`)
- Society staff → Role portals: manage through (evidence: `README.md`)
- Residents → Complaint tracking: submit complaints (evidence: `README.md`)
- Residents → Maintenance payments: pay maintenance (evidence: `README.md`)
- Residents → Emergency response: trigger SOS (evidence: `README.md`)
- Society staff → Gate and watchman: log visitors (evidence: `README.md`)
- Role portals → REST API server: calls API
- REST API server → Authentication routes: mounts routes (evidence: `server/server.js`)
- REST API server → Maintenance operations: routes requests
- REST API server → Complaint resolution: routes requests
- REST API server → Emergency dispatch: routes requests
- Authentication routes → Authentication: dispatches to (evidence: `server/routes/auth.routes.js`)
- Authentication routes → Role access control: protects session route (evidence: `server/routes/auth.routes.js`)
- Authentication → Society records: reads and writes users (evidence: `server/controllers/auth.controller.js`)
- Role access control → Society records: loads user (evidence: `server/middleware/auth.middleware.js`)
- Maintenance operations → Society records: reads and writes billing (evidence: `server/controllers/maintenance.controller.js`)
- Maintenance operations → Razorpay: creates orders (evidence: `server/controllers/maintenance.controller.js`)
- Payment verification → Society records: updates payment records (evidence: `server/controllers/payment.controller.js`)
- Payment verification → Razorpay: verifies payments (evidence: `server/controllers/payment.controller.js`)
- Payment verification → Email notifications: sends confirmation (evidence: `server/controllers/payment.controller.js`)
- Billing schedules → Society records: generates and updates billing (evidence: `server/jobs/index.js`)
- Billing schedules → Email notifications: sends reminders (evidence: `server/jobs/index.js`)
- Complaint resolution → Society records: reads and writes complaints (evidence: `server/controllers/complaint.controller.js`)
- Complaint resolution → Email notifications: sends updates (evidence: `server/controllers/complaint.controller.js`)
- Asset tracking → Society records: reads and writes assets (evidence: `server/controllers/asset.controller.js`)
- Emergency dispatch → Email notifications: sends alerts
- Society records → MongoDB: persists documents (evidence: `README.md`)
