Code for "Zero To Production In Rust", a book on API development using Rust.
Code for "Zero To Production In Rust", a book on API development using Rust.
Zero To Production In Rust is an opinionated introduction to backend development using Rust.
This repository serves as supplementary material for the book: it hosts several snapshots of the codebase for our email newsletter project as it evolves throughout the book.
The main branch shows the project at the end of the book.
You can browse the project at the end of previous chapters by switching to their dedicated branches:
You'll need to install:
There are also some OS-specific requirements.
cargo install -f cargo-binutils
rustup component add llvm-tools-previewcargo install --version="~0.7" sqlx-cli --no-default-features --features rustls,postgres# Ubuntu
sudo apt-get install lld clang libssl-dev postgresql-client
# Arch
sudo pacman -S lld clang postgresqlcargo install --version="~0.7" sqlx-cli --no-default-features --features rustls,postgresbrew install michaeleisel/zld/zldcargo install --version="~0.7" sqlx-cli --no-default-features --features rustls,postgresLaunch a (migrated) Postgres database via Docker:
./scripts/init_db.shLaunch a Redis instance via Docker:
./scripts/init_redis.shLaunch cargo:
cargo buildYou can now try with opening a browser on http://127.0.0.1:8000/login after
having launch the web server with cargo run.
There is a default admin account with password
everythinghastostartsomewhere. The available entrypoints are listed in
src/startup.rs
Launch a (migrated) Postgres database via Docker:
./scripts/init_db.shLaunch a Redis instance via Docker:
./scripts/init_redis.shLaunch cargo:
cargo test Digital Ocean sqlx migrate error - Chapter 5
Ebook readers only show the index up to chapter 3.8.3
update the lld linker path for Darwin
10.7.4.2 Deploy to Digital Ocean Fails
Cargo audit failing on config
sqlx offline issue
Chapter 7.3.8.1 : Unnecessary async modifier
10.2.5 `unknown username` won't be returned
Redirect to GET /admin/dashboard fails
newsletter::newsletter_creation_is_idempotent at the end of 11.8 does not actually work