-
Install Rust
-
rustup component add rustfmt clippy
-
Clone and change directory into this repo
-
Install pre-commit hooks
- Install Python and pip
- Install pre-commit package:
pip install pre-commit pre-commit install
-
Run:
cp .env.example .env
and fill the env variables
-
Install Docker and Docker Compose
-
Start the services:
docker-compose up
-
To generate migrations or run any command on the rust container, prefix it with
docker-compose exec server
like so:docker-compose exec server diesel migration generate <migration-name>
-
Install PostgreSQL
-
Install diesel_cli:
cargo install diesel_cli --no-default-features --features postgres
-
Install cargo-watch for hot reload (optional):
cargo install cargo-watch
-
To run migrations,
diesel migration run
-
Run:
cargo watch -i logs -x run
to start the server with hot reload, otherwise
cargo run
Seed the dummy data using:
psql -U aot --set ON_ERROR_STOP=on < dummy_data.sql
For docker, prefix the above command with docker-compose exec -T db
-
Run:
cp .env.example .env
and fill the env variables
-
Start the services:
./prod-run.sh up
and build the images again with
./prod-run.sh up build
-
Down the services:
./prod-run.sh down
-
Logs for the services:
./prod-run.sh logs
You can attach to containers with:
docker attach <container-name>