Specifically, I have created a mock-up as shown in the URL below: https://github.com/ekusiadadus/rust-clean-arch
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.
In the end, the best practice for engineering software is usually to keep it simple. I've had to learn that I'm too often trying to overengineer things, and I end up getting nothing done.
Basically I put db in it's own crate then crates for controller and another for pages.
The folders for each section of the web application.