Skip to content

A Rust-based IoT ambient room sensor web service (backend + frontend)

Notifications You must be signed in to change notification settings

eloyrobillard/ambi-rs

 
 

Repository files navigation

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

About

A Rust-based IoT ambient room sensor web service (backend + frontend)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 47.6%
  • HTML 20.7%
  • JavaScript 18.1%
  • PLpgSQL 9.5%
  • Dockerfile 3.1%
  • Shell 1.0%