https://github.com/nadeemb53/letter-rs
A newsletter with actix-web and sqlx-postgres
https://github.com/nadeemb53/letter-rs
actix-web newsletter postgresql rust sqlx tracing
Last synced: about 2 months ago
JSON representation
A newsletter with actix-web and sqlx-postgres
- Host: GitHub
- URL: https://github.com/nadeemb53/letter-rs
- Owner: nadeemb53
- Created: 2022-08-19T08:05:08.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-25T15:08:36.000Z (almost 3 years ago)
- Last Synced: 2025-03-29T05:41:24.219Z (2 months ago)
- Topics: actix-web, newsletter, postgresql, rust, sqlx, tracing
- Language: Rust
- Homepage:
- Size: 227 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Newsletter backend

Health check: [production](https://zero2prod-y3ywz.ondigitalocean.app/health_check)
## Pre-requisites
You'll need to install:
- [Rust](https://www.rust-lang.org/tools/install)
- [Docker](https://docs.docker.com/get-docker/)There are also some OS-specific requirements.
### Windows
```bash
cargo install -f cargo-binutils
rustup component add llvm-tools-preview
``````
cargo install --version=0.6.0 sqlx-cli --no-default-features --features postgres
```### Linux
```bash
# Ubuntu
sudo apt-get install lld clang libssl-dev postgresql-client
# Arch
sudo pacman -S lld clang postgresql
``````
cargo install --version=0.6.0 sqlx-cli --no-default-features --features postgres
```### MacOS
```bash
brew install michaeleisel/zld/zld
``````
cargo install --version=0.6.0 sqlx-cli --no-default-features --features postgres
```## How to build
Launch a (migrated) Postgres database via Docker:
```bash
./scripts/init_db.sh
```Launch a Redis instance via Docker:
```bash
./scripts/init_redis.sh
```Launch `cargo`:
```bash
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:
```bash
./scripts/init_db.sh
```Launch `cargo`:
```bash
cargo test
```