# parthasarathyhmh/loyalty-dash-api architecture

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

- Interactive diagram: https://gitdiagram.com/parthasarathyhmh/loyalty-dash-api
- Repository: https://github.com/parthasarathyhmh/loyalty-dash-api

## Overview

Loyalty Dashboard API is a NestJS service for administering loyalty programs and their customer-facing operations. The main workflow is an administrator or API client managing workspace/project configuration and rules, then operating customer eligibility, orders, wallets and rewards, with reports and dashboards exposing results. The tree and permission constants show broad feature areas; the README provides no further product workflow detail. Edges below are limited to controller/service references in the SOURCE INDEX and explicit excerpted calls; unsampled service internals are not inferred.

Main entry points: [`src/wallets/wallets.controller.ts`](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/wallets/wallets.controller.ts) (Wallets and points), [`src/common/pipe/filter.pipe.ts`](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/common/pipe/filter.pipe.ts) (Filtering and pagination), [`src/rules/rules.controller.ts`](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rules/rules.controller.ts) (Loyalty rules), [`src/customer/customer.controller.ts`](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/customer/customer.controller.ts) (Customer profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Program administration"]
  node_project["Projects and workspaces"]
  node_rules["Loyalty rules"]
  node_products["Products"]
  node_cms["CMS sections"]
end

subgraph group_loyalty["Loyalty operations"]
  node_customer["Customer profiles"]
  node_eligibility["Loyalty eligibility"]
  node_attributes["Customer attributes"]
  node_tiers["Customer tiers"]
  node_orders["Orders and items"]
  node_wallet["Wallets and points"]
  node_rewards["Reward catalog"]
  node_coupons["Coupons"]
  node_exchange["Point exchanges"]
end

subgraph group_insights["Reporting and insights"]
  node_dashboard["Dashboard summaries"]
  node_reports["Reports"]
end

subgraph group_platform["Shared platform"]
  node_access["Authentication and roles<br/>[auth.service.ts]"]
  node_audit["Audit trail"]
  node_shared["Filtering and pagination<br/>[filter.pipe.ts]"]
  node_database[("Relational database<br/>[data-source.ts]")]
end

node_client(("API client"))

node_client -->|"manages"| node_project
node_client -->|"authenticates"| node_access
node_client -->|"manages"| node_customer
node_client -->|"updates"| node_eligibility
node_client -->|"manages"| node_attributes
node_client -->|"configures"| node_rules
node_client -->|"manages"| node_tiers
node_client -.->|"submits"| node_orders
node_client -->|"manages"| node_products
node_client -->|"queries"| node_wallet
node_client -->|"manages"| node_rewards
node_client -->|"manages"| node_coupons
node_client -->|"manages"| node_exchange
node_client -->|"manages"| node_cms
node_client -.->|"views"| node_dashboard
node_client -->|"requests"| node_reports
node_client -->|"queries"| node_audit
node_customer -->|"validates queries"| node_shared
node_eligibility -->|"validates queries"| node_shared
node_rules -->|"checks profiles"| node_access
node_rules -->|"validates queries"| node_shared
node_wallet -->|"validates queries"| node_shared
node_reports -->|"uses statement data"| node_wallet
node_project -.->|"persists records"| node_database
node_customer -.->|"persists records"| node_database
node_wallet -.->|"persists transactions"| node_database

click node_project "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/project/project.controller.ts"
click node_access "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rbac/auth/auth.service.ts"
click node_customer "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/customer/customer.controller.ts"
click node_eligibility "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/customermeta/customermeta.controller.ts"
click node_attributes "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/attributes/attributes.controller.ts"
click node_rules "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rules/rules.controller.ts"
click node_tiers "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/tiers/tiers.controller.ts"
click node_orders "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/sales/order/orders.controller.ts"
click node_products "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/products/products.controller.ts"
click node_wallet "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/wallets/wallets.controller.ts"
click node_rewards "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rewards/controllers/catalog.controller.ts"
click node_coupons "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/coupons/coupons.controller.ts"
click node_exchange "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/exchanges/exchanges.controller.ts"
click node_cms "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/cms-sections/cms-sections.controller.ts"
click node_dashboard "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/dashboard/dashboard.service.ts"
click node_reports "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/reports/reports.controller.ts"
click node_audit "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/audittrail/audittrail.controller.ts"
click node_shared "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/common/pipe/filter.pipe.ts"
click node_database "https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/db/data-source.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_project,node_rules,node_products,node_cms,node_client toneBlue
class node_customer,node_eligibility,node_attributes,node_tiers,node_orders,node_wallet,node_rewards,node_coupons,node_exchange toneAmber
class node_dashboard,node_reports toneMint
class node_access,node_audit,node_shared,node_database toneRose
```

## Components

### Program administration

- [Projects and workspaces](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/project/project.controller.ts): `src/project/project.controller.ts`
- [Loyalty rules](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rules/rules.controller.ts): `src/rules/rules.controller.ts`
- [Products](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/products/products.controller.ts): `src/products/products.controller.ts`
- [CMS sections](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/cms-sections/cms-sections.controller.ts): `src/cms-sections/cms-sections.controller.ts`

### Loyalty operations

- [Customer profiles](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/customer/customer.controller.ts): `src/customer/customer.controller.ts`
- [Loyalty eligibility](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/customermeta/customermeta.controller.ts): `src/customermeta/customermeta.controller.ts`
- [Customer attributes](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/attributes/attributes.controller.ts): `src/attributes/attributes.controller.ts`
- [Customer tiers](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/tiers/tiers.controller.ts): `src/tiers/tiers.controller.ts`
- [Orders and items](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/sales/order/orders.controller.ts): `src/sales/order/orders.controller.ts`
- [Wallets and points](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/wallets/wallets.controller.ts): `src/wallets/wallets.controller.ts`
- [Reward catalog](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rewards/controllers/catalog.controller.ts): `src/rewards/controllers/catalog.controller.ts`
- [Coupons](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/coupons/coupons.controller.ts): `src/coupons/coupons.controller.ts`
- [Point exchanges](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/exchanges/exchanges.controller.ts): `src/exchanges/exchanges.controller.ts`

### Reporting and insights

- [Dashboard summaries](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/dashboard/dashboard.service.ts): `src/dashboard/dashboard.service.ts`
- [Reports](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/reports/reports.controller.ts): `src/reports/reports.controller.ts`

### Shared platform

- [Authentication and roles](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/rbac/auth/auth.service.ts): `src/rbac/auth/auth.service.ts`
- [Audit trail](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/audittrail/audittrail.controller.ts): `src/audittrail/audittrail.controller.ts`
- [Filtering and pagination](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/src/common/pipe/filter.pipe.ts): `src/common/pipe/filter.pipe.ts`
- [Relational database](https://github.com/parthasarathyhmh/loyalty-dash-api/blob/main/db/data-source.ts): `db/data-source.ts`

### Other components

- **API client**

## Connections

- API client → Projects and workspaces: manages (evidence: `src/project/project.controller.ts`)
- API client → Authentication and roles: authenticates (evidence: `src/rbac/auth/auth.service.ts`)
- API client → Customer profiles: manages (evidence: `src/customer/customer.controller.ts`)
- API client → Loyalty eligibility: updates (evidence: `src/customermeta/customermeta.controller.ts`)
- API client → Customer attributes: manages (evidence: `src/attributes/attributes.controller.ts`)
- API client → Loyalty rules: configures (evidence: `src/rules/rules.controller.ts`)
- API client → Customer tiers: manages (evidence: `src/tiers/tiers.controller.ts`)
- API client → Orders and items: submits
- API client → Products: manages (evidence: `src/products/products.controller.ts`)
- API client → Wallets and points: queries (evidence: `src/wallets/wallets.controller.ts`)
- API client → Reward catalog: manages (evidence: `src/rewards/controllers/catalog.controller.ts`)
- API client → Coupons: manages (evidence: `src/coupons/coupons.controller.ts`)
- API client → Point exchanges: manages (evidence: `src/exchanges/exchanges.controller.ts`)
- API client → CMS sections: manages (evidence: `src/cms-sections/cms-sections.controller.ts`)
- API client → Dashboard summaries: views
- API client → Reports: requests (evidence: `src/reports/reports.controller.ts`)
- API client → Audit trail: queries (evidence: `src/audittrail/audittrail.controller.ts`)
- Customer profiles → Filtering and pagination: validates queries (evidence: `src/customer/customer.controller.ts`)
- Loyalty eligibility → Filtering and pagination: validates queries (evidence: `src/customermeta/customermeta.controller.ts`)
- Loyalty rules → Authentication and roles: checks profiles (evidence: `src/rules/rules.controller.ts`)
- Loyalty rules → Filtering and pagination: validates queries (evidence: `src/rules/rules.controller.ts`)
- Wallets and points → Filtering and pagination: validates queries (evidence: `src/wallets/wallets.controller.ts`)
- Reports → Wallets and points: uses statement data (evidence: `src/reports/reports.controller.ts`)
- Projects and workspaces → Relational database: persists records
- Customer profiles → Relational database: persists records
- Wallets and points → Relational database: persists transactions
