Further Exploration & Next Steps

1. Welcome and Icebreaker:

What advanced web feature or technology are you most interested in learning next?

2. Outline the Session:

Agenda:

  1. Concept Explanation: Review and explore advanced Axum/web topics.
  2. Live Coding: Briefly introduce an advanced topic (e.g., multipart forms, OAuth, gRPC).
  3. Tasks: Plan your next project or deep dive.

Learning Outcomes:

  • Review challenging topics from the course.
  • Explore advanced Axum/web features.
  • Plan your next learning steps.

Expectations: Pick a topic to explore further and set a goal for your next project!

3. Concept Explanation:

After mastering the basics, you can explore advanced topics like multipart forms, OAuth integration, gRPC with Tonic, configuration management, or deployment strategies (e.g., Docker). Choose one to dive deeper!

4. Live Coding Demonstration:

// Example: Multipart form handler
use axum::{extract::Multipart, http::StatusCode, Router, routing::post};

async fn upload(mut multipart: Multipart) -> Result<(), StatusCode> {
    while let Some(field) = multipart.next_field().await.map_err(|_| StatusCode::BAD_REQUEST)? {
        let name = field.name().unwrap_or("unnamed").to_owned();
        let data = field.bytes().await.map_err(|_| StatusCode::BAD_REQUEST)?;
        println!("Received field {} ({} bytes)", name, data.len());
    }
    Ok(())
}

#[tokio::main]
async fn main() {
    let app = Router::new().route("/upload", post(upload));
    let listener = tokio::net::TcpListener::bind("127.0.0.1:3000").await.unwrap();
    axum::serve(listener, app).await.unwrap();
}

Enable axum = { version = "0.8", features = ["multipart"] }. field.bytes() buffers an entire field in memory; for real uploads, enforce size limits and stream large files instead.

Best Practices:

  • Keep learning and experimenting with new features.
  • Plan and document your next project.

Common Pitfalls:

  • Not applying what you’ve learned to real projects.
  • Getting stuck in “tutorial hell”—build something real!

5. Tasks

  • Pick an advanced topic to explore (e.g., OAuth, gRPC, Docker).
  • Plan and outline your next Axum project.
  • Share your progress and ask for feedback from the community.