# bahmn/rocket-factory architecture

> Architecture diagram of the GitHub repository bahmn/rocket-factory, 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/bahmn/rocket-factory
- Repository: https://github.com/bahmn/rocket-factory

## Overview

This repository is a Go microservices system for order fulfillment: users create and manage orders, with identity, inventory and payment services supporting the order service; Kafka consumers handle paid/assembled events, and notification and assembly services provide downstream work. The graph separates synchronous APIs, persistence/integrations, and event-driven services. Some service internals and DI wiring were not excerpted; uncertain runtime links are dashed rather than asserted as inspected calls.

Main entry points: [`order/internal/app/app.go`](https://github.com/bahmn/rocket-factory/blob/main/order/internal/app/app.go) (Order API runtime), [`order/internal/service/order`](https://github.com/bahmn/rocket-factory/tree/main/order/internal/service/order) (Order operations), [`assembly/internal/service/consumer/order_consumer`](https://github.com/bahmn/rocket-factory/tree/main/assembly/internal/service/consumer/order_consumer) (Paid-order consumer), [`notification/internal/service/consumer/order_paid_consumer`](https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/consumer/order_paid_consumer) (Paid-order handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orders["Orders"]
  node_order_app["Order API runtime<br/>[app.go]"]
  node_order_http["Order HTTP endpoints"]
  node_order_logic["Order operations"]
  node_order_db[("Order repository")]
  node_order_inventory["Inventory client"]
  node_order_payment["Payment client"]
  node_order_events["Order event producer"]
end

subgraph group_identity["Identity"]
  node_iam_api["Auth and user APIs"]
  node_iam_logic["Identity services"]
  node_iam_store[("Identity repositories")]
end

subgraph group_fulfillment["Fulfillment"]
  node_inventory_api["Inventory gRPC API"]
  node_inventory_logic["Inventory services"]
  node_inventory_store[("Inventory repository")]
  node_payment_api["Payment gRPC API"]
  node_payment_logic["Payment service"]
end

subgraph group_events["Event services"]
  node_assembly_consumer["Paid-order consumer"]
  node_assembly_producer["Assembly event producer"]
  node_notification_paid["Paid-order handler"]
  node_notification_assembled["Assembled handler"]
  node_telegram["Telegram delivery"]
end

subgraph group_foundation["Shared platform"]
  node_contracts["Shared API contracts"]
  node_kafka_runtime["Kafka runtime"]
end

node_shopper(("Order user"))
node_kafka["Kafka"]
node_telegram_service["Telegram API"]

node_shopper -->|"sends requests"| node_order_app
node_order_app -.->|"routes HTTP"| node_order_http
node_order_app -->|"starts consumer"| node_order_events
node_order_http -.->|"dispatches"| node_order_logic
node_order_logic -.->|"reads and writes"| node_order_db
node_order_logic -.->|"requests parts"| node_order_inventory
node_order_logic -.->|"requests payment"| node_order_payment
node_order_logic -.->|"publishes events"| node_order_events
node_order_app -->|"serves generated API"| node_contracts
node_iam_api -.->|"dispatches"| node_iam_logic
node_iam_logic -.->|"uses repositories"| node_iam_store
node_order_app -.->|"authenticates requests"| node_iam_api
node_order_inventory -.->|"calls gRPC"| node_inventory_api
node_inventory_api -.->|"dispatches"| node_inventory_logic
node_inventory_logic -.->|"reads parts"| node_inventory_store
node_order_payment -.->|"calls gRPC"| node_payment_api
node_payment_api -.->|"dispatches"| node_payment_logic
node_kafka -.->|"delivers paid events"| node_assembly_consumer
node_assembly_consumer -.->|"emits assembly events"| node_assembly_producer
node_assembly_producer -.->|"publishes"| node_kafka
node_kafka -.->|"delivers paid events"| node_notification_paid
node_kafka -.->|"delivers assembled events"| node_notification_assembled
node_notification_paid -.->|"notifies"| node_telegram
node_notification_assembled -.->|"notifies"| node_telegram
node_telegram -.->|"sends messages"| node_telegram_service
node_assembly_consumer -.->|"consumes through"| node_kafka_runtime
node_notification_paid -.->|"consumes through"| node_kafka_runtime
node_notification_assembled -.->|"consumes through"| node_kafka_runtime

click node_order_app "https://github.com/bahmn/rocket-factory/blob/main/order/internal/app/app.go"
click node_order_http "https://github.com/bahmn/rocket-factory/tree/main/order/internal/api/order/v1"
click node_order_logic "https://github.com/bahmn/rocket-factory/tree/main/order/internal/service/order"
click node_order_db "https://github.com/bahmn/rocket-factory/tree/main/order/internal/repository/order"
click node_order_inventory "https://github.com/bahmn/rocket-factory/tree/main/order/internal/client/grpc/inventory/v1"
click node_order_payment "https://github.com/bahmn/rocket-factory/tree/main/order/internal/client/grpc/payment/v1"
click node_order_events "https://github.com/bahmn/rocket-factory/tree/main/order/internal/service/producer/order_producer"
click node_iam_api "https://github.com/bahmn/rocket-factory/tree/main/iam/internal/api"
click node_iam_logic "https://github.com/bahmn/rocket-factory/tree/main/iam/internal/service"
click node_iam_store "https://github.com/bahmn/rocket-factory/tree/main/iam/internal/repository"
click node_inventory_api "https://github.com/bahmn/rocket-factory/tree/main/inventory/internal/api/inventory/v1"
click node_inventory_logic "https://github.com/bahmn/rocket-factory/tree/main/inventory/internal/service/inventory"
click node_inventory_store "https://github.com/bahmn/rocket-factory/tree/main/inventory/internal/repository/part"
click node_payment_api "https://github.com/bahmn/rocket-factory/tree/main/payment/internal/api/payment/v1"
click node_payment_logic "https://github.com/bahmn/rocket-factory/tree/main/payment/internal/service/payment"
click node_assembly_consumer "https://github.com/bahmn/rocket-factory/tree/main/assembly/internal/service/consumer/order_consumer"
click node_assembly_producer "https://github.com/bahmn/rocket-factory/tree/main/assembly/internal/service/producer/order_producer"
click node_notification_paid "https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/consumer/order_paid_consumer"
click node_notification_assembled "https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/consumer/order_assembled_consumer"
click node_telegram "https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/telegram"
click node_contracts "https://github.com/bahmn/rocket-factory/tree/main/shared/proto"
click node_kafka_runtime "https://github.com/bahmn/rocket-factory/tree/main/platform/pkg/kafka"

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_order_app,node_order_http,node_order_logic,node_order_db,node_order_inventory,node_order_payment,node_order_events,node_shopper toneBlue
class node_iam_api,node_iam_logic,node_iam_store toneAmber
class node_inventory_api,node_inventory_logic,node_inventory_store,node_payment_api,node_payment_logic,node_telegram_service toneMint
class node_assembly_consumer,node_assembly_producer,node_notification_paid,node_notification_assembled,node_telegram toneRose
class node_contracts,node_kafka_runtime,node_kafka toneIndigo
```

## Components

### Orders

- [Order API runtime](https://github.com/bahmn/rocket-factory/blob/main/order/internal/app/app.go): `order/internal/app/app.go`
- [Order HTTP endpoints](https://github.com/bahmn/rocket-factory/tree/main/order/internal/api/order/v1): `order/internal/api/order/v1`
- [Order operations](https://github.com/bahmn/rocket-factory/tree/main/order/internal/service/order): `order/internal/service/order`
- [Order repository](https://github.com/bahmn/rocket-factory/tree/main/order/internal/repository/order): `order/internal/repository/order`
- [Inventory client](https://github.com/bahmn/rocket-factory/tree/main/order/internal/client/grpc/inventory/v1): `order/internal/client/grpc/inventory/v1`
- [Payment client](https://github.com/bahmn/rocket-factory/tree/main/order/internal/client/grpc/payment/v1): `order/internal/client/grpc/payment/v1`
- [Order event producer](https://github.com/bahmn/rocket-factory/tree/main/order/internal/service/producer/order_producer): `order/internal/service/producer/order_producer`

### Identity

- [Auth and user APIs](https://github.com/bahmn/rocket-factory/tree/main/iam/internal/api): `iam/internal/api`
- [Identity services](https://github.com/bahmn/rocket-factory/tree/main/iam/internal/service): `iam/internal/service`
- [Identity repositories](https://github.com/bahmn/rocket-factory/tree/main/iam/internal/repository): `iam/internal/repository`

### Fulfillment

- [Inventory gRPC API](https://github.com/bahmn/rocket-factory/tree/main/inventory/internal/api/inventory/v1): `inventory/internal/api/inventory/v1`
- [Inventory services](https://github.com/bahmn/rocket-factory/tree/main/inventory/internal/service/inventory): `inventory/internal/service/inventory`
- [Inventory repository](https://github.com/bahmn/rocket-factory/tree/main/inventory/internal/repository/part): `inventory/internal/repository/part`
- [Payment gRPC API](https://github.com/bahmn/rocket-factory/tree/main/payment/internal/api/payment/v1): `payment/internal/api/payment/v1`
- [Payment service](https://github.com/bahmn/rocket-factory/tree/main/payment/internal/service/payment): `payment/internal/service/payment`

### Event services

- [Paid-order consumer](https://github.com/bahmn/rocket-factory/tree/main/assembly/internal/service/consumer/order_consumer): `assembly/internal/service/consumer/order_consumer`
- [Assembly event producer](https://github.com/bahmn/rocket-factory/tree/main/assembly/internal/service/producer/order_producer): `assembly/internal/service/producer/order_producer`
- [Paid-order handler](https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/consumer/order_paid_consumer): `notification/internal/service/consumer/order_paid_consumer`
- [Assembled handler](https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/consumer/order_assembled_consumer): `notification/internal/service/consumer/order_assembled_consumer`
- [Telegram delivery](https://github.com/bahmn/rocket-factory/tree/main/notification/internal/service/telegram): `notification/internal/service/telegram`

### Shared platform

- [Shared API contracts](https://github.com/bahmn/rocket-factory/tree/main/shared/proto): `shared/proto`
- [Kafka runtime](https://github.com/bahmn/rocket-factory/tree/main/platform/pkg/kafka): `platform/pkg/kafka`

### Other components

- **Order user**
- **Kafka**
- **Telegram API**

## Connections

- Order user → Order API runtime: sends requests (evidence: `order/internal/app/app.go`)
- Order API runtime → Order HTTP endpoints: routes HTTP
- Order API runtime → Order event producer: starts consumer (evidence: `order/internal/app/app.go`)
- Order HTTP endpoints → Order operations: dispatches
- Order operations → Order repository: reads and writes
- Order operations → Inventory client: requests parts
- Order operations → Payment client: requests payment
- Order operations → Order event producer: publishes events
- Order API runtime → Shared API contracts: serves generated API (evidence: `order/internal/app/app.go`)
- Auth and user APIs → Identity services: dispatches
- Identity services → Identity repositories: uses repositories (evidence: `iam/internal/service/auth/service.go`)
- Order API runtime → Auth and user APIs: authenticates requests
- Inventory client → Inventory gRPC API: calls gRPC
- Inventory gRPC API → Inventory services: dispatches
- Inventory services → Inventory repository: reads parts
- Payment client → Payment gRPC API: calls gRPC
- Payment gRPC API → Payment service: dispatches
- Kafka → Paid-order consumer: delivers paid events
- Paid-order consumer → Assembly event producer: emits assembly events
- Assembly event producer → Kafka: publishes
- Kafka → Paid-order handler: delivers paid events
- Kafka → Assembled handler: delivers assembled events
- Paid-order handler → Telegram delivery: notifies
- Assembled handler → Telegram delivery: notifies
- Telegram delivery → Telegram API: sends messages
- Paid-order consumer → Kafka runtime: consumes through (evidence: `assembly/internal/service/consumer/order_consumer/handler.go`)
- Paid-order handler → Kafka runtime: consumes through (evidence: `notification/internal/service/consumer/order_paid_consumer/handler.go`)
- Assembled handler → Kafka runtime: consumes through (evidence: `notification/internal/service/consumer/order_assembled_consumer/handler.go`)
