How lerianstudio/midaz works
Project type and purpose
• Midaz is an enterprise-grade, open-source ledger system built as a cloud-native, microservices platform plus a CLI.
• Its purpose is to provide a core banking foundation: domain-model services for onboarding (organizations, ledgers, assets, portfolios, segments, and accounts), a transaction engine (double-entry, event-driven), and a powerful CLI/DSL for orchestration.
File structure
• Top-level “components” folder holds three modules plus infra:
• components/infra – Docker-Compose definitions for PostgreSQL (primary-replica), MongoDB replica set, RabbitMQ, Redis (Valkey), Grafana/OAuth.
• components/onboarding – Go service exposing REST APIs (Hexagonal + CQRS), adapters for HTTP in/out, PostgreSQL, MongoDB, RabbitMQ, Redis.
• components/transaction – Go service exposing REST APIs + message consumers/producers (Event-driven), adapters for HTTP, PostgreSQL, MongoDB, RabbitMQ, Redis.
• components/mdz – MDZ CLI built with Cobra, TUI helpers, internal domain clients, REST clients, environment/config handling.
• Shared packages under pkg/… for common code:
• pkg/gold – DSL grammar, parser, validator for transaction DSL.
• pkg/mmodel – in-memory domain models used across services/CLI.
• pkg/net, pkg/shell, pkg/output, pkg/iostreams, etc. for HTTP helpers, logging, shell utilities.
• CI/CD / tooling: Git hooks (.githooks), GitHub workflows (.github/workflows), Makefile, GoReleaser, Goreleporter, Chocolatey packaging.
README for additional insights
• Confirms 4 main components: Onboarding Service, Transaction Service, MDZ CLI, Infrastructure Layer.
• Architectural patterns: Hexagonal, CQRS for Onboarding, Event-Driven for Transaction, DSL for complex transaction modeling, optimistic concurrency for balance updates.
Detail
• Every adapter and data store connection.
• Protocols (HTTP/JSON, AMQP, Redis Pub/Sub).
• Optionally, include the CI/CD pipeline (Git hooks, GitHub Actions, GoReleaser) in the corner to show delivery flow.