# abdulsami12166/cybersave architecture

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

- Interactive diagram: https://gitdiagram.com/abdulsami12166/cybersave
- Repository: https://github.com/abdulsami12166/cybersave

## Overview

CyberSave is a citizen-services platform backend: citizens authenticate, discover services, submit applications and documents, and can track payments and support; administrators manage verification, refunds, and communications. The tree also contains separately organized admin-backend code and service-app entry points. The sampled application controller and service show application routing and dependencies; other links rely on SOURCE INDEX references. Unsampled subsystems are included where the tree establishes their presence, but uncertain runtime relationships are omitted.

Main entry points: [`src/database/prisma.service.ts`](https://github.com/abdulsami12166/cybersave/blob/main/src/database/prisma.service.ts) (MongoDB access), [`src/applications/applications.service.ts`](https://github.com/abdulsami12166/cybersave/blob/main/src/applications/applications.service.ts) (Applications), [`src/admin/admin.gateway.ts`](https://github.com/abdulsami12166/cybersave/blob/main/src/admin/admin.gateway.ts) (Admin gateway), [`src/services/services.service.ts`](https://github.com/abdulsami12166/cybersave/blob/main/src/services/services.service.ts) (Services catalog)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_citizen["Citizen access"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_users["User accounts<br/>[users.service.ts]"]
  node_profile["Citizen profile<br/>[profile.service.ts]"]
  node_aadhaar["Aadhaar verification<br/>[aadhaar.service.ts]"]
end

subgraph group_services["Service workflows"]
  node_services_catalog["Services catalog"]
  node_applications["Applications"]
  node_documents["Documents"]
  node_payment["Payments<br/>[payment.service.ts]"]
  node_wallet["Wallet<br/>[wallet.service.ts]"]
  node_refunds["Refunds<br/>[refunds.service.ts]"]
  node_ai["AI assistance<br/>[ai.service.ts]"]
end

subgraph group_operations["Administration"]
  node_admin_api["Admin API"]
  node_admin_gateway["Admin gateway<br/>[admin.gateway.ts]"]
  node_admin_firebase["Admin notifications<br/>[firebase.ts]"]
  node_application_runtime["Application service runtime"]
  node_admin_runtime["Admin service runtime"]
end

subgraph group_platform["Platform infrastructure"]
  node_database[("MongoDB access<br/>[prisma.service.ts]")]
  node_sms["SMS delivery<br/>[twilio.service.ts]"]
end

subgraph group_admin_backend["Admin backend"]
  node_admin_console_service["Admin citizen service<br/>[citizenService.ts]"]
  node_admin_console_socket["Admin socket service<br/>[socket.ts]"]
  node_admin_console_entry["Admin backend entry<br/>[index.ts]"]
end

node_citizen_actor(("Citizen"))

node_citizen_actor -->|"authenticates"| node_auth
node_citizen_actor -->|"submits applications"| node_applications
node_citizen_actor -.->|"browses services"| node_services_catalog
node_citizen_actor -.->|"provides documents"| node_documents
node_citizen_actor -->|"requests assistance"| node_ai
node_citizen_actor -->|"manages profile"| node_profile
node_citizen_actor -->|"accesses account"| node_users
node_citizen_actor -->|"verifies identity"| node_aadhaar
node_citizen_actor -->|"pays fees"| node_payment
node_citizen_actor -->|"uses wallet"| node_wallet
node_applications -->|"reads and writes"| node_database
node_applications -->|"sends SMS"| node_sms
node_applications -->|"notifies admins"| node_admin_gateway
node_admin_api -->|"reads and writes"| node_database
node_admin_api -->|"broadcasts notifications"| node_admin_firebase
node_admin_gateway -->|"reads and writes"| node_database
node_admin_gateway -->|"broadcasts notifications"| node_admin_firebase
node_refunds -->|"reads and writes"| node_database
node_refunds -->|"notifies admins"| node_admin_gateway
node_services_catalog -->|"reads and writes"| node_database
node_services_catalog -->|"notifies admins"| node_admin_gateway
node_ai -->|"reads and writes"| node_database
node_application_runtime -->|"registers module"| node_applications
node_application_runtime -->|"registers module"| node_services_catalog
node_admin_runtime -.->|"registers module"| node_admin_api
node_admin_console_entry -->|"imports"| node_admin_console_socket
node_admin_console_entry -->|"imports"| node_admin_console_service

click node_auth "https://github.com/abdulsami12166/cybersave/blob/main/src/auth/auth.service.ts"
click node_users "https://github.com/abdulsami12166/cybersave/blob/main/src/users/users.service.ts"
click node_profile "https://github.com/abdulsami12166/cybersave/blob/main/src/profile/profile.service.ts"
click node_aadhaar "https://github.com/abdulsami12166/cybersave/blob/main/src/aadhaar/aadhaar.service.ts"
click node_services_catalog "https://github.com/abdulsami12166/cybersave/blob/main/src/services/services.service.ts"
click node_applications "https://github.com/abdulsami12166/cybersave/blob/main/src/applications/applications.service.ts"
click node_documents "https://github.com/abdulsami12166/cybersave/blob/main/src/documents/documents.service.ts"
click node_payment "https://github.com/abdulsami12166/cybersave/blob/main/src/payment/payment.service.ts"
click node_wallet "https://github.com/abdulsami12166/cybersave/blob/main/src/wallet/wallet.service.ts"
click node_refunds "https://github.com/abdulsami12166/cybersave/blob/main/src/refunds/refunds.service.ts"
click node_ai "https://github.com/abdulsami12166/cybersave/blob/main/src/ai/ai.service.ts"
click node_admin_api "https://github.com/abdulsami12166/cybersave/blob/main/src/admin/admin.controller.ts"
click node_admin_gateway "https://github.com/abdulsami12166/cybersave/blob/main/src/admin/admin.gateway.ts"
click node_admin_firebase "https://github.com/abdulsami12166/cybersave/blob/main/src/admin/firebase.ts"
click node_application_runtime "https://github.com/abdulsami12166/cybersave/blob/main/src/microservices/application/application.service.app.ts"
click node_admin_runtime "https://github.com/abdulsami12166/cybersave/blob/main/src/microservices/admin/admin.service.app.ts"
click node_admin_console_service "https://github.com/abdulsami12166/cybersave/blob/main/cybersave-admin-backend/src/citizenService.ts"
click node_admin_console_socket "https://github.com/abdulsami12166/cybersave/blob/main/cybersave-admin-backend/src/socket.ts"
click node_admin_console_entry "https://github.com/abdulsami12166/cybersave/blob/main/cybersave-admin-backend/src/index.ts"
click node_database "https://github.com/abdulsami12166/cybersave/blob/main/src/database/prisma.service.ts"
click node_sms "https://github.com/abdulsami12166/cybersave/blob/main/src/common/services/twilio.service.ts"

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_auth,node_users,node_profile,node_aadhaar toneBlue
class node_services_catalog,node_applications,node_documents,node_payment,node_wallet,node_refunds,node_ai toneAmber
class node_admin_api,node_admin_gateway,node_admin_firebase,node_application_runtime,node_admin_runtime toneMint
class node_database,node_sms toneRose
class node_admin_console_service,node_admin_console_socket,node_admin_console_entry,node_citizen_actor toneIndigo
```

## Components

### Citizen access

- [Authentication](https://github.com/abdulsami12166/cybersave/blob/main/src/auth/auth.service.ts): `src/auth/auth.service.ts`
- [User accounts](https://github.com/abdulsami12166/cybersave/blob/main/src/users/users.service.ts): `src/users/users.service.ts`
- [Citizen profile](https://github.com/abdulsami12166/cybersave/blob/main/src/profile/profile.service.ts): `src/profile/profile.service.ts`
- [Aadhaar verification](https://github.com/abdulsami12166/cybersave/blob/main/src/aadhaar/aadhaar.service.ts): `src/aadhaar/aadhaar.service.ts`

### Service workflows

- [Services catalog](https://github.com/abdulsami12166/cybersave/blob/main/src/services/services.service.ts): `src/services/services.service.ts`
- [Applications](https://github.com/abdulsami12166/cybersave/blob/main/src/applications/applications.service.ts): `src/applications/applications.service.ts`
- [Documents](https://github.com/abdulsami12166/cybersave/blob/main/src/documents/documents.service.ts): `src/documents/documents.service.ts`
- [Payments](https://github.com/abdulsami12166/cybersave/blob/main/src/payment/payment.service.ts): `src/payment/payment.service.ts`
- [Wallet](https://github.com/abdulsami12166/cybersave/blob/main/src/wallet/wallet.service.ts): `src/wallet/wallet.service.ts`
- [Refunds](https://github.com/abdulsami12166/cybersave/blob/main/src/refunds/refunds.service.ts): `src/refunds/refunds.service.ts`
- [AI assistance](https://github.com/abdulsami12166/cybersave/blob/main/src/ai/ai.service.ts): `src/ai/ai.service.ts`

### Administration

- [Admin API](https://github.com/abdulsami12166/cybersave/blob/main/src/admin/admin.controller.ts): `src/admin/admin.controller.ts`
- [Admin gateway](https://github.com/abdulsami12166/cybersave/blob/main/src/admin/admin.gateway.ts): `src/admin/admin.gateway.ts`
- [Admin notifications](https://github.com/abdulsami12166/cybersave/blob/main/src/admin/firebase.ts): `src/admin/firebase.ts`
- [Application service runtime](https://github.com/abdulsami12166/cybersave/blob/main/src/microservices/application/application.service.app.ts): `src/microservices/application/application.service.app.ts`
- [Admin service runtime](https://github.com/abdulsami12166/cybersave/blob/main/src/microservices/admin/admin.service.app.ts): `src/microservices/admin/admin.service.app.ts`

### Platform infrastructure

- [MongoDB access](https://github.com/abdulsami12166/cybersave/blob/main/src/database/prisma.service.ts): `src/database/prisma.service.ts`
- [SMS delivery](https://github.com/abdulsami12166/cybersave/blob/main/src/common/services/twilio.service.ts): `src/common/services/twilio.service.ts`

### Admin backend

- [Admin citizen service](https://github.com/abdulsami12166/cybersave/blob/main/cybersave-admin-backend/src/citizenService.ts): `cybersave-admin-backend/src/citizenService.ts`
- [Admin socket service](https://github.com/abdulsami12166/cybersave/blob/main/cybersave-admin-backend/src/socket.ts): `cybersave-admin-backend/src/socket.ts`
- [Admin backend entry](https://github.com/abdulsami12166/cybersave/blob/main/cybersave-admin-backend/src/index.ts): `cybersave-admin-backend/src/index.ts`

### Other components

- **Citizen**

## Connections

- Citizen → Authentication: authenticates
- Citizen → Applications: submits applications
- Citizen → Services catalog: browses services
- Citizen → Documents: provides documents
- Citizen → AI assistance: requests assistance
- Citizen → Citizen profile: manages profile
- Citizen → User accounts: accesses account
- Citizen → Aadhaar verification: verifies identity
- Citizen → Payments: pays fees
- Citizen → Wallet: uses wallet
- Applications → MongoDB access: reads and writes (evidence: `src/applications/applications.service.ts`)
- Applications → SMS delivery: sends SMS (evidence: `src/applications/applications.service.ts`)
- Applications → Admin gateway: notifies admins (evidence: `src/applications/applications.service.ts`)
- Admin API → MongoDB access: reads and writes (evidence: `src/admin/admin.controller.ts`)
- Admin API → Admin notifications: broadcasts notifications (evidence: `src/admin/admin.controller.ts`)
- Admin gateway → MongoDB access: reads and writes (evidence: `src/admin/admin.gateway.ts`)
- Admin gateway → Admin notifications: broadcasts notifications (evidence: `src/admin/admin.gateway.ts`)
- Refunds → MongoDB access: reads and writes (evidence: `src/refunds/refunds.service.ts`)
- Refunds → Admin gateway: notifies admins (evidence: `src/refunds/refunds.service.ts`)
- Services catalog → MongoDB access: reads and writes (evidence: `src/services/services.service.ts`)
- Services catalog → Admin gateway: notifies admins (evidence: `src/services/services.service.ts`)
- AI assistance → MongoDB access: reads and writes (evidence: `src/ai/ai.service.ts`)
- Application service runtime → Applications: registers module (evidence: `src/microservices/application/application.service.app.ts`)
- Application service runtime → Services catalog: registers module (evidence: `src/microservices/application/application.service.app.ts`)
- Admin service runtime → Admin API: registers module
- Admin backend entry → Admin socket service: imports (evidence: `cybersave-admin-backend/src/index.ts`)
- Admin backend entry → Admin citizen service: imports (evidence: `cybersave-admin-backend/src/index.ts`)
