# reoden/go-nft architecture

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

- Interactive diagram: https://gitdiagram.com/reoden/go-nft
- Repository: https://github.com/reoden/go-nft

## Overview

This repository is a Go backend template and shared platform, with a working catalogs service centered on product operations. Its principal workflow is an API request routed to a product use case, which reads or changes product data and returns a response. The tree also documents or exposes gRPC, messaging, event sourcing, persistence, and observability capabilities. The sampled source confirms middleware and server behavior, but not the catalogs endpoint-to-handler wiring; those workflow links reflect the documented architecture and directory structure, not inspected handler implementations.

Main entry points: [`internal/services/catalogs/internal/products/features`](https://github.com/reoden/go-nft/tree/main/internal/services/catalogs/internal/products/features) (Product Use Cases), [`internal/pkg/http/customecho/echo_server.go`](https://github.com/reoden/go-nft/blob/main/internal/pkg/http/customecho/echo_server.go) (HTTP Server), [`internal/pkg/fxapp/application.go`](https://github.com/reoden/go-nft/blob/main/internal/pkg/fxapp/application.go) (Application Container), [`internal/pkg/core/cqrs`](https://github.com/reoden/go-nft/tree/main/internal/pkg/core/cqrs) (CQRS Mediator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_catalog["Catalogs Service"]
  node_product_routes["Product Routes<br/>[endpoints.go]"]
  node_product_slices["Product Use Cases"]
  node_product_domain["Product Model<br/>[product.go]"]
  node_product_repository["Product Repository"]
  node_user_service["User Service Scaffold"]
end

subgraph group_platform["Application Platform"]
  node_http["HTTP Server<br/>[echo_server.go]"]
  node_mediator["CQRS Mediator"]
  node_validation["Request Validation"]
  node_grpc["gRPC API<br/>[server.go]"]
end

subgraph group_data["Persistence"]
  node_postgres[("PostgreSQL<br/>[gorm_db.go]")]
  node_event_store[("Event Store<br/>[event_store.go]")]
  node_elasticsearch[("Elasticsearch<br/>[elasticsearch.go]")]
end

subgraph group_integration["Integration"]
  node_messaging["Message Bus<br/>[bus.go]"]
  node_rabbitmq["RabbitMQ<br/>[rabbitmq-bus.go]"]
  node_redis["Redis<br/>[redis.go]"]
end

subgraph group_operations["Operations"]
  node_auth["Auth Certification"]
  node_telemetry["Telemetry<br/>[metrics.go]"]
  node_app_container["Application Container<br/>[application.go]"]
end

node_client(("API Client"))

node_client -->|"sends request"| node_http
node_http -->|"routes request"| node_product_routes
node_product_routes -->|"dispatches request"| node_mediator
node_mediator -->|"runs pipeline"| node_validation
node_mediator -->|"dispatches use case"| node_product_slices
node_product_slices -->|"reads or writes"| node_product_repository
node_product_repository -->|"persists data"| node_postgres
node_product_slices -->|"uses model"| node_product_domain
node_grpc -.->|"serves products"| node_product_domain
node_messaging -.->|"adapts transport"| node_rabbitmq
node_product_slices -.->|"uses event storage"| node_event_store
node_product_slices -.->|"search integration"| node_elasticsearch
node_app_container -->|"provides server"| node_http
node_app_container -.->|"provides server"| node_grpc
node_app_container -->|"configures routes"| node_product_routes
node_auth -.->|"protects requests"| node_http
node_http -.->|"records telemetry"| node_telemetry
node_app_container -.->|"configures service"| node_user_service

click node_http "https://github.com/reoden/go-nft/blob/main/internal/pkg/http/customecho/echo_server.go"
click node_product_routes "https://github.com/reoden/go-nft/blob/main/internal/services/catalogs/internal/products/configurations/endpoints/endpoints.go"
click node_product_slices "https://github.com/reoden/go-nft/tree/main/internal/services/catalogs/internal/products/features"
click node_product_domain "https://github.com/reoden/go-nft/blob/main/internal/services/catalogs/internal/products/models/product.go"
click node_product_repository "https://github.com/reoden/go-nft/blob/main/internal/services/catalogs/internal/products/data/repositories/pg_product_repository.go"
click node_mediator "https://github.com/reoden/go-nft/tree/main/internal/pkg/core/cqrs"
click node_validation "https://github.com/reoden/go-nft/blob/main/internal/pkg/validation/pipeline/validation_pipeline.go"
click node_grpc "https://github.com/reoden/go-nft/blob/main/internal/pkg/grpc/server.go"
click node_postgres "https://github.com/reoden/go-nft/blob/main/internal/pkg/postgresgorm/gorm_db.go"
click node_event_store "https://github.com/reoden/go-nft/blob/main/internal/pkg/eventstroredb/event_store.go"
click node_elasticsearch "https://github.com/reoden/go-nft/blob/main/internal/pkg/elasticsearch/elasticsearch.go"
click node_messaging "https://github.com/reoden/go-nft/blob/main/internal/pkg/core/messaging/bus/bus.go"
click node_rabbitmq "https://github.com/reoden/go-nft/blob/main/internal/pkg/rabbitmq/bus/rabbitmq-bus.go"
click node_redis "https://github.com/reoden/go-nft/blob/main/internal/pkg/redis/redis.go"
click node_auth "https://github.com/reoden/go-nft/blob/main/internal/pkg/authcertification/auth_certification.go"
click node_telemetry "https://github.com/reoden/go-nft/blob/main/internal/pkg/otel/metrics/metrics.go"
click node_app_container "https://github.com/reoden/go-nft/blob/main/internal/pkg/fxapp/application.go"
click node_user_service "https://github.com/reoden/go-nft/blob/main/internal/services/user/internal/shared/configurations/user/user_configurator.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_product_routes,node_product_slices,node_product_domain,node_product_repository,node_user_service,node_client toneBlue
class node_http,node_mediator,node_validation,node_grpc toneAmber
class node_postgres,node_event_store,node_elasticsearch toneMint
class node_messaging,node_rabbitmq,node_redis toneRose
class node_auth,node_telemetry,node_app_container toneIndigo
```

## Components

### Catalogs Service

- [Product Routes](https://github.com/reoden/go-nft/blob/main/internal/services/catalogs/internal/products/configurations/endpoints/endpoints.go): `internal/services/catalogs/internal/products/configurations/endpoints/endpoints.go`
- [Product Use Cases](https://github.com/reoden/go-nft/tree/main/internal/services/catalogs/internal/products/features): `internal/services/catalogs/internal/products/features`
- [Product Model](https://github.com/reoden/go-nft/blob/main/internal/services/catalogs/internal/products/models/product.go): `internal/services/catalogs/internal/products/models/product.go`
- [Product Repository](https://github.com/reoden/go-nft/blob/main/internal/services/catalogs/internal/products/data/repositories/pg_product_repository.go): `internal/services/catalogs/internal/products/data/repositories/pg_product_repository.go`
- [User Service Scaffold](https://github.com/reoden/go-nft/blob/main/internal/services/user/internal/shared/configurations/user/user_configurator.go): `internal/services/user/internal/shared/configurations/user/user_configurator.go`

### Application Platform

- [HTTP Server](https://github.com/reoden/go-nft/blob/main/internal/pkg/http/customecho/echo_server.go): `internal/pkg/http/customecho/echo_server.go`
- [CQRS Mediator](https://github.com/reoden/go-nft/tree/main/internal/pkg/core/cqrs): `internal/pkg/core/cqrs`
- [Request Validation](https://github.com/reoden/go-nft/blob/main/internal/pkg/validation/pipeline/validation_pipeline.go): `internal/pkg/validation/pipeline/validation_pipeline.go`
- [gRPC API](https://github.com/reoden/go-nft/blob/main/internal/pkg/grpc/server.go): `internal/pkg/grpc/server.go`

### Persistence

- [PostgreSQL](https://github.com/reoden/go-nft/blob/main/internal/pkg/postgresgorm/gorm_db.go): `internal/pkg/postgresgorm/gorm_db.go`
- [Event Store](https://github.com/reoden/go-nft/blob/main/internal/pkg/eventstroredb/event_store.go): `internal/pkg/eventstroredb/event_store.go`
- [Elasticsearch](https://github.com/reoden/go-nft/blob/main/internal/pkg/elasticsearch/elasticsearch.go): `internal/pkg/elasticsearch/elasticsearch.go`

### Integration

- [Message Bus](https://github.com/reoden/go-nft/blob/main/internal/pkg/core/messaging/bus/bus.go): `internal/pkg/core/messaging/bus/bus.go`
- [RabbitMQ](https://github.com/reoden/go-nft/blob/main/internal/pkg/rabbitmq/bus/rabbitmq-bus.go): `internal/pkg/rabbitmq/bus/rabbitmq-bus.go`
- [Redis](https://github.com/reoden/go-nft/blob/main/internal/pkg/redis/redis.go): `internal/pkg/redis/redis.go`

### Operations

- [Auth Certification](https://github.com/reoden/go-nft/blob/main/internal/pkg/authcertification/auth_certification.go): `internal/pkg/authcertification/auth_certification.go`
- [Telemetry](https://github.com/reoden/go-nft/blob/main/internal/pkg/otel/metrics/metrics.go): `internal/pkg/otel/metrics/metrics.go`
- [Application Container](https://github.com/reoden/go-nft/blob/main/internal/pkg/fxapp/application.go): `internal/pkg/fxapp/application.go`

### Other components

- **API Client**

## Connections

- API Client → HTTP Server: sends request
- HTTP Server → Product Routes: routes request
- Product Routes → CQRS Mediator: dispatches request
- CQRS Mediator → Request Validation: runs pipeline
- CQRS Mediator → Product Use Cases: dispatches use case
- Product Use Cases → Product Repository: reads or writes
- Product Repository → PostgreSQL: persists data
- Product Use Cases → Product Model: uses model
- gRPC API → Product Model: serves products
- Message Bus → RabbitMQ: adapts transport
- Product Use Cases → Event Store: uses event storage
- Product Use Cases → Elasticsearch: search integration
- Application Container → HTTP Server: provides server
- Application Container → gRPC API: provides server
- Application Container → Product Routes: configures routes
- Auth Certification → HTTP Server: protects requests
- HTTP Server → Telemetry: records telemetry
- Application Container → User Service Scaffold: configures service
