Rust Clean Architecture project.
Please see Uncle Bob article or some of these visuals for more information.
Dependencies should be Outside -> In. This means that no inner circle can depend on any of the outer circles.
In this folder structure we have:
- Infrastructure
- Presentation
- Application
- Domain
Both Infrastructure and Presentation are the top external layers (Blue
and Green
areas in the above picture).
Infrastructure
contains any persistent logic and external providers.
Presentation
contains the dtos
and a rest_api
to interact with Application
.
Application
is the application logic, it constains the business and use cases that interact with our Domain
.
Domain
includes all entities that form our internal domain.
./scripts/run_postgres.sh // initial database setup. It runs docker base image and seeds the database.
cargo build // builds the app
cargo run // runs the app