# jusish/receivables architecture

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

- Interactive diagram: https://gitdiagram.com/jusish/receivables
- Repository: https://github.com/jusish/receivables

## Overview

Receivables is a multi-tenant accounts-receivable and collections platform. Business users enter through the web app to manage customers, receivables, payments, collection follow-ups, reports, and settings; administrators have a separate portal for business, request, and health views. The API bootstrap wires shared infrastructure and a health module. The README describes financial and tenant-integrity capabilities, but the supplied tree exposes no domain API implementation, so those backend connections are not inferred. Page-to-API calls cannot be confirmed from the sampled source.

Main entry points: [`apps/web/src/App.tsx`](https://github.com/jusish/receivables/blob/main/apps/web/src/App.tsx) (Web routes), [`apps/admin/src/App.tsx`](https://github.com/jusish/receivables/blob/main/apps/admin/src/App.tsx) (Admin routes), [`apps/api/src/app.module.ts`](https://github.com/jusish/receivables/blob/main/apps/api/src/app.module.ts) (Application module), [`apps/web/src/main.tsx`](https://github.com/jusish/receivables/blob/main/apps/web/src/main.tsx) (Web entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_business["Business portal"]
  node_web_entry["Web entry<br/>[main.tsx]"]
  node_web_routes["Web routes<br/>[App.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_customers["Customers<br/>[CustomersPage.tsx]"]
  node_receivables["Receivables"]
  node_payments["Payments<br/>[PaymentsPage.tsx]"]
  node_collections["Collections"]
  node_reports["Reports<br/>[ReportsPage.tsx]"]
  node_settings["Settings<br/>[SettingsPage.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
end

subgraph group_admin["Admin portal"]
  node_admin_entry["Admin entry<br/>[main.tsx]"]
  node_admin_routes["Admin routes<br/>[App.tsx]"]
  node_admin_dashboard["Admin dashboard"]
  node_business_admin["Business administration"]
  node_requests_admin["Request administration"]
  node_health_admin["Health view"]
end

subgraph group_api["API service"]
  node_api_client["API service<br/>[main.ts]"]
  node_app_module["Application module<br/>[app.module.ts]"]
  node_health_module["Health module<br/>[health.module.ts]"]
  node_database_module["Database module<br/>[database.module.ts]"]
  node_prisma["Prisma service<br/>[prisma.service.ts]"]
  node_redis_module["Redis module<br/>[redis.module.ts]"]
  node_redis_service["Redis service<br/>[redis.service.ts]"]
end

subgraph group_shared["Shared domain"]
  node_domain_types["Domain contracts<br/>[index.ts]"]
  node_financial_utils["Financial utilities<br/>[index.ts]"]
end

node_business_user(("Business user"))
node_admin_user(("Administrator"))
node_postgres[("PostgreSQL")]
node_redis_store[("Redis")]

node_business_user -->|"opens"| node_web_entry
node_web_entry -->|"renders"| node_web_routes
node_web_routes -->|"routes"| node_login
node_web_routes -->|"routes"| node_dashboard
node_web_routes -->|"routes"| node_customers
node_web_routes -->|"routes"| node_receivables
node_web_routes -->|"routes"| node_payments
node_web_routes -->|"routes"| node_collections
node_web_routes -->|"routes"| node_reports
node_web_routes -->|"routes"| node_settings
node_admin_user -->|"opens"| node_admin_entry
node_admin_entry -->|"renders"| node_admin_routes
node_admin_routes -->|"routes"| node_admin_dashboard
node_admin_routes -->|"routes"| node_business_admin
node_admin_routes -->|"routes"| node_requests_admin
node_admin_routes -->|"routes"| node_health_admin
node_api_client -->|"loads"| node_app_module
node_app_module -->|"imports"| node_health_module
node_app_module -->|"imports"| node_database_module
node_app_module -->|"imports"| node_redis_module
node_database_module -->|"provides"| node_prisma
node_prisma -->|"connects"| node_postgres
node_redis_module -->|"provides"| node_redis_service
node_redis_service -.->|"connects"| node_redis_store

click node_web_entry "https://github.com/jusish/receivables/blob/main/apps/web/src/main.tsx"
click node_web_routes "https://github.com/jusish/receivables/blob/main/apps/web/src/App.tsx"
click node_dashboard "https://github.com/jusish/receivables/blob/main/apps/web/src/features/dashboard/DashboardPage.tsx"
click node_customers "https://github.com/jusish/receivables/blob/main/apps/web/src/features/customers/CustomersPage.tsx"
click node_receivables "https://github.com/jusish/receivables/blob/main/apps/web/src/features/receivables/ReceivablesPage.tsx"
click node_payments "https://github.com/jusish/receivables/blob/main/apps/web/src/features/payments/PaymentsPage.tsx"
click node_collections "https://github.com/jusish/receivables/blob/main/apps/web/src/features/collections/CollectionsPage.tsx"
click node_reports "https://github.com/jusish/receivables/blob/main/apps/web/src/features/reports/ReportsPage.tsx"
click node_settings "https://github.com/jusish/receivables/blob/main/apps/web/src/features/settings/SettingsPage.tsx"
click node_login "https://github.com/jusish/receivables/blob/main/apps/web/src/features/auth/LoginPage.tsx"
click node_admin_entry "https://github.com/jusish/receivables/blob/main/apps/admin/src/main.tsx"
click node_admin_routes "https://github.com/jusish/receivables/blob/main/apps/admin/src/App.tsx"
click node_admin_dashboard "https://github.com/jusish/receivables/blob/main/apps/admin/src/features/dashboard/AdminDashboardPage.tsx"
click node_business_admin "https://github.com/jusish/receivables/blob/main/apps/admin/src/features/businesses/AdminBusinessesPage.tsx"
click node_requests_admin "https://github.com/jusish/receivables/blob/main/apps/admin/src/features/requests/AdminRequestsPage.tsx"
click node_health_admin "https://github.com/jusish/receivables/blob/main/apps/admin/src/features/health/AdminHealthPage.tsx"
click node_api_client "https://github.com/jusish/receivables/blob/main/apps/api/src/main.ts"
click node_app_module "https://github.com/jusish/receivables/blob/main/apps/api/src/app.module.ts"
click node_health_module "https://github.com/jusish/receivables/blob/main/apps/api/src/modules/health/health.module.ts"
click node_database_module "https://github.com/jusish/receivables/blob/main/apps/api/src/common/database/database.module.ts"
click node_prisma "https://github.com/jusish/receivables/blob/main/apps/api/src/common/database/prisma.service.ts"
click node_redis_module "https://github.com/jusish/receivables/blob/main/apps/api/src/common/redis/redis.module.ts"
click node_redis_service "https://github.com/jusish/receivables/blob/main/apps/api/src/common/redis/redis.service.ts"
click node_domain_types "https://github.com/jusish/receivables/blob/main/packages/types/src/index.ts"
click node_financial_utils "https://github.com/jusish/receivables/blob/main/packages/shared/src/index.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_entry,node_web_routes,node_dashboard,node_customers,node_receivables,node_payments,node_collections,node_reports,node_settings,node_login,node_business_user toneBlue
class node_admin_entry,node_admin_routes,node_admin_dashboard,node_business_admin,node_requests_admin,node_health_admin,node_postgres,node_redis_store toneAmber
class node_api_client,node_app_module,node_health_module,node_database_module,node_prisma,node_redis_module,node_redis_service toneMint
class node_domain_types,node_financial_utils toneRose
class node_admin_user toneIndigo
```

## Components

### Business portal

- [Web entry](https://github.com/jusish/receivables/blob/main/apps/web/src/main.tsx): `apps/web/src/main.tsx`
- [Web routes](https://github.com/jusish/receivables/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Dashboard](https://github.com/jusish/receivables/blob/main/apps/web/src/features/dashboard/DashboardPage.tsx): `apps/web/src/features/dashboard/DashboardPage.tsx`
- [Customers](https://github.com/jusish/receivables/blob/main/apps/web/src/features/customers/CustomersPage.tsx): `apps/web/src/features/customers/CustomersPage.tsx`
- [Receivables](https://github.com/jusish/receivables/blob/main/apps/web/src/features/receivables/ReceivablesPage.tsx): `apps/web/src/features/receivables/ReceivablesPage.tsx`
- [Payments](https://github.com/jusish/receivables/blob/main/apps/web/src/features/payments/PaymentsPage.tsx): `apps/web/src/features/payments/PaymentsPage.tsx`
- [Collections](https://github.com/jusish/receivables/blob/main/apps/web/src/features/collections/CollectionsPage.tsx): `apps/web/src/features/collections/CollectionsPage.tsx`
- [Reports](https://github.com/jusish/receivables/blob/main/apps/web/src/features/reports/ReportsPage.tsx): `apps/web/src/features/reports/ReportsPage.tsx`
- [Settings](https://github.com/jusish/receivables/blob/main/apps/web/src/features/settings/SettingsPage.tsx): `apps/web/src/features/settings/SettingsPage.tsx`
- [Login](https://github.com/jusish/receivables/blob/main/apps/web/src/features/auth/LoginPage.tsx): `apps/web/src/features/auth/LoginPage.tsx`

### Admin portal

- [Admin entry](https://github.com/jusish/receivables/blob/main/apps/admin/src/main.tsx): `apps/admin/src/main.tsx`
- [Admin routes](https://github.com/jusish/receivables/blob/main/apps/admin/src/App.tsx): `apps/admin/src/App.tsx`
- [Admin dashboard](https://github.com/jusish/receivables/blob/main/apps/admin/src/features/dashboard/AdminDashboardPage.tsx): `apps/admin/src/features/dashboard/AdminDashboardPage.tsx`
- [Business administration](https://github.com/jusish/receivables/blob/main/apps/admin/src/features/businesses/AdminBusinessesPage.tsx): `apps/admin/src/features/businesses/AdminBusinessesPage.tsx`
- [Request administration](https://github.com/jusish/receivables/blob/main/apps/admin/src/features/requests/AdminRequestsPage.tsx): `apps/admin/src/features/requests/AdminRequestsPage.tsx`
- [Health view](https://github.com/jusish/receivables/blob/main/apps/admin/src/features/health/AdminHealthPage.tsx): `apps/admin/src/features/health/AdminHealthPage.tsx`

### API service

- [API service](https://github.com/jusish/receivables/blob/main/apps/api/src/main.ts): `apps/api/src/main.ts`
- [Application module](https://github.com/jusish/receivables/blob/main/apps/api/src/app.module.ts): `apps/api/src/app.module.ts`
- [Health module](https://github.com/jusish/receivables/blob/main/apps/api/src/modules/health/health.module.ts): `apps/api/src/modules/health/health.module.ts`
- [Database module](https://github.com/jusish/receivables/blob/main/apps/api/src/common/database/database.module.ts): `apps/api/src/common/database/database.module.ts`
- [Prisma service](https://github.com/jusish/receivables/blob/main/apps/api/src/common/database/prisma.service.ts): `apps/api/src/common/database/prisma.service.ts`
- [Redis module](https://github.com/jusish/receivables/blob/main/apps/api/src/common/redis/redis.module.ts): `apps/api/src/common/redis/redis.module.ts`
- [Redis service](https://github.com/jusish/receivables/blob/main/apps/api/src/common/redis/redis.service.ts): `apps/api/src/common/redis/redis.service.ts`

### Shared domain

- [Domain contracts](https://github.com/jusish/receivables/blob/main/packages/types/src/index.ts): `packages/types/src/index.ts`
- [Financial utilities](https://github.com/jusish/receivables/blob/main/packages/shared/src/index.ts): `packages/shared/src/index.ts`

### Other components

- **Business user**
- **Administrator**
- **PostgreSQL**
- **Redis**

## Connections

- Business user → Web entry: opens
- Web entry → Web routes: renders
- Web routes → Login: routes
- Web routes → Dashboard: routes
- Web routes → Customers: routes
- Web routes → Receivables: routes
- Web routes → Payments: routes
- Web routes → Collections: routes
- Web routes → Reports: routes
- Web routes → Settings: routes
- Administrator → Admin entry: opens
- Admin entry → Admin routes: renders
- Admin routes → Admin dashboard: routes
- Admin routes → Business administration: routes
- Admin routes → Request administration: routes
- Admin routes → Health view: routes
- API service → Application module: loads
- Application module → Health module: imports
- Application module → Database module: imports
- Application module → Redis module: imports
- Database module → Prisma service: provides
- Prisma service → PostgreSQL: connects
- Redis module → Redis service: provides
- Redis service → Redis: connects
