Template for a microservice based on Domain Driven Design principles with Rust
MIT License
Template for microservice based on Domain Driven Design principles with Rust
The purpose of this project is to provide a means for building microservices with the last version of Rust that follows basic Domain Driven Design principles
If you're using this repository for your learning, samples or your project, please give a star. Thanks 👍
Before you can install and configure the microservice, you will need to ensure that you have the following prerequisites installed:
Once you have all the prerequisites installed, you can follow these steps to install and configure your microservice:
git clone https://github.com/nkz-soft/rust-microservice-template.git
cd rust-microservice-template/deployment/docker
./docker-compose.sh up --build -d
curl -v http://localhost:8181/to-do-items
To configure the microservice, you will need to modify the configuration file: config.app.toml.
The microservice is divided into three layers: the Domain Layer, the Application Layer, and the Infrastructure Layer.
The Domain Layer is the heart of the Domain Driven Design (DDD) approach. It contains the business logic and rules that drive the application. In Rust, the Domain Layer consists of structs, traits, enums, and functions that model the problem domain in a way that is easy to understand and maintain.
The Application Layer is responsible for coordinating the Domain Layer and the Infrastructure Layer. It translates user requests and external events into actions that the Domain Layer can understand, and communicates the results back to the user or external systems.
The Infrastructure Layer is responsible for providing the necessary infrastructure to run the application. This can include things like databases, message queues, and external APIs.
CQRS (Command Query Responsibility Segregation) is a pattern that separates the read and write responsibilities of an application into separate models.