We will create a full-fledged URL shortening service from scratch using Rust and the axum web framework. Starting with a bare Cargo project, we will gradually add support for an asynchronous runtime, HTTP routing, CLI configuration, request handlers, shared state management, and a domain-specific code type with base62 encoding.
Along the way, we will see how axum's extractor system works, how to safely share mutable state between asynchronous handlers using Arc<RwLock<T>>, and how to implement custom Serde serialization for domain-specific types. By the end, our service will accept URLs through a POST endpoint, generate compact short codes, store mappings in memory, and redirect visitors back to the original destination.