MCPcopy Index your code
hub / github.com/LukeMathWalker/zero-to-production

github.com/LukeMathWalker/zero-to-production @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
186 symbols 393 edges 46 files 13 documented · 7%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.7" 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.7" sqlx-cli --no-default-features --features rustls,postgres

MacOS

brew install michaeleisel/zld/zld
cargo install --version="~0.7" 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 

Core symbols most depended-on inside this repo

spawn_app
called by 25
tests/api/helpers.rs
assert_is_redirect_to
called by 19
tests/api/helpers.rs
post_subscriptions
called by 10
tests/api/helpers.rs
see_other
called by 8
src/utils.rs
content
called by 8
src/email_client.rs
post_login
called by 7
tests/api/helpers.rs
post_publish_newsletter
called by 7
tests/api/helpers.rs
send_email
called by 6
src/email_client.rs

Shape

Function 98
Method 52
Class 29
Enum 7

Languages

Rust100%

Modules by API surface

tests/api/helpers.rs23 symbols
src/email_client.rs14 symbols
src/routes/subscriptions.rs13 symbols
src/configuration.rs12 symbols
src/domain/subscriber_email.rs10 symbols
src/domain/subscriber_name.rs9 symbols
tests/api/newsletter.rs8 symbols
src/startup.rs8 symbols
src/issue_delivery_worker.rs8 symbols
tests/api/subscriptions.rs7 symbols
src/routes/subscriptions_confirm.rs7 symbols
src/authentication/password.rs7 symbols

For agents

$ claude mcp add zero-to-production \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact