Config API for home-automation-thermostat. It also interacts with home-automation-monitoring.
Based on rust-graphql-actix-juniper-diesel-example.
Install rust
and cargo
via rustup. The stable version is OK.
Optional: Cargo Watch (not required, but it speeds up development greatly)
cargo install cargo-watch
cargo install diesel_cli --no-default-features --features postgres
createdb -U postgres config
createdb -U postgres config_test
Access to a postgres instance is required. `
cargo run
or
cargo watch -x run
Open http://localhost:8080/playground.
cargo test
The following environment variables are required in an .env
file:
# general
PORT=
# postgres
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
# influx
INFLUXDB_HOST=
INFLUXDB_DB=
INFLUXDB_USERNAME=
INFLUXDB_PASSWORD=
# security
API_KEY=
docker volume create --name=home-automation-config-storage
docker-compose up