This chapter gives a short introduction to why Rust is a solid tool for building all kinds of application, and a brief overview of the format and organization of the book.
● Introduction
● Why Rust?
● Who should read this book?
● Chapters overview
Chapter 2, Developing websites
This chapter will cover how to use popular web frameworks to build static and dynamic websites. We'll also touch how to build RESTful API and common requirements in web backend programming: database, authentication and authorization
● What are we going to build? (A web version of the cat breed dictionary, first a static site and then server-side rendering )
● Serving a static website
● Generate dynamic content with templates
● Fetching data from databases
● Authentication and authorization
● Summary
Chapter 3, REST APIs
● What are we going to build? (A web version of the cat breed dictionary, with a single-page app + REST API)
● Defining the API with Open API specification
● Building a static frontend with AJAX calls
● Building a RESTful API
● Serialize/Deserialize JSON
● Summary
Chapter 4, Chatting in realtime with WebSocket
This chapter will discuss how to build a WebSocket server that can power a real-time chat application in Rust
● What are we going to build? (A chat app for cats in people can send all kinds of cat noises)
● What is WebSocket
● Enabling two way communication
● Implementing the chat application
● Summary
Chapter 5, Going serverless
This chapter will demonstrate the benefit of serverless computing using AWS's experimental Rust support.
● What is serverless?
● What are we going to build? (Serverless version of Chapter 4)
● Pros and cons of serverless
● Setting up an AWS account
● Building a lambda function with Rust
● Exposing the API Gateway
● Cleaning it up
● Summary
Chapter 6, High performance web frontend using WebAssembly
This chapter will talk about how to compile Rust to WebAssembly and make it work together with JavaScript in the web frontend
● What is WebAssembly? (We'll implement the bottleneck of Book 1 Chapter 4 in WebAssembly to speed it up)
● What are we going to build?
● How to compile Rust to WebAssembly?
● Exposing Rust function to JavaScript
● Passing native data type between Rust and JavaScript
● Manipulating DOM from Rust
● Summary
Chapter 7, Advanced topics
This chapter will discuss other more advanced use of Rust. Each section will introduce one application, existing projects for that kind of application and their status. But we'll not go into the detail as the previous chapters.
● Web scraping/Web crawling
● Browser engine - Servo
● Conclusion
Shing Lyu is a software engineer who is passionate about open source software. He's been working on Rust professionally at Mozilla, on the Firefox (Gecko) and Servo browser engine project. Currently, he is working at DAZN, a sports streaming platform as a backend developer, with a focus on AWS and serverless technology. Shing has worked for many world famous brands like Mozilla, Booking, and Intel. And, he is also active in the open source community. Being one of the founders of the Taiwan Rust community, he loves to share his enthusiasm for Rust with people.
Go beyond the basics of Rust and build web and serverless cloud applications. The applications explained in this practical book include web sites, RESTful APIs, a real-time web chat application, and frontend application with WebAssembly. Each chapter is organized in the following format: what this kind of application looks like; requirements for the example program; an introduction to the Rust libraries used; step-by-step implementation of the example program, including common pitfalls and best practices; and a brief comparison of libraries and frameworks in the same domain.
This book will open your eyes to the world of practical web applications of Rust. After reading the book, you will be able to apply your Rust knowledge to build your own web projects.
You will:
Build dynamic websites with databases
Build RESTful APIs
Write a WebSocket server that can power a real-time chat app in Rust
Discover the benefits of serverless computing using Amazon Web Service's Rust support
Compile Rust to WebAssembly for high-performance frontend applications