• Stars
    star
    5,631
  • Rank 7,256 (Top 0.2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Code for "Zero To Production In Rust", a book on API development using Rust.

Zero To Production In 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.

Chapter snapshots

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:

Pre-requisites

You'll need to install:

There are also some OS-specific requirements.

Windows

cargo install -f cargo-binutils
rustup component add llvm-tools-preview
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres

Linux

# Ubuntu 
sudo apt-get install lld clang libssl-dev postgresql-client
# Arch 
sudo pacman -S lld clang postgresql
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres

MacOS

brew install michaeleisel/zld/zld
cargo install --version="~0.6" sqlx-cli --no-default-features --features rustls,postgres

How to build

Launch a (migrated) Postgres database via Docker:

./scripts/init_db.sh

Launch a Redis instance via Docker:

./scripts/init_redis.sh

Launch cargo:

cargo build

You 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

How to test

Launch a (migrated) Postgres database via Docker:

./scripts/init_db.sh

Launch a Redis instance via Docker:

./scripts/init_redis.sh

Launch cargo:

cargo test 

More Repositories

1

pavex

An easy-to-use Rust framework for building robust and performant APIs
Rust
1,707
star
2

cargo-chef

A cargo-subcommand to speed up Rust Docker builds using Docker layer caching.
Rust
1,706
star
3

build-your-own-jira-with-rust

A test-driven workshop to learn Rust building your own JIRA clone!
Rust
937
star
4

wiremock-rs

HTTP mocking to test Rust applications.
Rust
618
star
5

tracing-actix-web

Structured logging for actix-web applications.
Rust
229
star
6

ndarray-koans

Material for "ML Introduction to ndarray" workshop at RustFest 2019.
Jupyter Notebook
110
star
7

biscotti

A Rust library for managing HTTP cookies.
Rust
109
star
8

bunyan

A CLI to pretty print logs in bunyan format. A Rust port of the original JavaScript bunyan CLI.
Rust
92
star
9

tracing-bunyan-formatter

A Layer implementation for tokio-rs/tracing providing Bunyan formatting for events and spans.
Rust
82
star
10

cargo-px

A cargo subcommand that extends cargo's capabilities when it comes to code generation.
Rust
50
star
11

actix-web-flash-messages

A (flash) message framework for actix-web. A port to Rust of Django's message framework.
Rust
46
star
12

multipeek

An iterator adapter to peek at future elements without advancing the cursor of the underlying iterator.
Rust
26
star
13

clustering-benchmarks

Benchmarks `linfa` against `scikit-learn` on a clustering task.
Jupyter Notebook
25
star
14

tracing-panic

A custom panic hook to capture panic info in your telemetry pipeline
Rust
18
star
15

cargo-manifest

Fork to fix some serialization issues.
Rust
12
star
16

jlox-rs

A Rust version of the jlox interpreter from the "Crafting Interpreters" book.
Rust
9
star
17

cargo-like-utils

A collection of utils (shell, styling, locking) to write CLIs that behave similarly to `cargo`
Rust
5
star
18

pavex-project-template

A starter template for a new Pavex project
Rust
3
star
19

LukeMathWalker

2
star
20

reqwest-timeout-minimum-reproducible-example

Minimal reproducible example for a timeout issue with reqwest.
Rust
2
star
21

lukemathwalker.github.io

Personal website.
HTML
1
star
22

iaml-iwildcam2019

Python
1
star
23

tracing-min

Minimum example to reproduce core dump.
Rust
1
star
24

actix-web-minimal-error-example

A minimal reproducible example of issues with actix-web's error handling logic.
Rust
1
star