Udemy

Creating an API server in Rust with Rocket, SeaORM and JWT

Enroll Now
  • 386 Students
  • Updated 5/2023
4.5
(44 Ratings)
CTgoodjobs selects quality courses to enhance professionals' competitiveness. By purchasing courses through links on our site, we may receive an affiliate commission.

Course Information

Registration period
Year-round Recruitment
Course Level
Study Mode
Duration
1 Hour(s) 50 Minute(s)
Language
English
Taught by
Afaan Bilal
Rating
4.5
(44 Ratings)

Course Overview

Creating an API server in Rust with Rocket, SeaORM and JWT

Build your own REST API server with the safety and performance of Rust using Rocket, SeaORM and JWT authentication.

In this course, we'll create a REST API server in Rust to represent a bookstore. This bookstore would allow us to add books and authors.


Using this system, we'll be able to:

  • Create, list, update and delete authors

  • Create, list, update and delete books

  • Associate and disassociate books and authors

  • List all books by a particular author


We'll learn how to:

  • Create a new Rust project using cargo

  • Build and run our Rust project

  • Add crates and enable crate features


We'll learn about basic API concepts such:

  • Routing and HTTP methods

  • Extracting data from HTTP requests

  • Interacting with the database to query and insert data

  • Creating user accounts

  • Authentication using JWT

  • Creating and using relationships between models to query and list associated data


Along with these concepts, we'll learn how to:

  • Handle incoming (request) and outgoing (response) data in a type safe way

  • Handle CORS

  • Create and run database migrations

  • Create one-to-many database relationships

  • Create entities from database tables


We'll have a bonus lecture at the end to learn how to Dockerize our API server to deploy and run it anywhere.


We'll be using the following crates:

  1. Rocket: a web framework for Rust that makes it simple to write fast, secure web applications without sacrificing flexibility, usability, or type safety.

  2. SeaORM: is a relational ORM to help you build web services in Rust.

  3. jsonwebtoken to create and decode JWTs in a strongly typed way.

  4. serde_json for serializing and deserializing Rust data structures efficiently and generically.


Course Content

  • 8 section(s)
  • 43 lecture(s)
  • Section 1 Introduction
  • Section 2 Rocket: The web framework
  • Section 3 SeaORM: Interacting with the database
  • Section 4 REST API
  • Section 5 Working with Rocket
  • Section 6 Authentication and Sign Up
  • Section 7 Implementing Controllers
  • Section 8 Conclusion

What You’ll Learn

  • Create a Rust project
  • Create a REST API server using Rocket
  • Interacting with a database using SeaORM
  • Authenticating APIs using JWT
  • Writing database migrations using SeaORM CLI


Reviews

  • A
    Anders Sørensen
    2.0

    Just coding No explaintion of why and what could go wrong and how to fix issues that might come

  • R
    Ryan Morales
    5.0

    Nice code and good editing

  • J
    Jefri Tambunan
    3.0

    all course is great but i hope there is also support to upload pictures, multi threads to do multi task at once..

  • A
    Aliaksei Ivanouski
    5.0

    I wanted to take a moment to thank you for the excellent course. It provided a clear, structured approach to building REST API services with Rust. I really appreciate the effort you put into it! It is highly recommended to anyone with experience building similar services in other languages who wants to learn Rust and its frameworks.

Start FollowingSee all

We use cookies to enhance your experience on our website. Please read and confirm your agreement to our Privacy Policy and Terms and Conditions before continue to browse our website.

Read and Agreed