Scratch app for a rust web server.
b22067ed — Matthias Osswald 1 year, 2 months ago
Add future ideas.
4fd438ac — Matthias Osswald 1 year, 2 months ago
Add get route for single task.
0aab9595 — Matthias Osswald 1 year, 2 months ago
Run migrations on startup and refactore pooling function.


browse  log 



You can also use your local clone with git send-email.

#Scratch Backend


  • Router & Endpoints
  • DB, ORM & Migration -> Diesel/Async?
  • i18n Support
  • Login Handler
  • Logging


# run app in normal mode
cargo run
# run app with auto reload (on change)
# you will need to install cargo-watch
systemfd --no-pid -s http::3000 -- cargo watch -x run


cargo test


cargo build


Checkout: https://doc.rust-lang.org/cargo/guide/continuous-integration.html


Install the helper tool diesel_cli globally:

cargo install diesel_cli --no-default-features --features postgres

Possibly you will need to install further system pkgs like postgresql-libs to be able to compile.

#Setup DB

# adapt the connection string in your .env
diesel setup


Adding a migration:

diesel migration generate <migration name>
# then add your up.sql and down.sql files

Running / redo migrations:

diesel migration run
diesel migration redo


What could be interesting to look at and test within this project:

  • Paperclip to generate OpenAPI specs.
  • Implementing testing for all the routes and eventually DB.
  • Juniper for GraphQL endpoints.