Skip to content

Commit

Permalink
Merge pull request #2 from TimOrme/update_readme
Browse files Browse the repository at this point in the history
Update readme
  • Loading branch information
TimOrme authored Mar 19, 2023
2 parents 021345d + 6283e28 commit 8004067
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @TimOrme
102 changes: 100 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,104 @@ A simple Air Quality Index monitor, designed to work on the Raspberry Pi with th

## Installation

Requires [uhubctl](https://github.com/mvp/uhubctl) to be installed and on your PATH.

TODO: Instructions to pip install.
### Pre-Requisites

* Python 3.9+
* [uhubctl](https://github.com/mvp/uhubctl) must be installed and on your PATH.

### Install

```commandline
pip install aqimon
```

## Running Aqimon

Aqimon is a simple web server. To start with all the defaults, you can just run:

```commandline
aqimon
```

And then go to your browser at `http://{serveraddress}:8000/` to view the UI.

### Configure With Systemd

Generally, you'd want to run `Aqimon` as an always-on service, using `systemd`.

To do so, create a file at `/etc/systemd/system/aqimin.service` with the following contents:

```
[Unit]
Description=AQIMON
After=multi-user.target
[Service]
Type=simple
Restart=always
ExecStart=aqimon
[Install]
WantedBy=multi-user.target
```

And then run:

```commandline
sudo systemctl daemon-reload
sudo systemctl start aqimon
```

## Contributing

### Toolset

To start developing, you'll need to install the following tools:

* [Python 3.9+](https://www.python.org/) - For API Code
* [Elm 0.19](https://elm-lang.org/) - For client code
* [poetry](https://python-poetry.org/) - For python package management
* [justfile](https://github.com/casey/just) - For builds
* [elm-format](https://github.com/avh4/elm-format) - For auto-formatting elm code.

Optionally, we have [pre-commit](https://pre-commit.com/) hooks available as well. To install hooks, just run
`pre-commit install` and then linters and autoformatting will be applied automatically on commit.

### Quickstart

To build the project, and install all dev-dependencies, run:

```commandline
just build
```

To start the server in develop mode, run:

```commandline
poetry run aqimond
```

To compile elm changes, run:

```commandline
just compile_elm
```

To manually run lint checks on the code, run:

```commandline
just lint
```

To run auto-formatters, run:

```commandline
just format
```

### Submitting a PR

Master branch is locked, but you can open a PR on the repo. Build checks must pass, and changes approved by a code
owner, before merging.

9 changes: 7 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Compile client code
build:
cd elm && elm make src/Main.elm --optimize --output=../aqimon/static/elm.js
build: install_deps compile_elm

install_deps:
poetry install --no-root

compile_elm:
cd elm && elm make src/Main.elm --optimize --output=../aqimon/static/elm.js

# Lint code.
lint:
Expand Down

0 comments on commit 8004067

Please sign in to comment.