Rust Web Skills

rust_web_logo.png

At Monday Morning Haskell, we try to emphasize the importance of the practical use of the functional languages we study. Our Real World Haskell Series does this for Haskell. But we've also done a decent amount of work on Rust, and this series is the culmination of that work! We'll go over some very similar topics like connecting to a database, creating a schema, and launching a web server, all in Rust! If you haven't worked much with Rust, you're probably better off reading our Rust Beginners Series.

Want to follow the code examples more closely? No problem! Take a look at our Rust Web Github repo! Each article will link you to the specific files you'll want to work with.

Part 1: Postgres

In the first part of our series, we'll learn a very basic library for connecting to a Postgresql database. This will still be a very manual process in that we'll mostly have to write our SQL by hand. But it will get us used to some Rust mechanics for communicating with an outside service.

Part 2: Diesel

Our application will only get so far if we have to write every SQL query by hand. In part 2 we'll examine a more sophisticated database library. With Diesel, we'll we able to define our schema more concretely. There will still be some manual SQL to create our tables, but our core query code will be much easier!

Part 3: Rocket

In this third part of the series, we'll step back from databases for a second and start exploring how to write a basic web server. We'll do this with the Rocket library, which has some pretty cool mechanics for defining our endpoints.

Part 4: CRUD Server

By this point, we've defined a schema with Diesel and defined some basic endpoints with Rocket. In part 4 of our series, we'll combine these two libraries together! We'll create endpoints that will expose a CRUD API for the "User" elements in our database. This will allow consumers of our server to access and modify information in our database!

Part 5: Authentication

In any web server, you don't want every user to access every endpoint. You want some kind of security and authentication guards. Rocket has a rich vocabulary of concepts that can help us with authentication. In this fifth part of the series we'll explore two different ways to authenticate endpoints on our server.

Part 6: Front-end Templates

In the final part of our Rust Web series, we'll explore how to add front-end templating to our server. This will make it easy for you to serve customized HTML to your users, including static assets like Javascript and CSS!

Primer: Rust Video Tutorial

This series introduces some more advanced Rust concepts and assumes a basic working knowledge of the Cargo utility. If you haven't worked much in Rust before though, you can take a look at our Rust Video Tutorial! It will teach you the basics of Rust's syntax and how to create and manage projects!