From 4e960f65ac0a9fb10aa89664b067ba501b90100d Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 17 Dec 2017 21:14:45 +0100 Subject: Update README --- README.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/README.md b/README.md index a6f35a5..27a4714 100644 --- a/README.md +++ b/README.md @@ -2,4 +2,39 @@ This is essentially a toy project to learn [Rocket](https://rocket.rs) and [Diesel](https://diesel.rs). Also I'm using [Bart](https://crates.io/crates/bart) for templates, because it seemed simple, and I like the name. +## Getting started + +First make sure you have PostgreSQL installed. We don't support any other database engine for now. You also need the nightly Rust compiler for now. To set the current project to use the nightly compiler, run: + + % rustup override nightly + +Then add a database url into a `.env`-file that is to be located in the root of the source directory: + + % echo DATABASE_URL=postgres://dbuser:password@localhost/dbname > .env + +Then create the user and database specified above: + + % createuser -U postgres --createdb --login -P dbuser + % createdb -U dbuser dbname -T template0 + +Replace `dbuser`, `dbname` and `password` with values that makes sense to you. You will be prompted for the password when creating the user. + +Next install `diesel_cli`: + + % cargo install diesel_cli + +Then run the diesel setup to create the database and run the migrations: + + % ~/.cargo/bin/diesel setup + +Check that everything is working: + + % cargo test + +Run the engine: + + % cargo run + +## License + This project is provided as free software under the GNU AGPL v3, see LICENSE for details. -- cgit v1.2.3