Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jim-hodapp-coaching/ambi-rs
A Rust-based IoT ambient room sensor web service (backend + frontend)
https://github.com/jim-hodapp-coaching/ambi-rs
htmx rust rust-lang web-application
Last synced: about 10 hours ago
JSON representation
A Rust-based IoT ambient room sensor web service (backend + frontend)
- Host: GitHub
- URL: https://github.com/jim-hodapp-coaching/ambi-rs
- Owner: Jim-Hodapp-Coaching
- Created: 2022-06-17T01:18:01.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-27T15:21:20.000Z (about 1 year ago)
- Last Synced: 2023-09-28T02:42:14.901Z (about 1 year ago)
- Topics: htmx, rust, rust-lang, web-application
- Language: Rust
- Homepage:
- Size: 42 KB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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.
## Non-Container Setup
1. First [install the DB ORM Diesel CLI](https://diesel.rs/guides/getting-started), then proceed to setting up the Postgresql DB
Setting up the Postgresql DB:
```sh
DATABASE_URL=postgres://postgres:postgres@localhost/ambi_rs_dev diesel setup
```Now run the DB migrations to complete prepping the DB:
```sh
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:
``` sh
./scripts/create-git-hooks
```This will create symlinks to the Git hooks, preserving any hooks that you may have already configured.
## Running
To run:
```sh
ROCKET_DATABASES='{ambi_rs_dev={url="postgres://postgres:postgres@localhost/ambi_rs_dev"}}' cargo run
```Or with Docker:
```sh
docker compose up -d
```