Skip to content
Β 
Β 

Latest commit

Β 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ¦€ Axum 0.8 Full Course - Build Production REST APIs in Rust (2026)

Rust Axum License YouTube

Complete 12-module course covering Axum web framework from beginner to production-ready applications. Built for the YouTube tutorial series by Aarambh Dev Hub.

πŸ“Ί Watch on YouTube

οΏ½ Full Course Video: Coming Soon - Subscribe for notification!

�🎯 What You'll Learn

  • βœ… 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

πŸš€ Quick Start

# 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

πŸ“‹ Prerequisites

  • Rust 1.78+ installed (Install Rust)
  • Basic Rust knowledge (ownership, traits, async/await)
  • (Optional) Docker for database modules
  • (Optional) PostgreSQL for Modules 08-09

πŸ“š Course Modules

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

⚑ What's New in Axum 0.8

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 ✨

πŸ› οΈ Project Structure

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/

πŸ“ Running Individual Modules

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

🐳 Docker Setup

# 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

πŸ§ͺ Testing

# 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_check

οΏ½ Environment Variables

Copy .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=3000

πŸ“– Learning Resources

🀝 Contributing

Found a bug or want to improve the code?

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ’¬ Community

β˜• Support

If this course helped you, consider:

  • ⭐ Starring this repository
  • πŸ“Ί Subscribing to the YouTube channel
  • β˜• Buy Me a Coffee

πŸ“„ License

MIT License - feel free to use this code for learning and projects!


Made with ❀️ by Aarambh Dev Hub for the Rust community πŸ¦€

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages