We may earn an affiliate commission when you visit our partners.
Paris Liakos

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.

Read more

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 are a web developer who wants to use Rust and is looking for a resource to guide you through the currently available tools and the surrounding ecosystem.

Well, look no further. In this course we will experience how easy and straight forward creating a web application with Rust is. We will create routes, endpoints, set up authorization, handle databases and feed our clients with JSON. We will use tools such as the Rocket framework and the Diesel ORM. The authorization will be a simple Basic authorization.

In the end we will have a fully functioning We will also deploy this application behind an nginx webserver which will also handle the SSL negotiation, making our app served in a secured way under HTTPS. (requires an existing webserver and domain)

Jump abroad.

Enroll now

What's inside

Learning objectives

  • Building and deploying a rocket rest api
  • Implementing basic authentication for a rocket rest api
  • How basic crud with diesel orm works
  • Serializing and deserializing rust structs with serde

Syllabus

A few words about me, the lesson and the tools we will use.
Introduction
Visual Studio Code setup
Gitlab repository
Read more
After this section you will be able to create your own endpoints which return some text or, even better some JSON!
Hello world!
JSON
CRUD routes
Route matching
Error catchers
We will check Rocket's request guards and how to implement our custom request validators
Basic auth intro
Implementing a basic auth guard
Error catcher for unauthorized
Cleanup
Making our authorisation guard more robust
Communicating with the database using the Diesel ORM. CRUD and migrations

What is Diesel and its CLI tool.

Specifying r2d2 and diesel dependencies along with rocket support.

Creating our first model and doing our first query

Connecting our create endpoint to the database

Error catcher for unprocessable entity

Implementing DB queries for the rest of our endpoints

Creating reusable database related functions with repositories.

Handling errors gracefully without panicking

Validation for delete route

We will make deploying easier by putting migrations in our binary

Compiling our application, changing the configuration and setting up the web server

Configuring rocket for production and then compiling our binary for production.

Installing nginx and setting a reverse proxy which serves our rocket application. Securing our application with SSL.

Outro

Goodbye!

Good to know

Know what's good
, what to watch for
, and possible dealbreakers
Uses Rust, which is StackOverflow’s most loved and desired programming language, making it a potentially valuable skill for developers
Teaches how to deploy the application behind an nginx webserver, which is a common practice for securing web applications with SSL
Employs tools such as the Rocket framework and the Diesel ORM, which are helpful for building web applications with Rust
Requires an existing webserver and domain, which may pose a barrier for some learners without prior experience or resources
Implements basic CRUD operations with Diesel ORM, which are fundamental skills for building data-driven web applications
Focuses on basic authorization, which may not be sufficient for production environments requiring more robust security measures

Save this course

Save Building web APIs with Rust (beginners) to your list so you can find it easily later:
Save

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Building web APIs with Rust (beginners) with these activities:
Review Basic HTTP Concepts
Reinforce your understanding of HTTP fundamentals before diving into building web APIs. A solid grasp of HTTP is crucial for understanding how web APIs function.
Browse courses on HTTP Methods
Show steps
  • Read articles or watch videos explaining HTTP methods (GET, POST, PUT, DELETE).
  • Familiarize yourself with common HTTP status codes and their meanings.
  • Review the purpose of HTTP headers and their common use cases.
Read 'The Rust Programming Language'
Use this book as a reference to deepen your understanding of Rust concepts. It's a comprehensive resource that complements the course material.
Show steps
  • Read the chapters relevant to the course topics, such as ownership, borrowing, and error handling.
  • Refer to the book when you encounter unfamiliar Rust syntax or concepts.
Build a Simple CRUD API
Apply your knowledge by building a small CRUD API using Rust and a framework like Rocket. This hands-on experience will solidify your understanding of the concepts covered in the course.
Show steps
  • Choose a simple data model (e.g., a to-do list or a book library).
  • Set up a new Rust project with Rocket and a database (e.g., SQLite).
  • Implement the CRUD operations (Create, Read, Update, Delete) for your data model.
  • Test your API endpoints using a tool like curl or Postman.
