# shestoi/gobigtech architecture

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

- Interactive diagram: https://gitdiagram.com/shestoi/gobigtech
- Repository: https://github.com/shestoi/gobigtech

## Overview

GoBigTech is a Go microservices backend for checkout, identity, inventory, payment, asynchronous assembly, and user notifications. The main path begins with an order request, checks inventory and payment, then uses Kafka-driven assembly and notification stages. IAM provides registration, login, sessions, and authorization; Notification also accepts Alertmanager webhooks. Edges follow the excerpts and README; some internal wiring and event-to-service links are documented only broadly, so those links are dashed rather than asserted as verified calls.

Main entry points: [`services/order/internal/api/http/handler.go`](https://github.com/shestoi/gobigtech/blob/main/services/order/internal/api/http/handler.go) (Order HTTP API), [`services/order/internal/service/service.go`](https://github.com/shestoi/gobigtech/blob/main/services/order/internal/service/service.go) (Order service), [`services/order/internal/client/grpc`](https://github.com/shestoi/gobigtech/tree/main/services/order/internal/client/grpc) (Inventory/payment clients), [`services/order/internal/event/kafka`](https://github.com/shestoi/gobigtech/tree/main/services/order/internal/event/kafka) (Order Kafka events)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orders["Order management"]
  node_order_api["Order HTTP API<br/>[handler.go]"]
  node_order_service["Order service<br/>[service.go]"]
  node_order_store[("Order PostgreSQL<br/>[repository.go]")]
  node_order_clients["Inventory/payment clients"]
  node_order_events["Order Kafka events"]
end

subgraph group_core["Core services"]
  node_iam_api["IAM gRPC API<br/>[handler.go]"]
  node_iam_service["IAM service<br/>[service.go]"]
  node_iam_users[("User PostgreSQL<br/>[repository.go]")]
  node_iam_sessions[("Session Redis")]
  node_inventory_api["Inventory gRPC API<br/>[handler.go]"]
  node_inventory_service["Inventory service<br/>[service.go]"]
  node_inventory_store[("Inventory MongoDB<br/>[repository.go]")]
  node_payment_api["Payment gRPC API<br/>[handler.go]"]
  node_payment_service["Payment service<br/>[service.go]"]
  node_payment_store[("Payment memory store<br/>[memory.go]")]
end

subgraph group_async["Events and notifications"]
  node_assembly_consumer["Assembly Kafka consumer<br/>[consumer.go]"]
  node_assembly_service["Assembly service<br/>[service.go]"]
  node_assembly_events["Assembly Kafka publisher<br/>[producer.go]"]
  node_notification_consumers["Notification consumers"]
  node_notification_service["Notification service<br/>[service.go]"]
  node_notification_store[("Notification PostgreSQL<br/>[repository.go]")]
  node_telegram["Telegram sender<br/>[client.go]"]
  node_alertmanager["Alertmanager webhook<br/>[alertmanager.go]"]
end

subgraph group_platform["Shared platform"]
  node_observability["Observability<br/>[init.go]"]
end

node_customer(("Customer"))

node_customer -->|"creates order"| node_order_api
node_order_api -->|"handles request"| node_order_service
node_order_service -->|"uses repository"| node_order_store
node_order_api -.->|"checkout integrations"| node_order_clients
node_order_service -.->|"checks and charges"| node_order_clients
node_order_service -.->|"publishes events"| node_order_events
node_order_api -.->|"session authorization"| node_iam_api
node_iam_api -->|"dispatches calls"| node_iam_service
node_iam_service -->|"reads and writes"| node_iam_users
node_iam_service -.->|"manages sessions"| node_iam_sessions
node_order_clients -.->|"gRPC requests"| node_inventory_api
node_inventory_api -->|"dispatches calls"| node_inventory_service
node_inventory_service -->|"uses repository"| node_inventory_store
node_order_clients -.->|"gRPC requests"| node_payment_api
node_payment_api -->|"dispatches calls"| node_payment_service
node_payment_service -.->|"uses repository"| node_payment_store
node_order_events -.->|"Kafka events"| node_assembly_consumer
node_assembly_consumer -.->|"processes events"| node_assembly_service
node_assembly_service -.->|"publishes completion"| node_assembly_events
node_order_events -.->|"payment events"| node_notification_consumers
node_assembly_events -.->|"assembly events"| node_notification_consumers
node_notification_consumers -.->|"dispatches events"| node_notification_service
node_notification_service -->|"uses repository"| node_notification_store
node_notification_service -->|"sends messages"| node_telegram
node_alertmanager -->|"sends alerts"| node_telegram

click node_order_api "https://github.com/shestoi/gobigtech/blob/main/services/order/internal/api/http/handler.go"
click node_order_service "https://github.com/shestoi/gobigtech/blob/main/services/order/internal/service/service.go"
click node_order_store "https://github.com/shestoi/gobigtech/blob/main/services/order/internal/repository/postgres/repository.go"
click node_order_clients "https://github.com/shestoi/gobigtech/tree/main/services/order/internal/client/grpc"
click node_order_events "https://github.com/shestoi/gobigtech/tree/main/services/order/internal/event/kafka"
click node_iam_api "https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/api/grpc/handler.go"
click node_iam_service "https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/service/service.go"
click node_iam_users "https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/repository/postgres/repository.go"
click node_iam_sessions "https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/repository/redis/session_repository.go"
click node_inventory_api "https://github.com/shestoi/gobigtech/blob/main/services/inventory/internal/api/grpc/handler.go"
click node_inventory_service "https://github.com/shestoi/gobigtech/blob/main/services/inventory/internal/service/service.go"
click node_inventory_store "https://github.com/shestoi/gobigtech/blob/main/services/inventory/internal/repository/mongo/repository.go"
click node_payment_api "https://github.com/shestoi/gobigtech/blob/main/services/payment/internal/api/grpc/handler.go"
click node_payment_service "https://github.com/shestoi/gobigtech/blob/main/services/payment/internal/service/service.go"
click node_payment_store "https://github.com/shestoi/gobigtech/blob/main/services/payment/internal/repository/memory/memory.go"
click node_assembly_consumer "https://github.com/shestoi/gobigtech/blob/main/services/assembly/internal/event/kafka/consumer.go"
click node_assembly_service "https://github.com/shestoi/gobigtech/blob/main/services/assembly/internal/service/service.go"
click node_assembly_events "https://github.com/shestoi/gobigtech/blob/main/services/assembly/internal/event/kafka/producer.go"
click node_notification_consumers "https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/event/kafka/payment_consumer.go"
click node_notification_service "https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/service/service.go"
click node_notification_store "https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/repository/postgres/repository.go"
click node_telegram "https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/telegram/client.go"
click node_alertmanager "https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/api/http/alertmanager.go"
click node_observability "https://github.com/shestoi/gobigtech/blob/main/platform/observability/init.go"

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_api,node_order_service,node_order_store,node_order_clients,node_order_events toneBlue
class node_iam_api,node_iam_service,node_iam_users,node_iam_sessions,node_inventory_api,node_inventory_service,node_inventory_store,node_payment_api,node_payment_service,node_payment_store toneAmber
class node_assembly_consumer,node_assembly_service,node_assembly_events,node_notification_consumers,node_notification_service,node_notification_store,node_telegram,node_alertmanager toneMint
class node_observability toneRose
class node_customer toneIndigo
```

## Components

### Order management

- [Order HTTP API](https://github.com/shestoi/gobigtech/blob/main/services/order/internal/api/http/handler.go): `services/order/internal/api/http/handler.go`
- [Order service](https://github.com/shestoi/gobigtech/blob/main/services/order/internal/service/service.go): `services/order/internal/service/service.go`
- [Order PostgreSQL](https://github.com/shestoi/gobigtech/blob/main/services/order/internal/repository/postgres/repository.go): `services/order/internal/repository/postgres/repository.go`
- [Inventory/payment clients](https://github.com/shestoi/gobigtech/tree/main/services/order/internal/client/grpc): `services/order/internal/client/grpc`
- [Order Kafka events](https://github.com/shestoi/gobigtech/tree/main/services/order/internal/event/kafka): `services/order/internal/event/kafka`

### Core services

- [IAM gRPC API](https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/api/grpc/handler.go): `services/iam/internal/api/grpc/handler.go`
- [IAM service](https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/service/service.go): `services/iam/internal/service/service.go`
- [User PostgreSQL](https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/repository/postgres/repository.go): `services/iam/internal/repository/postgres/repository.go`
- [Session Redis](https://github.com/shestoi/gobigtech/blob/main/services/iam/internal/repository/redis/session_repository.go): `services/iam/internal/repository/redis/session_repository.go`
- [Inventory gRPC API](https://github.com/shestoi/gobigtech/blob/main/services/inventory/internal/api/grpc/handler.go): `services/inventory/internal/api/grpc/handler.go`
- [Inventory service](https://github.com/shestoi/gobigtech/blob/main/services/inventory/internal/service/service.go): `services/inventory/internal/service/service.go`
- [Inventory MongoDB](https://github.com/shestoi/gobigtech/blob/main/services/inventory/internal/repository/mongo/repository.go): `services/inventory/internal/repository/mongo/repository.go`
- [Payment gRPC API](https://github.com/shestoi/gobigtech/blob/main/services/payment/internal/api/grpc/handler.go): `services/payment/internal/api/grpc/handler.go`
- [Payment service](https://github.com/shestoi/gobigtech/blob/main/services/payment/internal/service/service.go): `services/payment/internal/service/service.go`
- [Payment memory store](https://github.com/shestoi/gobigtech/blob/main/services/payment/internal/repository/memory/memory.go): `services/payment/internal/repository/memory/memory.go`

### Events and notifications

- [Assembly Kafka consumer](https://github.com/shestoi/gobigtech/blob/main/services/assembly/internal/event/kafka/consumer.go): `services/assembly/internal/event/kafka/consumer.go`
- [Assembly service](https://github.com/shestoi/gobigtech/blob/main/services/assembly/internal/service/service.go): `services/assembly/internal/service/service.go`
- [Assembly Kafka publisher](https://github.com/shestoi/gobigtech/blob/main/services/assembly/internal/event/kafka/producer.go): `services/assembly/internal/event/kafka/producer.go`
- [Notification consumers](https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/event/kafka/payment_consumer.go): `services/notification/internal/event/kafka/payment_consumer.go`
- [Notification service](https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/service/service.go): `services/notification/internal/service/service.go`
- [Notification PostgreSQL](https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/repository/postgres/repository.go): `services/notification/internal/repository/postgres/repository.go`
- [Telegram sender](https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/telegram/client.go): `services/notification/internal/telegram/client.go`
- [Alertmanager webhook](https://github.com/shestoi/gobigtech/blob/main/services/notification/internal/api/http/alertmanager.go): `services/notification/internal/api/http/alertmanager.go`

### Shared platform

- [Observability](https://github.com/shestoi/gobigtech/blob/main/platform/observability/init.go): `platform/observability/init.go`

### Other components

- **Customer**

## Connections

- Customer → Order HTTP API: creates order
- Order HTTP API → Order service: handles request (evidence: `services/order/internal/api/http/handler.go`)
- Order service → Order PostgreSQL: uses repository (evidence: `services/order/internal/service/service.go`)
- Order HTTP API → Inventory/payment clients: checkout integrations
- Order service → Inventory/payment clients: checks and charges
- Order service → Order Kafka events: publishes events
- Order HTTP API → IAM gRPC API: session authorization
- IAM gRPC API → IAM service: dispatches calls (evidence: `services/iam/internal/api/grpc/handler.go`)
- IAM service → User PostgreSQL: reads and writes (evidence: `services/iam/internal/service/service.go`)
- IAM service → Session Redis: manages sessions (evidence: `services/iam/internal/service/service.go`)
- Inventory/payment clients → Inventory gRPC API: gRPC requests
- Inventory gRPC API → Inventory service: dispatches calls (evidence: `services/inventory/internal/api/grpc/handler.go`)
- Inventory service → Inventory MongoDB: uses repository (evidence: `services/inventory/internal/service/service.go`)
- Inventory/payment clients → Payment gRPC API: gRPC requests
- Payment gRPC API → Payment service: dispatches calls (evidence: `services/payment/internal/api/grpc/handler.go`)
- Payment service → Payment memory store: uses repository (evidence: `services/payment/internal/service/service.go`)
- Order Kafka events → Assembly Kafka consumer: Kafka events
- Assembly Kafka consumer → Assembly service: processes events
- Assembly service → Assembly Kafka publisher: publishes completion
- Order Kafka events → Notification consumers: payment events
- Assembly Kafka publisher → Notification consumers: assembly events
- Notification consumers → Notification service: dispatches events
- Notification service → Notification PostgreSQL: uses repository (evidence: `services/notification/internal/service/service.go`)
- Notification service → Telegram sender: sends messages (evidence: `services/notification/internal/service/service.go`)
- Alertmanager webhook → Telegram sender: sends alerts (evidence: `services/notification/internal/api/http/alertmanager.go`)
