Ratatosk is a small, event-driven C# application based on Domain-Driven Design (DDD) principles. It leverages event sourcing, CQRS, and snapshotting to manage domain logic and state.
- Event Sourcing: Stores all changes to the application state as a sequence of events.
- CQRS (Command Query Responsibility Segregation): Separates read and write operations for better performance and scalability.
- Snapshotting: Periodically captures the state of aggregates to improve rehydration performance.
- Pluggable Infrastructure: Supports multiple storage backends, including in-memory, file-based, and SQL databases.
- Extensible Core: Provides a core library with reusable DDD building blocks.
- Core: Contains foundational building blocks like
AggregateRoot,DomainEvent, and utility classes (Result,Maybe,Guard). - Domain: Houses domain-specific logic and aggregates, such as the
Productaggregate in the catalog domain. - Application: Contains services, command and query handlers, and orchestrates application logic.
- Infrastructure: Implements storage solutions, serialization, and external configurations.
- API: Provides a minimal API interface for interacting with the application.
-
Clone the Repository:
git clone https://github.com/questo/ratatosk.git
-
Build and Run:
cd src/API dotnet run -
Configuration:
Adjust your configuration settings via environment variables (recommended). At minimum set a 32-byte HS256 signing key, e.g. in.env:AUTHENTICATION_SECRET=RC9r7YtLzYVn0xOkGzAIxx7am6i83hgx1ot1nzR6m38=
Docker compose already passes
Authentication__Secretfrom.env;appsettings*.jsonintentionally leaveAuthentication:Secretblank to avoid committing secrets.
Run tests
./scripts/run-unit-tests.sh
./scripts/run-integration-tests.sh