Simple newsletter app, written in Rust.
Based on Luca Palmieri's awesome book with some improvements.
- Actix Documentation
- sqlx repo
- Serde docs
- reqwest
- env_logger docs
- log docs
- tracing docs -
tracing
is a framework for instrumenting Rust programs with context-aware, structured, event-based diagnostic information. - tracing_bunyan_formatter docs
- tracing_log docs
- secrecy docs
- tracing-actix-web
- cargo-chef
- validator
- fake
- quickcheck
- wiremock-rs
- Postmark API Reference - Sending a single email
Run the PostgreSQL container and apply the migration:
./scripts/init_db.sh
Start the app:
cargo run
Or, see Makefile
for make
commands.
./scripts/init_db.sh
TEST_LOG=true cargo test | bunyan
docker build --tag newsletter --file Dockerfile .
docker run -p 8000:8000 newsletter
# Check it is working:
curl -v http://127.0.0.1:8000/health_check
# Push image to the Docker Hub:
docker tag newsletter hazadus/rust-newsletter
docker push hazadus/rust-newsletter
Install sqlx-cli
:
# Note the version
cargo install --version=0.5.7 sqlx-cli --no-default-features --features postgres
# Check installation
sqlx --help
# Prepare offline DB data
cargo sqlx prepare -- --lib
# Check offline data
cargo sqlx prepare --check -- --bin newsletter
cargo install cargo-udeps
cargo +nightly udeps
cargo install bunyan
TEST_LOG=true cargo test | bunyan