How katayama8000/axum-cqrs-rust works
Project type and purpose
• This is a Rust-based, Docker-oriented backend microservice implementing CQRS (Command Query Responsibility Segregation) and Event Sourcing via Axum, MariaDB and Redis.
• It exposes HTTP endpoints (version check, create/update/find/list circles), handles commands through a write pipeline, persists events/snapshots, publishes them to Redis, and serves queries from a read model.
File structure
• Top-level crates (in src/crates/):
• main: boots the application, loads config, sets up DI/injectors (command/query handler wiring).
• api: HTTP router, request handlers, application state.
• command: definition of commands, command handler orchestrating domain logic.
• domain: aggregates (Circle), value objects, interfaces (ports) for repository, duplicate checker, reader.
• infrastructure: adapters (adapters for MariaDB schema, repository impl, Redis event publisher).
• query: query definitions and query handler (read pipeline).
• Supporting:
• src/bin/main.rs – alternative entrypoint.
• Docker assets under Docker/ (db, redis, server).
• compose.yml – service composition.
• SQL scripts under sql/, docs in docs/, design notes under Description/.
• CI/CD workflows, devcontainer, Makefile, shell scripts.
README
• Tech stack: Rust, Axum, MariaDB, Redis, Docker
• Architecture: CQRS + Event Sourcing
• Points to docs/EVENT_SYSTEM_ARCHITECTURE.md for deep dive.