
Learn to set up a Rust Rocket web API by adding dependencies, defining routes, mounting them, enabling json, and wiring a Postgres pool via Rocket db pools with env vars.
Design and build rustacean endpoints in a rocket-based api, using serde json for serialization and deserialization. Implement get, create, update, delete with proper http status codes and robust error handling.
Design and implement a users and roles system with a pivot table to enable granular access control in a Rust web API, including migrations, models, and associations.
Create a create user command in a cli module with username and password. Include role codes and load db url from env for async Postgres connection via Tokio and repositories.
Implement a login endpoint in a rocket-based app, accepting json credentials payload (username and password), querying the user repository and verifying the password with Argon2 to return success or unauthorized.
Refactor the login flow by extracting a reusable auth module that verifies user credentials with Argon2. Generate a 128-character alphanumeric session token and enable reuse across routes and CLI.
Define role codes as enums to enable granular access control in a Rust web API, with admin, editor, and viewer roles implemented via diesel traits and FromStr.
Celebrate completing the Rust web APIs course as you recap endpoints, JSON, commands, CLIs, and database interactions with Postgres and Redis, while mastering tests and safe deployment.
Rust is a systems programming language which you can use to write applications with high performance. It is amazingly refreshing with a very helpful compiler who is your mentor since the very beginning.
Cargo is not only a package manager but also a build tool, a documentation generator and a lot more, making your every day managing Rust apps really easy.
It is no wonder that for these reasons, plus many more, Rust was voted as StackOverflow’s most loved and desired programming language, eight years in a row.
You have already spent a good amount of time developing web applications and you have a very good understanding of Rust.
You are beyond the point of simple, toy applications and you are ready to start doing some serious back-end web development and you are wondering whether Rust can be used for this purpose.
You are looking for a resource that has all you need in a single place.
Well, look no further! In this course i will show you how to create a complex, fully async web app in Rust that serves JSON APIs but also has a CLI interface at the same moment.
We will use the Rocket web framework along with the Diesel ORM to build Rest APIs with
- Authentication built-in (users and passwords)
- Redis as a cache storage
- Access management with roles
- Handling for datetime fields
- CLI commands
- Logging
- Automated API testing