New ask Hacker News story: Ask HN: How to structure Rust, Axum, and SQLx for clean architecture?
Ask HN: How to structure Rust, Axum, and SQLx for clean architecture?
3 by ekusiadadus | 0 comments on Hacker News.
I would like to know the best practices for structuring directories and packages to implement clean architecture using Rust, Axum, and SQLx. Specifically, I have created a mock-up as shown in the URL below: https://ift.tt/VW0gawy The structure is as follows: ``` . ├── Cargo.lock ├── Cargo.toml ├── Makefile ├── README.md ├── cfn │ ├── Cargo.toml │ └── src │ └── main.rs ├── docker-compose.yml ├── migrations │ └── 20240504184155_create_user.sql └── src ├── application │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── session_service.rs │ └── user_service.rs ├── controller │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── user_controller.rs ├── domain │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── repository.rs │ ├── session.rs │ └── user.rs ├── infrastructure │ ├── Cargo.toml │ └── src │ ├── db.rs │ ├── lib.rs │ ├── session_repository.rs │ └── user_repository.rs └── main.rs ``` Please let me know if there is anyone familiar with DDD (Domain-Driven Design) or clean architecture.
3 by ekusiadadus | 0 comments on Hacker News.
I would like to know the best practices for structuring directories and packages to implement clean architecture using Rust, Axum, and SQLx. Specifically, I have created a mock-up as shown in the URL below: https://ift.tt/VW0gawy The structure is as follows: ``` . ├── Cargo.lock ├── Cargo.toml ├── Makefile ├── README.md ├── cfn │ ├── Cargo.toml │ └── src │ └── main.rs ├── docker-compose.yml ├── migrations │ └── 20240504184155_create_user.sql └── src ├── application │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── session_service.rs │ └── user_service.rs ├── controller │ ├── Cargo.toml │ └── src │ ├── lib.rs │ └── user_controller.rs ├── domain │ ├── Cargo.toml │ └── src │ ├── lib.rs │ ├── repository.rs │ ├── session.rs │ └── user.rs ├── infrastructure │ ├── Cargo.toml │ └── src │ ├── db.rs │ ├── lib.rs │ ├── session_repository.rs │ └── user_repository.rs └── main.rs ``` Please let me know if there is anyone familiar with DDD (Domain-Driven Design) or clean architecture.
Comments
Post a Comment