aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 27a4714c3b81914e742509e77700f7fb1fb734de (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# A simple blog engine made with Rocket, Diesel and Bart

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.