# omkarmadchetti5758/mysocietysuitebe architecture

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

- Interactive diagram: https://gitdiagram.com/omkarmadchetti5758/mysocietysuitebe
- Repository: https://github.com/omkarmadchetti5758/mysocietysuitebe

## Overview

This is a multi-tenant society-management API. The principal workflow is a client request entering the Express application, passing through versioned routes and authentication, resolving society-scoped identity and permissions, then invoking a domain capability backed by the control-plane or operations database. The tree also shows financial management, community operations, reporting, AI assistance, and platform administration. Evidence is limited to the supplied source index and excerpts; unsampled feature internals and some route-to-service wiring are represented only where supported or left unconnected.

Main entry points: [`src/routes/v1/index.js`](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/routes/v1/index.js) (Versioned routes), [`src/modules/auth/auth.service.js`](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/auth/auth.service.js) (Authentication), [`src/server.js`](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/server.js) (HTTP server), [`src/app.js`](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/app.js) (Express application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_server["HTTP server<br/>[server.js]"]
  node_app["Express application<br/>[app.js]"]
  node_routes["Versioned routes<br/>[index.js]"]
  node_operationsdb[("Operations database<br/>[operationsDb.js]")]
end

subgraph group_identity["Identity and access"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_auth["Authentication<br/>[auth.service.js]"]
  node_permissions["Permission resolution"]
  node_masterdb[("Master database<br/>[masterDb.js]")]
  node_otp["OTP delivery<br/>[otp.service.js]"]
end

subgraph group_community["Society operations"]
  node_society["Society administration"]
  node_residents["Residents and homes"]
  node_visitors["Visitors and access"]
  node_amenities["Amenities and bookings"]
  node_complaints["Complaints and notices"]
  node_staff["Staff operations"]
end

subgraph group_finance["Finance and billing"]
  node_billing["Billing and payments"]
  node_ledger["Ledger and reconciliation"]
  node_reports["Financial reports"]
end

subgraph group_platform["Platform capabilities"]
  node_dashboard["Dashboard"]
  node_ai["AI assistant"]
  node_documents["Document management"]
  node_storage["Object storage<br/>[storage.service.js]"]
  node_email["Email delivery<br/>[email.service.js]"]
end

node_client(("API client"))

node_client -->|"sends request"| node_server
node_server -->|"serves"| node_app
node_app -->|"mounts routes"| node_routes
node_routes -->|"registers"| node_authroutes
node_authroutes -.->|"dispatches"| node_auth
node_auth -->|"resolves access"| node_permissions
node_auth -->|"reads identity"| node_masterdb
node_auth -->|"reads user"| node_operationsdb
node_server -->|"connects"| node_masterdb
node_server -->|"connects"| node_operationsdb
node_auth -->|"sends invitations"| node_email
node_auth -->|"uses OTP"| node_otp
node_routes -->|"registers routes"| node_society
node_routes -->|"registers routes"| node_residents
node_routes -->|"registers routes"| node_staff
node_routes -->|"registers routes"| node_amenities
node_complaints -->|"stores attachments"| node_storage
node_documents -->|"stores files"| node_storage
node_billing -.->|"posts entries"| node_ledger

click node_server "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/server.js"
click node_app "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/app.js"
click node_routes "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/routes/v1/index.js"
click node_authroutes "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/auth/auth.routes.js"
click node_auth "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/auth/auth.service.js"
click node_permissions "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/common/permissionResolver.js"
click node_masterdb "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/config/masterDb.js"
click node_operationsdb "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/config/operationsDb.js"
click node_society "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/society"
click node_residents "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/resident"
click node_visitors "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/visitor"
click node_amenities "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/amenity"
click node_complaints "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/complaint"
click node_staff "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/staff"
click node_billing "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/billing"
click node_ledger "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/ledger"
click node_reports "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/report"
click node_dashboard "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/dashboard"
click node_ai "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/aiAssistant"
click node_documents "https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/document"
click node_storage "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/services/storage.service.js"
click node_email "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/services/email.service.js"
click node_otp "https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/otp/otp.service.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_server,node_app,node_routes,node_operationsdb,node_client toneBlue
class node_authroutes,node_auth,node_permissions,node_masterdb,node_otp toneAmber
class node_society,node_residents,node_visitors,node_amenities,node_complaints,node_staff toneMint
class node_billing,node_ledger,node_reports toneRose
class node_dashboard,node_ai,node_documents,node_storage,node_email toneIndigo
```

## Components

### API runtime

- [HTTP server](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/server.js): `src/server.js`
- [Express application](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/app.js): `src/app.js`
- [Versioned routes](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/routes/v1/index.js): `src/routes/v1/index.js`
- [Operations database](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/config/operationsDb.js): `src/config/operationsDb.js`

### Identity and access

- [Auth routes](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/auth/auth.routes.js): `src/modules/auth/auth.routes.js`
- [Authentication](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/auth/auth.service.js): `src/modules/auth/auth.service.js`
- [Permission resolution](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/common/permissionResolver.js): `src/common/permissionResolver.js`
- [Master database](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/config/masterDb.js): `src/config/masterDb.js`
- [OTP delivery](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/modules/otp/otp.service.js): `src/modules/otp/otp.service.js`

### Society operations

- [Society administration](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/society): `src/modules/society`
- [Residents and homes](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/resident): `src/modules/resident`
- [Visitors and access](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/visitor): `src/modules/visitor`
- [Amenities and bookings](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/amenity): `src/modules/amenity`
- [Complaints and notices](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/complaint): `src/modules/complaint`
- [Staff operations](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/staff): `src/modules/staff`

### Finance and billing

- [Billing and payments](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/billing): `src/modules/billing`
- [Ledger and reconciliation](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/ledger): `src/modules/ledger`
- [Financial reports](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/report): `src/modules/report`

### Platform capabilities

- [Dashboard](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/dashboard): `src/modules/dashboard`
- [AI assistant](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/aiAssistant): `src/modules/aiAssistant`
- [Document management](https://github.com/omkarmadchetti5758/mysocietysuitebe/tree/main/src/modules/document): `src/modules/document`
- [Object storage](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/services/storage.service.js): `src/services/storage.service.js`
- [Email delivery](https://github.com/omkarmadchetti5758/mysocietysuitebe/blob/main/src/services/email.service.js): `src/services/email.service.js`

### Other components

- **API client**

## Connections

- API client → HTTP server: sends request (evidence: `src/server.js`)
- HTTP server → Express application: serves (evidence: `src/server.js`)
- Express application → Versioned routes: mounts routes (evidence: `src/app.js`)
- Versioned routes → Auth routes: registers (evidence: `src/routes/v1/index.js`)
- Auth routes → Authentication: dispatches
- Authentication → Permission resolution: resolves access (evidence: `src/modules/auth/auth.service.js`)
- Authentication → Master database: reads identity (evidence: `src/modules/auth/auth.service.js`)
- Authentication → Operations database: reads user (evidence: `src/modules/auth/auth.service.js`)
- HTTP server → Master database: connects (evidence: `src/server.js`)
- HTTP server → Operations database: connects (evidence: `src/server.js`)
- Authentication → Email delivery: sends invitations (evidence: `src/modules/auth/auth.service.js`)
- Authentication → OTP delivery: uses OTP (evidence: `src/modules/auth/auth.service.js`)
- Versioned routes → Society administration: registers routes (evidence: `src/routes/v1/index.js`)
- Versioned routes → Residents and homes: registers routes (evidence: `src/routes/v1/index.js`)
- Versioned routes → Staff operations: registers routes (evidence: `src/routes/v1/index.js`)
- Versioned routes → Amenities and bookings: registers routes (evidence: `src/routes/v1/index.js`)
- Complaints and notices → Object storage: stores attachments (evidence: `src/modules/complaint/complaint.controller.js`)
- Document management → Object storage: stores files (evidence: `src/modules/document/document.controller.js`)
- Billing and payments → Ledger and reconciliation: posts entries
