# priyanathbhukta/aethra architecture

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

- Interactive diagram: https://gitdiagram.com/priyanathbhukta/aethra
- Repository: https://github.com/priyanathbhukta/aethra

## Overview

AETHRA is a multi-tenant renewable-energy SaaS platform for EPC, customer, and asset-operations workflows. Its documented user path runs through web or mobile clients, dedicated BFFs, and an API gateway into independently deployed domain services. The graph preserves the major business domains and the README’s offline-first technician capability. Sampled service entrypoints show handlers delegating to application services; other cross-service routes and event wiring are not established by the excerpts, so those links are omitted. Documented architecture links are cited to the README.

Main entry points: [`apps/api-gateway/src/main.ts`](https://github.com/priyanathbhukta/aethra/blob/main/apps/api-gateway/src/main.ts) (API Gateway), [`apps/mobile/src/index.ts`](https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile/src/index.ts) (Mobile App), [`apps/web/src/App.tsx`](https://github.com/priyanathbhukta/aethra/blob/main/apps/web/src/App.tsx) (Web Dashboard), [`apps/web-bff/src/main.ts`](https://github.com/priyanathbhukta/aethra/blob/main/apps/web-bff/src/main.ts) (Web BFF)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Client Experience"]
  node_web["Web Dashboard<br/>[App.tsx]"]
  node_mobile["Mobile App<br/>[index.ts]"]
  node_offline["Offline Sync Queue<br/>[syncQueue.ts]"]
end

subgraph group_platform["Ingress and Identity"]
  node_webbff["Web BFF<br/>[main.ts]"]
  node_mobilebff["Mobile BFF<br/>[main.ts]"]
  node_gateway["API Gateway<br/>[main.ts]"]
  node_identity["Identity and OIDC<br/>[main.ts]"]
end

subgraph group_tenancy["Tenant Foundation"]
  node_org["Organisation Tenancy"]
  node_access["Access Control"]
  node_subscription["Plans and Entitlements"]
  node_customer["Customer Accounts"]
  node_relationships["Vendor-Customer Consent"]
end

subgraph group_commercial["Sales and Design"]
  node_crm["CRM Leads<br/>[crm.service.ts]"]
  node_catalogue["Product Catalogue"]
  node_quotation["Quotations"]
  node_engineering["Solar Engineering"]
end

subgraph group_delivery["Operations and Insights"]
  node_inventory["Inventory"]
  node_procurement["Procurement"]
  node_project["EPC Projects<br/>[project.service.ts]"]
  node_service_mgmt["Service and AMC"]
  node_documents["Documents"]
  node_notifications["Notifications"]
  node_reporting["Reporting"]
  node_integration["External Integrations"]
  node_audit["Audit<br/>[audit.service.ts]"]
  node_ai["AI Capabilities<br/>[ai.service.ts]"]
end

node_users(("Vendor, Customer, Technician"))

node_users -->|"use dashboard"| node_web
node_users -->|"use mobile app"| node_mobile
node_web -->|"send requests"| node_webbff
node_mobile -->|"send requests"| node_mobilebff
node_mobile -->|"queue offline work"| node_offline
node_webbff -->|"route ingress"| node_gateway
node_mobilebff -->|"route ingress"| node_gateway
node_gateway -.->|"authenticate"| node_identity
node_gateway -.->|"dispatch requests"| node_org
node_gateway -.->|"dispatch requests"| node_access
node_gateway -.->|"dispatch requests"| node_subscription
node_gateway -.->|"dispatch requests"| node_customer
node_gateway -.->|"dispatch requests"| node_relationships
node_gateway -.->|"dispatch requests"| node_crm
node_gateway -.->|"dispatch requests"| node_catalogue
node_gateway -.->|"dispatch requests"| node_quotation
node_gateway -.->|"dispatch requests"| node_engineering
node_gateway -.->|"dispatch requests"| node_inventory
node_gateway -.->|"dispatch requests"| node_procurement
node_gateway -.->|"dispatch requests"| node_project
node_gateway -.->|"dispatch requests"| node_service_mgmt
node_gateway -.->|"dispatch requests"| node_documents
node_gateway -.->|"dispatch requests"| node_notifications
node_gateway -.->|"dispatch requests"| node_reporting
node_gateway -.->|"dispatch requests"| node_integration
node_gateway -.->|"dispatch requests"| node_audit
node_gateway -.->|"dispatch requests"| node_ai

click node_web "https://github.com/priyanathbhukta/aethra/blob/main/apps/web/src/App.tsx"
click node_mobile "https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile/src/index.ts"
click node_offline "https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile/src/offline/syncQueue.ts"
click node_webbff "https://github.com/priyanathbhukta/aethra/blob/main/apps/web-bff/src/main.ts"
click node_mobilebff "https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile-bff/src/main.ts"
click node_gateway "https://github.com/priyanathbhukta/aethra/blob/main/apps/api-gateway/src/main.ts"
click node_identity "https://github.com/priyanathbhukta/aethra/blob/main/services/identity-service/src/main.ts"
click node_org "https://github.com/priyanathbhukta/aethra/blob/main/services/organisation-service/src/application/organisation.service.ts"
click node_access "https://github.com/priyanathbhukta/aethra/blob/main/services/access-control-service/src/application/access-control.service.ts"
click node_subscription "https://github.com/priyanathbhukta/aethra/blob/main/services/subscription-service/src/application/subscription.service.ts"
click node_customer "https://github.com/priyanathbhukta/aethra/blob/main/services/customer-service/src/application/customer.service.ts"
click node_relationships "https://github.com/priyanathbhukta/aethra/blob/main/services/vendor-relationship-service/src/application/vendor-relationship.service.ts"
click node_crm "https://github.com/priyanathbhukta/aethra/blob/main/services/crm-service/src/application/crm.service.ts"
click node_catalogue "https://github.com/priyanathbhukta/aethra/blob/main/services/catalogue-service/src/application/catalogue.service.ts"
click node_quotation "https://github.com/priyanathbhukta/aethra/blob/main/services/quotation-service/src/application/quotation.service.ts"
click node_engineering "https://github.com/priyanathbhukta/aethra/blob/main/services/engineering-service/src/application/engineering.service.ts"
click node_inventory "https://github.com/priyanathbhukta/aethra/blob/main/services/inventory-service/src/application/inventory.service.ts"
click node_procurement "https://github.com/priyanathbhukta/aethra/blob/main/services/procurement-service/src/application/procurement.service.ts"
click node_project "https://github.com/priyanathbhukta/aethra/blob/main/services/project-service/src/application/project.service.ts"
click node_service_mgmt "https://github.com/priyanathbhukta/aethra/blob/main/services/service-management-service/src/application/service-management.service.ts"
click node_documents "https://github.com/priyanathbhukta/aethra/blob/main/services/document-service/src/application/document.service.ts"
click node_notifications "https://github.com/priyanathbhukta/aethra/blob/main/services/notification-service/src/application/notification.service.ts"
click node_reporting "https://github.com/priyanathbhukta/aethra/blob/main/services/reporting-service/src/application/reporting.service.ts"
click node_integration "https://github.com/priyanathbhukta/aethra/blob/main/services/integration-service/src/application/integration.service.ts"
click node_audit "https://github.com/priyanathbhukta/aethra/blob/main/services/audit-service/src/application/audit.service.ts"
click node_ai "https://github.com/priyanathbhukta/aethra/blob/main/services/ai-service/src/application/ai.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_web,node_mobile,node_offline toneBlue
class node_webbff,node_mobilebff,node_gateway,node_identity toneAmber
class node_org,node_access,node_subscription,node_customer,node_relationships toneMint
class node_crm,node_catalogue,node_quotation,node_engineering toneRose
class node_inventory,node_procurement,node_project,node_service_mgmt,node_documents,node_notifications,node_reporting,node_integration,node_audit,node_ai,node_users toneIndigo
```

## Components

### Client Experience

- [Web Dashboard](https://github.com/priyanathbhukta/aethra/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Mobile App](https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile/src/index.ts): `apps/mobile/src/index.ts`
- [Offline Sync Queue](https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile/src/offline/syncQueue.ts): `apps/mobile/src/offline/syncQueue.ts`

### Ingress and Identity

- [Web BFF](https://github.com/priyanathbhukta/aethra/blob/main/apps/web-bff/src/main.ts): `apps/web-bff/src/main.ts`
- [Mobile BFF](https://github.com/priyanathbhukta/aethra/blob/main/apps/mobile-bff/src/main.ts): `apps/mobile-bff/src/main.ts`
- [API Gateway](https://github.com/priyanathbhukta/aethra/blob/main/apps/api-gateway/src/main.ts): `apps/api-gateway/src/main.ts`
- [Identity and OIDC](https://github.com/priyanathbhukta/aethra/blob/main/services/identity-service/src/main.ts): `services/identity-service/src/main.ts`

### Tenant Foundation

- [Organisation Tenancy](https://github.com/priyanathbhukta/aethra/blob/main/services/organisation-service/src/application/organisation.service.ts): `services/organisation-service/src/application/organisation.service.ts`
- [Access Control](https://github.com/priyanathbhukta/aethra/blob/main/services/access-control-service/src/application/access-control.service.ts): `services/access-control-service/src/application/access-control.service.ts`
- [Plans and Entitlements](https://github.com/priyanathbhukta/aethra/blob/main/services/subscription-service/src/application/subscription.service.ts): `services/subscription-service/src/application/subscription.service.ts`
- [Customer Accounts](https://github.com/priyanathbhukta/aethra/blob/main/services/customer-service/src/application/customer.service.ts): `services/customer-service/src/application/customer.service.ts`
- [Vendor-Customer Consent](https://github.com/priyanathbhukta/aethra/blob/main/services/vendor-relationship-service/src/application/vendor-relationship.service.ts): `services/vendor-relationship-service/src/application/vendor-relationship.service.ts`

### Sales and Design

- [CRM Leads](https://github.com/priyanathbhukta/aethra/blob/main/services/crm-service/src/application/crm.service.ts): `services/crm-service/src/application/crm.service.ts`
- [Product Catalogue](https://github.com/priyanathbhukta/aethra/blob/main/services/catalogue-service/src/application/catalogue.service.ts): `services/catalogue-service/src/application/catalogue.service.ts`
- [Quotations](https://github.com/priyanathbhukta/aethra/blob/main/services/quotation-service/src/application/quotation.service.ts): `services/quotation-service/src/application/quotation.service.ts`
- [Solar Engineering](https://github.com/priyanathbhukta/aethra/blob/main/services/engineering-service/src/application/engineering.service.ts): `services/engineering-service/src/application/engineering.service.ts`

### Operations and Insights

- [Inventory](https://github.com/priyanathbhukta/aethra/blob/main/services/inventory-service/src/application/inventory.service.ts): `services/inventory-service/src/application/inventory.service.ts`
- [Procurement](https://github.com/priyanathbhukta/aethra/blob/main/services/procurement-service/src/application/procurement.service.ts): `services/procurement-service/src/application/procurement.service.ts`
- [EPC Projects](https://github.com/priyanathbhukta/aethra/blob/main/services/project-service/src/application/project.service.ts): `services/project-service/src/application/project.service.ts`
- [Service and AMC](https://github.com/priyanathbhukta/aethra/blob/main/services/service-management-service/src/application/service-management.service.ts): `services/service-management-service/src/application/service-management.service.ts`
- [Documents](https://github.com/priyanathbhukta/aethra/blob/main/services/document-service/src/application/document.service.ts): `services/document-service/src/application/document.service.ts`
- [Notifications](https://github.com/priyanathbhukta/aethra/blob/main/services/notification-service/src/application/notification.service.ts): `services/notification-service/src/application/notification.service.ts`
- [Reporting](https://github.com/priyanathbhukta/aethra/blob/main/services/reporting-service/src/application/reporting.service.ts): `services/reporting-service/src/application/reporting.service.ts`
- [External Integrations](https://github.com/priyanathbhukta/aethra/blob/main/services/integration-service/src/application/integration.service.ts): `services/integration-service/src/application/integration.service.ts`
- [Audit](https://github.com/priyanathbhukta/aethra/blob/main/services/audit-service/src/application/audit.service.ts): `services/audit-service/src/application/audit.service.ts`
- [AI Capabilities](https://github.com/priyanathbhukta/aethra/blob/main/services/ai-service/src/application/ai.service.ts): `services/ai-service/src/application/ai.service.ts`

### Other components

- **Vendor, Customer, Technician**

## Connections

- Vendor, Customer, Technician → Web Dashboard: use dashboard (evidence: `README.md`)
- Vendor, Customer, Technician → Mobile App: use mobile app (evidence: `README.md`)
- Web Dashboard → Web BFF: send requests (evidence: `README.md`)
- Mobile App → Mobile BFF: send requests (evidence: `README.md`)
- Mobile App → Offline Sync Queue: queue offline work (evidence: `README.md`)
- Web BFF → API Gateway: route ingress (evidence: `README.md`)
- Mobile BFF → API Gateway: route ingress (evidence: `README.md`)
- API Gateway → Identity and OIDC: authenticate
- API Gateway → Organisation Tenancy: dispatch requests
- API Gateway → Access Control: dispatch requests
- API Gateway → Plans and Entitlements: dispatch requests
- API Gateway → Customer Accounts: dispatch requests
- API Gateway → Vendor-Customer Consent: dispatch requests
- API Gateway → CRM Leads: dispatch requests
- API Gateway → Product Catalogue: dispatch requests
- API Gateway → Quotations: dispatch requests
- API Gateway → Solar Engineering: dispatch requests
- API Gateway → Inventory: dispatch requests
- API Gateway → Procurement: dispatch requests
- API Gateway → EPC Projects: dispatch requests
- API Gateway → Service and AMC: dispatch requests
- API Gateway → Documents: dispatch requests
- API Gateway → Notifications: dispatch requests
- API Gateway → Reporting: dispatch requests
- API Gateway → External Integrations: dispatch requests
- API Gateway → Audit: dispatch requests
- API Gateway → AI Capabilities: dispatch requests
