# sounken/goodfood-cesi architecture

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

- Interactive diagram: https://gitdiagram.com/sounken/goodfood-cesi
- Repository: https://github.com/sounken/goodfood-cesi

## Overview

GoodFood is a proof-of-concept microservices platform. The visible runtime centers on HTTP service scaffolds: clients reach catalog, order, or delivery APIs, which expose service routes plus health, error handling, and observability. The README describes a broader ordering platform and REST/RabbitMQ architecture, but this tree contains only three service implementations and does not show a complete order-to-delivery workflow. The graph therefore distinguishes documented architecture from evidenced in-process wiring; several domain capabilities remain templates or are unsampled.

Main entry points: [`apps/catalog-service/src/app.ts`](https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/app.ts) (Fastify application), [`apps/delivery-service/app/main.py`](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/main.py) (FastAPI application), [`apps/order-service/src/app.module.ts`](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/app.module.ts) (NestJS module), [`packages/common/src`](https://github.com/sounken/goodfood-cesi/tree/main/packages/common/src) (TypeScript utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalog service"]
  node_catalog_app["Fastify application<br/>[app.ts]"]
  node_catalog_routes["Restaurant routes<br/>[restaurants.ts]"]
  node_catalog_errors["Error handler<br/>[error-handler.ts]"]
  node_catalog_metrics["Metrics plugin<br/>[metrics.ts]"]
  node_catalog_config["Service config<br/>[config.ts]"]
end

subgraph group_order["Order service"]
  node_order_module["NestJS module<br/>[app.module.ts]"]
  node_order_setup["HTTP setup<br/>[app.setup.ts]"]
  node_order_config["Service config<br/>[config.ts]"]
  node_order_routes["Order controller"]
  node_order_metrics["Metrics endpoint<br/>[metrics.ts]"]
  node_order_errors["HTTP error filter"]
end

subgraph group_delivery["Delivery service"]
  node_delivery_app["FastAPI application<br/>[main.py]"]
  node_delivery_routes["Delivery routes<br/>[deliveries.py]"]
  node_delivery_health["Health routes<br/>[health.py]"]
  node_delivery_middleware["Correlation and metrics<br/>[middleware.py]"]
  node_delivery_errors["Error handlers<br/>[errors.py]"]
  node_delivery_config["Service config<br/>[config.py]"]
end

subgraph group_shared["Shared runtime"]
  node_common_ts["TypeScript utilities"]
  node_common_py["Python utilities"]
end

node_clients(("Web and mobile clients"))
node_platform_services["Other platform services"]
node_platform_infra[("PostgreSQL and RabbitMQ")]

node_clients -->|"HTTP requests"| node_catalog_app
node_clients -->|"HTTP requests"| node_order_module
node_clients -->|"HTTP requests"| node_delivery_app
node_catalog_app -->|"registers routes"| node_catalog_routes
node_catalog_app -->|"registers handler"| node_catalog_errors
node_catalog_app -->|"registers plugin"| node_catalog_metrics
node_catalog_app -->|"uses config"| node_catalog_config
node_catalog_app -->|"uses logging"| node_common_ts
node_catalog_errors -->|"formats errors"| node_common_ts
node_order_module -->|"registers controller"| node_order_routes
node_order_module -->|"uses metrics"| node_order_metrics
node_order_module -->|"loads config"| node_order_config
node_order_setup -->|"registers filter"| node_order_errors
node_order_setup -->|"uses config"| node_order_config
node_order_setup -->|"uses shared config"| node_common_ts
node_order_errors -->|"formats errors"| node_common_ts
node_delivery_app -->|"includes router"| node_delivery_routes
node_delivery_app -->|"includes router"| node_delivery_health
node_delivery_app -->|"adds middleware"| node_delivery_middleware
node_delivery_app -->|"registers handlers"| node_delivery_errors
node_delivery_app -->|"loads settings"| node_delivery_config
node_delivery_middleware -->|"uses correlation"| node_common_py
node_delivery_errors -->|"formats errors"| node_common_py
node_clients -.->|"uses platform APIs"| node_platform_services
node_platform_services -.->|"uses REST and events"| node_platform_infra

click node_catalog_app "https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/app.ts"
click node_catalog_routes "https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/routes/restaurants.ts"
click node_catalog_errors "https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/plugins/error-handler.ts"
click node_catalog_metrics "https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/plugins/metrics.ts"
click node_catalog_config "https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/config.ts"
click node_order_module "https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/app.module.ts"
click node_order_setup "https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/app.setup.ts"
click node_order_config "https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/infrastructure/config/config.ts"
click node_order_routes "https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/interface/controllers/orders.controller.ts"
click node_order_metrics "https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/interface/http/metrics.ts"
click node_order_errors "https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/interface/http/http-exception.filter.ts"
click node_delivery_app "https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/main.py"
click node_delivery_routes "https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/interface/deliveries.py"
click node_delivery_health "https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/interface/health.py"
click node_delivery_middleware "https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/core/middleware.py"
click node_delivery_errors "https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/core/errors.py"
click node_delivery_config "https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/core/config.py"
click node_common_ts "https://github.com/sounken/goodfood-cesi/tree/main/packages/common/src"
click node_common_py "https://github.com/sounken/goodfood-cesi/tree/main/packages/common-py/goodfood_common"

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_catalog_app,node_catalog_routes,node_catalog_errors,node_catalog_metrics,node_catalog_config,node_clients toneBlue
class node_order_module,node_order_setup,node_order_config,node_order_routes,node_order_metrics,node_order_errors,node_platform_infra toneAmber
class node_delivery_app,node_delivery_routes,node_delivery_health,node_delivery_middleware,node_delivery_errors,node_delivery_config toneMint
class node_common_ts,node_common_py toneRose
class node_platform_services toneIndigo
```

## Components

### Catalog service

- [Fastify application](https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/app.ts): `apps/catalog-service/src/app.ts`
- [Restaurant routes](https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/routes/restaurants.ts): `apps/catalog-service/src/routes/restaurants.ts`
- [Error handler](https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/plugins/error-handler.ts): `apps/catalog-service/src/plugins/error-handler.ts`
- [Metrics plugin](https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/plugins/metrics.ts): `apps/catalog-service/src/plugins/metrics.ts`
- [Service config](https://github.com/sounken/goodfood-cesi/blob/main/apps/catalog-service/src/config.ts): `apps/catalog-service/src/config.ts`

### Order service

- [NestJS module](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/app.module.ts): `apps/order-service/src/app.module.ts`
- [HTTP setup](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/app.setup.ts): `apps/order-service/src/app.setup.ts`
- [Service config](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/infrastructure/config/config.ts): `apps/order-service/src/infrastructure/config/config.ts`
- [Order controller](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/interface/controllers/orders.controller.ts): `apps/order-service/src/interface/controllers/orders.controller.ts`
- [Metrics endpoint](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/interface/http/metrics.ts): `apps/order-service/src/interface/http/metrics.ts`
- [HTTP error filter](https://github.com/sounken/goodfood-cesi/blob/main/apps/order-service/src/interface/http/http-exception.filter.ts): `apps/order-service/src/interface/http/http-exception.filter.ts`

### Delivery service

- [FastAPI application](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/main.py): `apps/delivery-service/app/main.py`
- [Delivery routes](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/interface/deliveries.py): `apps/delivery-service/app/interface/deliveries.py`
- [Health routes](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/interface/health.py): `apps/delivery-service/app/interface/health.py`
- [Correlation and metrics](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/core/middleware.py): `apps/delivery-service/app/core/middleware.py`
- [Error handlers](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/core/errors.py): `apps/delivery-service/app/core/errors.py`
- [Service config](https://github.com/sounken/goodfood-cesi/blob/main/apps/delivery-service/app/core/config.py): `apps/delivery-service/app/core/config.py`

### Shared runtime

- [TypeScript utilities](https://github.com/sounken/goodfood-cesi/tree/main/packages/common/src): `packages/common/src`
- [Python utilities](https://github.com/sounken/goodfood-cesi/tree/main/packages/common-py/goodfood_common): `packages/common-py/goodfood_common`

### Other components

- **Web and mobile clients**
- **Other platform services**
- **PostgreSQL and RabbitMQ**

## Connections

- Web and mobile clients → Fastify application: HTTP requests (evidence: `README.md`)
- Web and mobile clients → NestJS module: HTTP requests (evidence: `README.md`)
- Web and mobile clients → FastAPI application: HTTP requests (evidence: `README.md`)
- Fastify application → Restaurant routes: registers routes (evidence: `apps/catalog-service/src/app.ts`)
- Fastify application → Error handler: registers handler (evidence: `apps/catalog-service/src/app.ts`)
- Fastify application → Metrics plugin: registers plugin (evidence: `apps/catalog-service/src/app.ts`)
- Fastify application → Service config: uses config (evidence: `apps/catalog-service/src/app.ts`)
- Fastify application → TypeScript utilities: uses logging (evidence: `apps/catalog-service/src/app.ts`)
- Error handler → TypeScript utilities: formats errors (evidence: `apps/catalog-service/src/plugins/error-handler.ts`)
- NestJS module → Order controller: registers controller (evidence: `apps/order-service/src/app.module.ts`)
- NestJS module → Metrics endpoint: uses metrics (evidence: `apps/order-service/src/app.module.ts`)
- NestJS module → Service config: loads config (evidence: `apps/order-service/src/app.module.ts`)
- HTTP setup → HTTP error filter: registers filter (evidence: `apps/order-service/src/app.setup.ts`)
- HTTP setup → Service config: uses config (evidence: `apps/order-service/src/app.setup.ts`)
- HTTP setup → TypeScript utilities: uses shared config (evidence: `apps/order-service/src/app.setup.ts`)
- HTTP error filter → TypeScript utilities: formats errors (evidence: `apps/order-service/src/interface/http/http-exception.filter.ts`)
- FastAPI application → Delivery routes: includes router (evidence: `apps/delivery-service/app/main.py`)
- FastAPI application → Health routes: includes router (evidence: `apps/delivery-service/app/main.py`)
- FastAPI application → Correlation and metrics: adds middleware (evidence: `apps/delivery-service/app/main.py`)
- FastAPI application → Error handlers: registers handlers (evidence: `apps/delivery-service/app/main.py`)
- FastAPI application → Service config: loads settings (evidence: `apps/delivery-service/app/main.py`)
- Correlation and metrics → Python utilities: uses correlation (evidence: `apps/delivery-service/app/core/middleware.py`)
- Error handlers → Python utilities: formats errors (evidence: `apps/delivery-service/app/core/errors.py`)
- Web and mobile clients → Other platform services: uses platform APIs (evidence: `README.md`)
- Other platform services → PostgreSQL and RabbitMQ: uses REST and events (evidence: `README.md`)
