This is an exploration into Rust based on the series Zero To Production by Luca Palmieri.
This is a simple email newsletter delivery platform, using Postgres as its general DB, and Redis for auth tokens. Actual email sending is done by Postmark, but signing up for the newsletter and publishing a new newsletter issue is handled by this app.
This has authentication in place for all admin related tasks, e.g. sending a new newsletter issue. This also only sends emails to verified subscribers using confirmation links in the initial sign up email.
This is intended to be deployed on DigitalOcean using their app platform and the specification for this application is contained within spec.yaml. However, due to the limitations of this platform the Redis instance needs to be provisioned manually.
It is possible to run this locally as long as you have Docker installed. The following two commands should get you fully functioning Redis and Postgres instances your app instance can connect to.
./scripts/init_redis.sh
./scripts/init_db.sh
You can then run an app instance using cargo run
.
You may want to pipe the output to bunyan (or even bunyan-rs) to format the log output.
This app uses sqlx for its DB interactions, this means that to run tests you need access to a development db instance. However you can easily create one using ./scripts/init_db.sh
. You can now run tests using cargo test
.
I've also included a justfile with many commands I find useful during development, however this is mainly geared for use inside the included devcontainer. If you open this repo inside VSCode this devcontainer config should automatically be detected and VSCode will offer to reopen this repository inside the container.
I am not going to be maintaining this in a meaningful manner, and will purely use this as an experimentation platform for myself in the future.