A web server application built with Rust and Axum framework.
This project implements a simple HTTP server using the Axum web framework for Rust.
- REST API with Axum
- Asynchronous runtime with Tokio
- JSON serialization with Serde
- SeaORM - Async ORM for Rust
- cargo-watch for REPL
- rust-i18n for internationalization
- PostgreSQL for database
- JWT authentication with refresh token (http only secure cookie)
- RBAC (Role-Based Access Control)
- internationalization
- modularity architecture
- CRUD operations
- repository pattern
- error handling
- JWT extractor / JWT middleware (Guard)
- role extractor (Guard)
- request validation with DTO
- migration with SeaORM
- database seeding
- configuration module
- database module
- files module
- emails module
- app state struct with connection pool and configuration
- dependency injection with Arc dyn Trait
- Rust 2024 edition
- Cargo package manager
Clone the repository and build the project:
git clone <repository-url>
cd rust-axum-app
cargo build- Install PostgreSQL and create a database:
rust_axum_app - Copy the
.env.examplefile to.envand set the database connection string.
cp .env.example .envInstall the sea-orm-cli with cargo.
cargo install sea-orm-cli@1.1.0Install cargo-watch to REPL.
cargo install cargo-watchRun the server in REPL mode.
cargo watch -q -c -w src/ -x "run"Install the sea-orm-cli with cargo.
cargo install sea-orm-cli@1.1.0Run the server.
cargo run