Learn the basics of web development using Axum, the popular Rust-based web development framework, and build a chatting app which is ready to deploy. This book will be an invaluable introduction to Axum and how to use it develop the backend and server along with a wide range of associated tools like WebSocket and SeaORM.
The book begins with an introduction to the Rust programming language and server development and then goes on to explore the basics of Axum. This is followed by detailed instructions on how to set up a server using Axum. The book then guides you through connecting to a database using SeaORM. After you have connected your backend to a database, you will learn about Tower Middleware and how to use it to create a JWT authentication layer for your application. The next portion of the book will instruct you in the use of WebSocket and how to implement concurrent WebSocket connections. The final chapter ties all the theories and examples of the preceding chapters together and helps you in building the capstone project of your own chatting app, putting all the skills you have learnt through the book to the test.
This book is the book you will need if you want to get started on Axum. It is packed full of useful tips and step-by-step instructions. In addition to the theoretical information, the chapters are supplemented by real-life examples of the use of the concepts as well as quizzes that you can use to test your understanding. By the end of the book you will not only have gained competence in Axum, but you will have gained confidence in using it for actual projects.
You Will Learn To:
• Use Axum to create the backend server for your own applications
• How to use SeaORM, which is also written in Rust, and Postgres for database layer of the server application
• Implement Axum in real-world scenarios
This Book is For
Beginners with a basic grasp of Rust or intermediate web developers interested in expanding their knowledge of Axum
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A hands-on, project-driven introduction to building Rust web backends with Axum, taking you from a quick Rust refresher through routing, extractors, state, SeaORM/Postgres, JWT middleware, and WebSockets to a deployable chat app. Best for Rust beginners with basic syntax knowledge or web developers curious about the Rust backend stack.
【Book Arc】
- **Opening (~0%–10%)**: Frames why Rust suits backend work (near-C/C++ performance with compile-time memory and thread safety), surveys the Rust web framework landscape, and sets up the toolchain—VSCode, PostgreSQL, DBeaver, and Insomnia—so later chapters run without friction.
- **Early (~10%–30%)**: A condensed Rust refresher (ownership, borrowing, traits, structs) for readers who need it, then the first Axum server: binding a TcpListener, choosing between localhost and 0.0.0.0, and testing with Insomnia.
- **Early–Middle (~30%–45%)**: Core Axum fundamentals—routing and method chaining, extractors for query params, JSON, multipart uploads, bytes/streaming, typed headers—plus response building with status codes and custom headers.
- **Middle (~45%–60%)**: Shared state management: why handlers shouldn't re-read config or open fresh DB connections, and how Arc/Mutex (and the std-vs-tokio Mutex choice) make state safely shareable across async handlers.
- **Late (~60%–85%)**: The database and security layer—SeaORM models and CRUD endpoints against Postgres, connection pooling and options, modularizing DB and API code, then Tower middleware for a JWT authentication layer.
- **Ending (~85%–100%)**: WebSockets, including concurrent connections, culminating in the capstone chat application that assembles routing, state, database, auth, and real-time messaging into something deployable.
【Key Takeaways】
- **Rust's pitch for servers is safety without a runtime tax** (Opening): the book grounds its framework choice in ownership's memory and thread safety guarantees, not just speed—useful context for justifying the stack to teammates.
- **Tooling is treated as part of the curriculum** (Early): Postgres, DBeaver, and Insomnia are installed and exercised early, so you learn to inspect APIs and databases rather than only write handlers.
- **Routing scales through chaining and grouping** (Early–Middle): repeated per-path route calls become unwieldy; chaining get/post/put/delete under one path and later splitting into modules keeps large routers maintainable.
- **Extractors are the workhorse of Axum handlers** (Middle): query, JSON, multipart, bytes/streaming, and typed headers each get concrete examples, including when to stream rather than buffer large payloads.
- **State management solves duplicated work across handlers** (Middle): sharing a single DB pool or config via Arc/Mutex—with attention to which Mutex fits async code—is presented as the default architecture, not an optimization.
- **Database access is structured, not ad hoc** (Late): SeaORM models, connection pooling, and separating DB from API modules show how to keep a growing backend organized before adding endpoints for categories and products.
- **Auth belongs in middleware** (Late): a JWT layer built with Tower middleware keeps authentication out of individual handlers, a pattern that pays off in the capstone.
- **The chat app is the integration test** (Ending): concurrent WebSockets plus everything prior forces you to confront how state, auth, and persistence interact in a real-time setting.
【Reading Tips】
- Skim the Rust refresher (ownership, traits) if you're already comfortable; deep-read the extractor and state chapters, since those patterns recur in every later example.
- Type out the Insomnia requests alongside the code—many lessons (status codes, multipart, headers) only click when you see the actual response.
- Treat the std-vs-tokio Mutex discussion and the State duplicate-field compile error as hard spots worth slowing down for; they're common real-world stumbling blocks.
- Read the capstone as a review pass: trace each earlier concept (routing, state, SeaORM, JWT, WebSocket) back to where it was introduced.
- Use the end-of-chapter quizzes as checkpoints before moving on; they flag gaps cheaply.
【Coverage Limits】
The excerpts cover the book's structure, early chapters, and mid-book Axum fundamentals in detail, but the SeaORM, JWT middleware, WebSocket, and capstone chapters are represented mainly through the table of contents and blurb; specifics of those implementations are not covered here.
Excerpt 1
• Implement Axum in real-world scenarios This Book is For Beginners with a basic grasp of Rust or intermediate web developers interested in expanding their k...
t syntax, feel free to skip this section. 1.5.1. Ownership Every program uses the computer resource called memory, which stores data used by the program. Whe...
.delete(|| async move { "Deleting..." }), Now, let’s consider paths like /api/users and /api/teams that share a common / api prefix. Figure 2-4. /api Path Wh...
point let mut data = my_mutex.lock().unwrap(); *data = 10; Combining the two types as Arc<Mutex> creates a type that’s shareable and modifiable across multip...
tes), binary (Bytes), and connection closure (CloseFrame). WebSocket is a bidirectional communication channel between client and server, serving as the condu...
r the following. FromRef is used so that each field can be extracted individually. use crate::entities::chat::Model as Chat; use axum::extract::FromRef; use...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
Beginning Axum Learning Modern Web Development With Rust (Indo Yoon)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share to WeChat Moments
Beginning Axum Learning Modern Web Development With Rust (Indo Yoon)(Z-Library)
Scan the QR code with WeChat to open this book
Tap the ··· menu in the top-right corner
Choose Share to Moments
You are already in WeChat. Tap ··· in the top-right corner and choose Share to Moments.
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
Beginning Axum Learning Modern Web Development With Rust (Indo Yoon)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment