Skip to content

Commit

Permalink
docs: tidy readyme
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaringe committed Mar 24, 2023
1 parent 9007555 commit 1d8474f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
Binary file modified img/preview.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 31 additions & 9 deletions readme.md
Expand Up @@ -4,22 +4,26 @@

Host and view your [Awair data](https://www.getawair.com/) locally.

- store your Awair data in your own db
- access your Awair data from a self hosted web-app (grafana).
- **Store** Awair data in your own database
- **View** Awair data from a self hosted web-app (grafana).

<img alt="freshawair grafana" src="./img/preview.png" width="400" />
<img alt="freshawair grafana" src="./img/preview.png" width="600" />

## description

`freshawair` is three macro components

- `agent` - captures data from your awair and forwards it to your `server`
- `db` - [timescale db](https://www.timescale.com/) instance
- [grafana](https://grafana.com/)
- `agent` - captures data from your awair(s) and load data into the database
- `database` - [timescale db](https://www.timescale.com/) instance
- [grafana](https://grafana.com/) - visualize your data

## usage

At the current time, even though there are [docker images](https://hub.docker.com/repository/docker/cdaringe/freshawair) available.
`docker-compose -f docker-compose.yml -f docker-compose.prod.yml up`

`docker-compose` is the primary supported deployment mechanism. Services may be deployed independently as desired, but users will need to adopt the `docker-compose.yml` configurations into the alternative desired format.

The agent has a CLI with all options configurable via ENV or CLI args:

```sh
$ docker run --rm -it cdaringe/freshawair --help
Expand All @@ -36,12 +40,30 @@ Options:
-V, --version Print version
```

You can also use the UPPER_CASE vars as ENV vars to set values
Postgres/TimescaleDB & Grafana configuration is left to the user. Sensible
defaults are set in compose files.

### local builds

The only supported mechanism for building is following:
The only supported mechanism for _building_ is following:

- install [rad](https://github.com/cdaringe/rad#install)
- `./rad build`
- `docker-compose -f docker-compose.yml -f docker-compose.dev.yml up`
- visit grafana@[localhost:3000](https://localhost:3000) and select the prebuilt dashboard

See [rad.ts](./rad.ts) or run `rad --list` for various actions.

## Performance

Here are some typical CPU/Mem usage from the different components:

```sh
$ docker stats
NAME CPU % MEM USAGE / LIMIT
freshawair_freshagent_1 0.00% 2.355MiB / 5.641GiB
freshawair_grafana_1 0.05% 38.5MiB / 5.641GiB
freshawair_freshdb_1 0.01% 101.6MiB / 5.641GiB
```

Further tuning can be done to tweak the postgres & grafana runtime characteristics.

0 comments on commit 1d8474f

Please sign in to comment.