Three other activities
Expand to see all activities and additional details
Show all six activities
Document Your API Project
Improve your understanding and communication skills by documenting your API project. This will help you solidify your knowledge and share it with others.
Show steps
  • Write a README file explaining the purpose of your API and how to use it.
  • Document each API endpoint with its input parameters, output format, and example usage.
  • Create a diagram illustrating the architecture of your API.
Contribute to a Rust Web API Library
Deepen your understanding of Rust web APIs by contributing to an open-source project. This will expose you to real-world code and best practices.
Show steps
  • Find a Rust web API library on GitHub that you're interested in.
  • Read the library's documentation and code to understand its architecture and functionality.
  • Identify a bug or feature that you can contribute to.
  • Submit a pull request with your changes.
Read 'Zero To Production In Rust'
Use this book to learn about best practices for building and deploying production-ready Rust web APIs. It covers topics such as testing, deployment, and monitoring.
Show steps
  • Read the chapters relevant to deployment and production considerations.
  • Implement the book's recommendations in your own API projects.

Career center

Learners who complete Building web APIs with Rust (beginners) will develop knowledge and skills that may be useful to these careers:
API Developer
An API Developer designs, develops, and implements application programming interfaces. The course's curriculum, centered on building REST APIs with Rust, is profoundly relevant for any aspiring API Developer. The course covers essential skills like designing routes and endpoints, handling data serialization with Serde, and implementing basic authentication, all of which are crucial for developing functional and secure APIs. This course is of great value to anyone aiming to master the creation of web APIs, because it also introduces important concepts such as error handling and database communication using an ORM.
Backend Engineer
A Backend Engineer develops and maintains the server-side logic and databases that power applications. This course, which covers building and deploying a REST API using Rust, directly aligns with the responsibilities of a Backend Engineer. The course's focus on creating routes, handling databases with Diesel ORM, and implementing authorization provides a practical foundation for building robust and secure backend systems. Learning how to serialize and deserialize data with Serde, as taught in the course, also helps a Backend Engineer work with APIs efficiently. This course provides a useful starting point for those seeking to become a Backend Engineer.
Web Developer
A Web Developer creates and maintains websites and web applications, often handling both front-end and back-end tasks. This course will help a Web Developer gain experience in back-end development using Rust to create web applications. The course covers critical tasks, such as setting up routes and endpoints, database handling, and basic authentication that are essential for building robust, scalable web applications. Additionally, deploying the application behind an nginx web server, as taught in the course, prepares developers for real-world scenarios. This course provides a good bridge for Web Developers wishing to broaden their expertise into back-end development with Rust.
Software Developer
A Software Developer is involved in the entire lifecycle of software development, which includes design, implementation, and testing of software applications. This course helps a Software Developer learn how to build web applications with Rust, a language known for high performance. Skills such as setting up routes and endpoints, and working with databases using an ORM, are essential for software development. The course provides hands-on experience in building a deployable application, which is a key part of the software development process. Any Software Developer who wants to learn a new programming language will find this course useful.
Full-Stack Developer
A Full Stack Developer works on both the front-end and back-end aspects of applications and websites. This course equips a Full Stack Developer with the skills to handle back-end tasks using Rust. By learning how to build APIs, manage databases with Diesel ORM, and implement authentication, a Full Stack Developer can enhance their capabilities in creating web applications. The course also covers deployment of applications, providing a complete cycle of the application development process. A Full Stack Developer benefits greatly by expanding their toolset using this course.
Systems Programmer
A Systems Programmer works on low-level software and operating systems. This course, focusing on building web APIs with Rust, a systems programming language, provides a relevant skill set for a Systems Programmer who also wants to work on web applications. This course helps a Systems Programmer by familiarizing them with tools like the Rocket framework and the Diesel ORM. This course may be useful for a Systems Programmer looking to expand their skills into web development, and apply their low-level knowledge to high-performance web services.
Technical Lead
A Technical Lead guides a development team, sets technical direction, and ensures project success. Understanding the technologies and methodologies used by their team members is important. Since this course shows how to build web APIs using Rust, a Technical Lead who wishes to understand their team's workflow and gain hands-on experience with web backend development can benefit from this course. Furthermore, the course covers topics such as database interactions and deployment, which is highly relevant for the work a Technical Lead would oversee.
DevOps Engineer
A DevOps Engineer focuses on automating and streamlining the process of software development and deployment. This course, which includes deploying a Rust application behind an nginx web server, is directly relevant to the responsibilities of a DevOps Engineer. Deploying applications, including managing configurations and setting up reverse proxies and SSL, are typical tasks for a DevOps Engineer. This course provides hands-on experience with these typical tasks, and therefore can help a DevOps Engineer who wishes to gain practical experience with application deployment.
Cloud Engineer
A Cloud Engineer designs, manages, and maintains cloud infrastructure and services. This course may be useful for a Cloud Engineer looking to expand their knowledge of back-end web application development and deployment. Although the course does not focus specifically on cloud platforms, a Cloud Engineer will benefit from its emphasis on deploying applications and configuring web servers like nginx. The skills acquired such as building and deploying REST APIs, can be valuable for managing and deploying cloud-based applications. This course can provide useful practical experience for a Cloud Engineer.
Database Administrator
A Database Administrator manages and maintains databases to ensure their availability and performance. The course's focus on interacting with databases using the Diesel ORM may be useful for a Database Administrator who wants to understand how applications interact with their databases. While the course does not cover database administration or SQL optimization, it provides practical experience on setting up database connections, performing CRUD operations, and writing migrations. This course helps a Database Administrator understand the application's perspective on database interaction.
Software Architect
A Software Architect designs the high-level structure of software systems, making key decisions on technology and frameworks. This course teaches how to build web APIs using Rust, and a Software Architect can benefit from becoming familiar with modern tools and frameworks for back-end development. A Software Architect who is involved in the design of systems that involve REST APIs can especially benefit from gaining firsthand experience with the implementation of these systems. The skills gained in the course will allow a Software Architect to make technology choices from a hands-on perspective.
API Security Specialist
An API Security Specialist focuses on securing APIs against vulnerabilities and threats. The course emphasizes implementing basic authentication using request guards and handling authorization, which are crucial for API security. An API Security Specialist will find the course useful for understanding implementation details of authentication, and how to handle unauthorized access. While the course covers only basic authentication, it may be useful for an API Security Specialist to take this course. It would allow them to gain insights into security implementations at a practical level.
Solutions Architect
A Solutions Architect designs and plans solutions that meet specific business needs. The course can be valuable for a Solutions Architect who is responsible for designing systems that incorporate web APIs. This course will provide valuable insight into the creation and deployment of a REST API using the Rust programming language. Gaining practical experience on these technologies would assist a solution architect in designing effective solutions from a technical perspective. This course may be useful for expanding a Solutions Architect's knowledge when making solution decisions.
Technical Consultant
A Technical Consultant advises clients on how to use technology to meet their business objectives. This course will help a Technical Consultant who needs to advise clients on web application development and API technologies. By understanding the practical aspects of backend web application development, they can provide more informed advice. The skills gained from the course, such as building APIs, database interactions, and deployments, are valuable for a Technical Consultant. This course may help a Technical Consultant better serve their clients.
Project Manager
A Project Manager leads and oversees projects, ensuring they are completed on time. The course will help a Project Manager understand the core technologies involved when managing a project which includes developing web APIs. While a Project Manager might not engage directly with development, they will become more effective at their role through an understanding of the technologies and processes involved. Since this course provides insights into many phases of the software development lifecycle, it may be useful for a Project Manager working on API-heavy software development.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Building web APIs with Rust (beginners).
Is the official guide to learning Rust. It covers all the core concepts of the language in detail, from basic syntax to advanced topics like concurrency and memory management. It is highly recommended as a reference throughout the course. It provides a solid foundation for understanding the Rust code used in web API development.
Focuses on building and deploying production-ready web applications with Rust. It covers topics such as testing, deployment, and monitoring. It valuable resource for learning how to build robust and scalable web APIs. It provides practical guidance on deploying Rust web APIs to production environments.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser