Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.46 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.46 KB

Ambi

Ambi is a Rust-based web service that presents a basic HTML5 + JavaScript frontend and an HTMX frontend to display real time ambient room conditions like temperature, humidity, pressure, air quality, dust concentration, etc. It uses the Rocket web framework + Server Sent Events (SSE) to push updates to the client with no page refresh needed.

Screenshot 2023-01-02 at 22 03 59

Non-Container Setup

  1. First install the DB ORM Diesel CLI, then proceed to setting up the Postgresql DB

Setting up the Postgresql DB:

DATABASE_URL=postgres://postgres:postgres@localhost/ambi_rs_dev diesel setup

Now run the DB migrations to complete prepping the DB:

DATABASE_URL=postgres://postgres:postgres@localhost/ambi_rs_dev diesel migration run

Set Up Git Hooks

The Ambi repository makes use of several Git hooks to ensure that code quality standards are met and consistent. To automatically configure these hooks for your local workspace, you can run the following:

./scripts/create-git-hooks

This will create symlinks to the Git hooks, preserving any hooks that you may have already configured.

Running

To run:

ROCKET_DATABASES='{ambi_rs_dev={url="postgres://postgres:postgres@localhost/ambi_rs_dev"}}' cargo run

Or with Docker:

docker compose up -d