Complete 12-module course covering Axum web framework from beginner to production-ready applications. Built for the YouTube tutorial series by Aarambh Dev Hub.
οΏ½ Full Course Video: Coming Soon - Subscribe for notification!
- β Build REST APIs with Axum 0.8.8 (latest version)
- β
Master routing with NEW path syntax
/{id} - β Extractors - Path, Query, JSON, Headers, Custom
- β
State management with
Arc&RwLock - β Tower middleware - CORS, Compression, Custom
- β
Professional error handling with
thiserror - β PostgreSQL database with SQLx
- β JWT Authentication with Argon2 password hashing
- β Real-time features - WebSockets & Server-Sent Events
- β File uploads with Multipart
- β Testing strategies for Axum
- β Production deployment with Docker
# Clone the repository
git clone https://github.com/aarambh-darshan/axum-full-course.git
cd axum-full-course
# Build all modules
cargo build --workspace
# Run a specific module
cargo run -p module-01-intro
# Run tests
cargo test --workspace- Rust 1.78+ installed (Install Rust)
- Basic Rust knowledge (ownership, traits, async/await)
- (Optional) Docker for database modules
- (Optional) PostgreSQL for Modules 08-09
| Module | Topic | Description | Port |
|---|---|---|---|
| 01 | Introduction | Hello World, axum::serve, basic handlers |
3000 |
| 02 | Routing | Path params /{id}, nesting, HTTP methods |
3000 |
| 03 | Extractors | Path, Query, Json, Headers, custom extractors | 3000 |
| 04 | Responses | IntoResponse, Json, Html, status codes | 3000 |
| 05 | State | Arc, RwLock, shared mutable state | 3000 |
| 06 | Middleware | Tower, CORS, compression, custom middleware | 3000 |
| 07 | Errors | Custom error types, thiserror, error handling | 3000 |
| 08 | Database | SQLx, PostgreSQL, CRUD operations | 3000 |
| 09 | Authentication | JWT, Argon2 hashing, protected routes | 3000 |
| 10 | Advanced | WebSockets, SSE, file uploads | 3000 |
| 11 | Testing | Unit tests, integration tests, oneshot | 3000 |
| 12 | Production | Docker, graceful shutdown, tracing | 3000 |
This course covers the latest Axum 0.8.8 features:
| Feature | Old Syntax | New Syntax |
|---|---|---|
| Path Parameters | /:id |
/{id} β¨ |
| Custom Extractors | #[async_trait] required |
Native async traits β¨ |
| Optional Extractors | Manual handling | OptionalFromRequestParts β¨ |
| Connection Limiting | External | ListenerExt::limit_connections β¨ |
axum-full-course/
βββ Cargo.toml # Workspace manifest with shared dependencies
βββ README.md # This file
βββ .env.example # Environment variables template
βββ Dockerfile # Production Docker image
βββ docker-compose.yml # Local development stack
β
βββ module-01-intro/ # Each module is a separate crate
β βββ Cargo.toml
β βββ README.md # Module-specific instructions
β βββ src/main.rs
β
βββ module-02-routing/
βββ module-03-extractors/
βββ module-04-responses/
βββ module-05-state/
βββ module-06-middleware/
βββ module-07-errors/
βββ module-08-database/
βββ module-09-auth/
βββ module-10-advanced/
βββ module-11-testing/
βββ module-12-production/
Each module is self-contained and can be run independently:
# Module 01: Basic server (no dependencies)
cargo run -p module-01-intro
# Visit: http://localhost:3000
# Module 08: Requires PostgreSQL
cd module-08-database
docker-compose up -d postgres # Start PostgreSQL
cargo run -p module-08-database
# Visit: http://localhost:3000/users
# Module 10: WebSockets & SSE
cargo run -p module-10-advanced
# WebSocket: ws://localhost:3000/ws
# SSE: http://localhost:3000/sse# Start PostgreSQL for database modules
docker-compose up -d postgres
# Build production image
docker build -t axum-course .
# Run with Docker Compose (app + postgres)
docker-compose up# Run all tests
cargo test --workspace
# Run specific module tests
cargo test -p module-11-testing
# Run with output
cargo test --workspace -- --nocapture
# Run tests matching a name
cargo test health_checkCopy .env.example to .env and configure:
# Database (Module 08, 09)
DATABASE_URL=postgres://postgres:postgres@localhost:5432/axum_course
# JWT Authentication (Module 09)
JWT_SECRET=your-super-secret-key-change-in-production
# Server
RUST_LOG=info
HOST=0.0.0.0
PORT=3000Found a bug or want to improve the code?
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- πΊ YouTube - Aarambh Dev Hub
- π» GitHub - aarambh-darshan
- π¦ Twitter/X
- π¬ Discord Community
If this course helped you, consider:
- β Starring this repository
- πΊ Subscribing to the YouTube channel
- β Buy Me a Coffee
MIT License - feel free to use this code for learning and projects!
Made with β€οΈ by Aarambh Dev Hub for the Rust community π¦