
Discover building web APIs with Rust, focusing on back-end development, framework choices like Hyper, Actix, and Rocket, plus Diesel with Redis for storage and caching.
Initialize a Rust web API binary with cargo init, then configure a Docker Compose dev stack with Postgres and Redis, Diesel CLI, and Cargo Watch for live builds.
Define your database schema with diesel migrations, create rustaceans and crates tables, and build corresponding Rust models for querying and inserting data using diesel and chrono.
Learn to structure data access by creating a repositories module with entity repositories that implement full CRUD via async Diesel, using a pg connection and chrono support.
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.
Define and expose crate CRUD endpoints with rocket, mirroring rustaceans, including get crates, view, create, update, and delete, with serialize/deserialize and automated tests.
Write integration tests for rust web APIs using a blocking reqwest client, covering rustacean endpoints (get, create, view, update, delete) with setup and cleanup utilities.
Tests crate endpoint creation, viewing, updating, and deletion in a Rust web API, with a Rust-agnostic testing harness, logging, and Postgres-backed validation.
Improve debugging by logging database errors to rocket logs, implement a reusable server_error wrapper, and extend tests for crate updates and rustacean changes.
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.
Learn to build a Rust clap-based command line interface for user management, exposing create, list, and delete commands with username, password, email, and roles, and manage multiple binaries.
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.
Assigns role codes to newly created users by checking existing roles, creating missing ones, and linking them through user roles in Rust repositories with robust error handling and database queries.
List users with their roles in a Rust CLI using Diesel and inner joins. Delete users safely by removing related user_roles first and parsing ids with clap value_parser.
Learn to secure a Rust web API by hashing passwords with Argon2id, generating OS-backed salts, and storing password hashes safely in a CLI workflow.
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.
Set up a Redis-backed token store in a Rust Rocket API using Deadpool Redis pools and a Redis fairing. Map tokens to user IDs and enable expiry via Redis queries.
Build a Redis-backed login flow by storing a session token with expiry under a sessions/{id} key, returning a json token and handling unauthorized errors.
Make routes private by enforcing a bearer token via a rocket request guard, mapping session ids with redis to users and protecting api endpoints.
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.
implement role-based access levels for rust web apis, securing create, update, and delete endpoints for editors or admins with a request guard and proper role checks.
Build an html email sender in Rust using tera templates and lettre, implementing a digest cli that fetches crates since a given hours window and emails daily digests via smtp.
Learn to build a reusable html mailer module for Rust web APIs, integrating SMTP with lettre, tera templates, and environment-driven credentials, and expose it to endpoints via a request guard.
enable cors for a json api by attaching a rocket fairing that injects access control headers on every response and handles preflight options requests.
Implement a /me endpoint in a Rust web API to return the current user's id, username, and created_at while omitting the password, using authorization and JSON serialization, with tests.
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