• Stars
    star
    4,406
  • Rank 9,311 (Top 0.2 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created over 3 years ago
  • Updated 2 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

cargo-chef

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

pavex

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

build-your-own-jira-with-rust

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

wiremock-rs

HTTP mocking to test Rust applications.
Rust
575
star
5

tracing-actix-web

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

ndarray-koans

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

biscotti

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

bunyan

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

tracing-bunyan-formatter

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

cargo-px

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

actix-web-flash-messages

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

clustering-benchmarks

Benchmarks `linfa` against `scikit-learn` on a clustering task.
Jupyter Notebook
23
star
13

multipeek

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

linfa-python

Python bindings for Rust's linfa crate.
Python
13
star
15

cargo-manifest

Fork to fix some serialization issues.
Rust
12
star
16

tracing-panic

A custom panic hook to capture panic info in your telemetry pipeline
Rust
11
star
17

jlox-rs

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

cargo-like-utils

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

pavex-project-template

A starter template for a new Pavex project
Rust
3
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

LukeMathWalker

1
star
24

tracing-min

Minimum example to reproduce core dump.
Rust
1
star
25

actix-web-minimal-error-example

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