This project is a web service application implemented in Rust, using Axum framework for efficient and scalable routing. The database operations are handled by SeaORM. The project is designed using the MVC architecture to separate concerns and improve code maintainability.
- High Performance: Built with Rust for optimal speed and efficiency.
- Modular Design : Use MVC model to build a complete simple web-application
- FrameWork : Axum, SeaORM
- Extensible: Deploying simple modules for beginners to understand and learn about Rust
-
Clone the repository:
git clone https://github.com/PhucLam202/rust-axum-seaorm-mvc.git cd rust-axum-seaorm-mvc
-
Install Rust and Cargo, SeaORM, Axum:
Ensure you have Rust and Cargo installed. You can install them via
-
Build the project:
cargo build
-
Run the project:
cargo run
src
├── controllers
│ ├── mod.rs
│ └── users_controller.rs
├── main.rs
├── middleware
│ ├── api_error.rs
│ └── mod.rs
├── models
│ ├── mod.rs
│ └── users_model.rs
├── routers
│ ├── mod.rs
│ └── user_router.rs
└── server
├── mod.rs
└── postgres_server.rs
src/controllers
: Contains the controllers for handling HTTPrequests
andresponses
.src/models
: Contains the models representing the data structures anddatabase entities
.src/middleware
: Middleware contains manage error files or security-related files.src/routers
: Contains routers endpoint in the project.src/server
: Contains managed connection todatabase
.