/dvaultd-rust

experimenting rust with actix (Hello world app)

Primary LanguageRust

dvaultd

This repository is meant for experimenting rust with actix and bunch of other stuff

away from the official docs for rust and the crates I used, I found those helpful

  1. YouTube video Rust Crash Course | Rustlang
  2. YouTube video Rust Concurrency Explained
  3. blog post series (I read part 1 only 😃) AUTH WEB MICROSERVICE WITH RUST USING ACTIX-WEB - COMPLETE TUTORIAL PART 1
  4. YouTube video Traits and You: A Deep Dive — Nell Shamrell-Harrington
  5. YouTube video Learning Rust: Memory, Ownership and Borrowing
  6. blog post A Basic Web Application with Rust and Actix-web
  7. stackoverflow question How to use MongoDB with r2d2 and actix in rust

Development

assuming that you've postgres server up and running with user eq postgres and passowrd eq docker, you only need to run cargo run to start the app after ensuring diesel steps

  Replace the cmd in the tutorial by
  `sudo docker run --rm   --name pg-docker -e POSTGRES_PASSWORD=docker -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data  postgres`

  And To kill local pg instance, if exists
  sudo lsof -i :5432 # get pid
  sudo kill {pid} # kill pg
  1. cargo install diesel_cli
  2. diesel setup
  3. diesel migration run

to simply add crates from the terminal

  1. cargo install cargo-edit
  2. cargo add {crate_name}
  1. cargo install cargo-watch
  2. cargo watch -x run runs "cargo" and rebuild files on change