# rudy-123/heizen_engg_round architecture

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

- Interactive diagram: https://gitdiagram.com/rudy-123/heizen_engg_round
- Repository: https://github.com/rudy-123/heizen_engg_round

## Overview

Fernleaf Kitchen is an internal admin panel for operating corporate meal programmes; employees are stored as customers and do not sign in. Staff configure dishes, menus, companies and pricing, then create and validate orders, run kitchen preparation, dispatch and delivery, and invoice companies. The Next.js client calls the NestJS API, which owns business rules and persists operational data in PostgreSQL. The graph reflects documented capabilities and sampled controller-to-service calls; unsampled feature internals are represented by their existing module paths.

Main entry points: [`apps/web/src/lib/api.ts`](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/web/src/lib/api.ts) (API client), [`apps/api/src/prisma/prisma.service.ts`](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/prisma/prisma.service.ts) (Database access), [`apps/api/src/orders/orders.service.ts`](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/orders/orders.service.ts) (Order lifecycle), [`apps/web/src/app/(app)`](https://github.com/rudy-123/heizen_engg_round/tree/main/apps/web/src/app/(app)) (Admin screens)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Admin experience"]
  node_webapp["Admin screens"]
  node_api_client["API client<br/>[api.ts]"]
  node_auth_ui["Sign-in UI<br/>[login-form.tsx]"]
end

subgraph group_setup["Programme setup"]
  node_catalogue["Dish catalogue<br/>[dishes.service.ts]"]
  node_menu["Menus<br/>[menu.service.ts]"]
  node_companies["Companies and employees"]
  node_pricing["Price tiers<br/>[pricing.service.ts]"]
  node_settings["Programme settings"]
end

subgraph group_fulfillment["Order fulfillment"]
  node_orders["Order lifecycle<br/>[orders.service.ts]"]
  node_menu_resolver["Menu resolver<br/>[menu.ts]"]
  node_cutoffs["Cut-off scheduling<br/>[cutoff.service.ts]"]
  node_kitchen["Kitchen operations<br/>[kitchen.service.ts]"]
  node_dispatch["Dispatch and delivery"]
  node_billing["Billing<br/>[billing.service.ts]"]
  node_dashboard["Operations dashboards"]
end

subgraph group_platform["API and data"]
  node_auth["Authentication and access<br/>[session.service.ts]"]
  node_shared["Shared schemas and DTOs<br/>[orders.ts]"]
  node_clock["Kitchen clock<br/>[clock.service.ts]"]
  node_prisma["Database access<br/>[prisma.service.ts]"]
end

node_staff(("Kitchen staff"))
node_postgres[("PostgreSQL")]

node_staff -->|"uses"| node_webapp
node_webapp -->|"requests data"| node_api_client
node_api_client -->|"signs in"| node_auth
node_api_client -->|"manages dishes"| node_catalogue
node_api_client -->|"manages menus"| node_menu
node_api_client -->|"manages customers"| node_companies
node_api_client -->|"manages tiers"| node_pricing
node_api_client -->|"configures programme"| node_settings
node_api_client -->|"creates orders"| node_orders
node_orders -->|"resolves ordering menu"| node_menu_resolver
node_api_client -->|"manages cut-offs"| node_cutoffs
node_api_client -->|"runs kitchen board"| node_kitchen
node_api_client -->|"dispatches drops"| node_dispatch
node_api_client -->|"invoices companies"| node_billing
node_api_client -->|"views operations"| node_dashboard
node_auth_ui -->|"submits credentials"| node_api_client
node_api_client -->|"uses contracts"| node_shared
node_orders -->|"persists orders"| node_prisma
node_catalogue -->|"reads and writes"| node_prisma
node_companies -->|"reads and writes"| node_prisma
node_billing -->|"reads and writes"| node_prisma
node_kitchen -->|"reads and writes"| node_prisma
node_dispatch -->|"reads and writes"| node_prisma
node_auth -->|"reloads user access"| node_prisma
node_prisma -->|"queries"| node_postgres
node_orders -.->|"checks kitchen time"| node_clock
node_cutoffs -.->|"uses kitchen time"| node_clock

click node_webapp "https://github.com/rudy-123/heizen_engg_round/tree/main/apps/web/src/app/(app)"
click node_api_client "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/web/src/lib/api.ts"
click node_auth_ui "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/web/src/app/login/login-form.tsx"
click node_catalogue "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/catalogue/dishes.service.ts"
click node_menu "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/menu/menu.service.ts"
click node_companies "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/companies/companies.service.ts"
click node_pricing "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/pricing/pricing.service.ts"
click node_settings "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/settings/settings.service.ts"
click node_orders "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/orders/orders.service.ts"
click node_menu_resolver "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/domain/menu.ts"
click node_cutoffs "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/orders/cutoff.service.ts"
click node_kitchen "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/kitchen/kitchen.service.ts"
click node_dispatch "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/dispatch/dispatch.service.ts"
click node_billing "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/billing/billing.service.ts"
click node_dashboard "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/dashboard/dashboard.service.ts"
click node_auth "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/auth/session.service.ts"
click node_shared "https://github.com/rudy-123/heizen_engg_round/blob/main/packages/shared/src/orders.ts"
click node_clock "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/common/clock/clock.service.ts"
click node_prisma "https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/prisma/prisma.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_webapp,node_api_client,node_auth_ui toneBlue
class node_catalogue,node_menu,node_companies,node_pricing,node_settings,node_postgres toneAmber
class node_orders,node_menu_resolver,node_cutoffs,node_kitchen,node_dispatch,node_billing,node_dashboard toneMint
class node_auth,node_shared,node_clock,node_prisma toneRose
class node_staff toneIndigo
```

## Components

### Admin experience

- [Admin screens](https://github.com/rudy-123/heizen_engg_round/tree/main/apps/web/src/app/(app)): `apps/web/src/app/(app)`
- [API client](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/web/src/lib/api.ts): `apps/web/src/lib/api.ts`
- [Sign-in UI](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/web/src/app/login/login-form.tsx): `apps/web/src/app/login/login-form.tsx`

### Programme setup

- [Dish catalogue](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/catalogue/dishes.service.ts): `apps/api/src/catalogue/dishes.service.ts`
- [Menus](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/menu/menu.service.ts): `apps/api/src/menu/menu.service.ts`
- [Companies and employees](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/companies/companies.service.ts): `apps/api/src/companies/companies.service.ts`
- [Price tiers](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/pricing/pricing.service.ts): `apps/api/src/pricing/pricing.service.ts`
- [Programme settings](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/settings/settings.service.ts): `apps/api/src/settings/settings.service.ts`

### Order fulfillment

- [Order lifecycle](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/orders/orders.service.ts): `apps/api/src/orders/orders.service.ts`
- [Menu resolver](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/domain/menu.ts): `apps/api/src/domain/menu.ts`
- [Cut-off scheduling](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/orders/cutoff.service.ts): `apps/api/src/orders/cutoff.service.ts`
- [Kitchen operations](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/kitchen/kitchen.service.ts): `apps/api/src/kitchen/kitchen.service.ts`
- [Dispatch and delivery](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/dispatch/dispatch.service.ts): `apps/api/src/dispatch/dispatch.service.ts`
- [Billing](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/billing/billing.service.ts): `apps/api/src/billing/billing.service.ts`
- [Operations dashboards](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/dashboard/dashboard.service.ts): `apps/api/src/dashboard/dashboard.service.ts`

### API and data

- [Authentication and access](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/auth/session.service.ts): `apps/api/src/auth/session.service.ts`
- [Shared schemas and DTOs](https://github.com/rudy-123/heizen_engg_round/blob/main/packages/shared/src/orders.ts): `packages/shared/src/orders.ts`
- [Kitchen clock](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/common/clock/clock.service.ts): `apps/api/src/common/clock/clock.service.ts`
- [Database access](https://github.com/rudy-123/heizen_engg_round/blob/main/apps/api/src/prisma/prisma.service.ts): `apps/api/src/prisma/prisma.service.ts`

### Other components

- **Kitchen staff**
- **PostgreSQL**

## Connections

- Kitchen staff → Admin screens: uses (evidence: `README.md`)
- Admin screens → API client: requests data (evidence: `README.md`)
- API client → Authentication and access: signs in (evidence: `README.md`)
- API client → Dish catalogue: manages dishes (evidence: `README.md`)
- API client → Menus: manages menus (evidence: `README.md`)
- API client → Companies and employees: manages customers (evidence: `README.md`)
- API client → Price tiers: manages tiers (evidence: `README.md`)
- API client → Programme settings: configures programme (evidence: `README.md`)
- API client → Order lifecycle: creates orders
- Order lifecycle → Menu resolver: resolves ordering menu (evidence: `README.md`)
- API client → Cut-off scheduling: manages cut-offs (evidence: `README.md`)
- API client → Kitchen operations: runs kitchen board
- API client → Dispatch and delivery: dispatches drops
- API client → Billing: invoices companies
- API client → Operations dashboards: views operations (evidence: `README.md`)
- Sign-in UI → API client: submits credentials (evidence: `README.md`)
- API client → Shared schemas and DTOs: uses contracts
- Order lifecycle → Database access: persists orders (evidence: `README.md`)
- Dish catalogue → Database access: reads and writes (evidence: `apps/api/src/catalogue/dishes.service.ts`)
- Companies and employees → Database access: reads and writes
- Billing → Database access: reads and writes (evidence: `apps/api/src/billing/billing.service.ts`)
- Kitchen operations → Database access: reads and writes (evidence: `README.md`)
- Dispatch and delivery → Database access: reads and writes (evidence: `README.md`)
- Authentication and access → Database access: reloads user access (evidence: `apps/api/src/auth/session.service.ts`)
- Database access → PostgreSQL: queries (evidence: `README.md`)
- Order lifecycle → Kitchen clock: checks kitchen time
- Cut-off scheduling → Kitchen clock: uses kitchen time
