Skip to content
Rust web template for modern web backend applications
Branch: master
Clone or download
Pull request Compare This branch is even with svenstaro:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
migrations
src
tests
.env.example
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md
diesel.toml
reset.sh
watch.sh

README.md

Rust Web Boilerplate

Build Status codecov dependency status lines of code license

About

This is a boilerplate project made using best practices for getting started quickly in a new project. I made this for myself but maybe it will help someone else. Pull requests and discussions on best practices welcome!

Development setup

Install a few external dependencies and make sure ~/.cargo/bin is in your $PATH:

cargo install diesel_cli
cargo install cargo-watch

Optionally if you want line coverage from your tests, install cargo-tarpaulin:

RUSTFLAGS="--cfg procmacro2_semver_exempt" cargo install --force cargo-tarpaulin

Copy .env.example to .env and update your application environment in this file.

Make sure you have a working local postgres setup. Your current user should be admin in your development postgres installation and it should use the "peer" or "trust" auth methods (see pg_hba.conf).

Now you can launch the watch.sh script which helps you quickly iterate. It will remove and recreate the DB and run the migrations and then the tests on all code changes.

./watch.sh

To get line coverage, do

cargo tarpaulin --ignore-tests
You can’t perform that action at this time.