Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jkachmar/einfluss
Insert payloads from The Things Network into InfluxDB with PureScript
https://github.com/jkachmar/einfluss
Last synced: 28 days ago
JSON representation
Insert payloads from The Things Network into InfluxDB with PureScript
- Host: GitHub
- URL: https://github.com/jkachmar/einfluss
- Owner: jkachmar
- License: mit
- Created: 2017-07-24T04:53:52.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-09-20T18:19:44.000Z (over 7 years ago)
- Last Synced: 2024-11-07T04:49:36.645Z (3 months ago)
- Language: PureScript
- Size: 11.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Einfluss
A small application that transforms JSON payloads posted from
[The Things Network]'s [HTTP integration] into the [InfluxDB] line protocol, and
attempts to insert them into a provided InfluxDB database.## Install, Build, & Run
Clone this repository
git clone [email protected]:jkachmar/einfluss.git
Ensure that [yarn], [purescript], [pulp], and [bower] are installed
npm install --global yarn purescript pulp bower
Install dependenciesyarn install
Build the project
yarn build
Ensure that the environment variables in `.env.example` are set in your local
environment.Ensure the following environment variables are set:
- `DB_HOST`, `DB_NAME`, `DB_PORT`, `DB_USER`, `DB_PASS` with the appropriate
[InfluxDB] connection info
- `ENV` to either `Development` or `Production` (default to `Development`, which
assumes a local [InfluxDB] instance, default `root` username and password, and
an existing database called `einfluss`
- `PORT` to the port to serve this API on (defaulting to `8080`)Start the server
yarn start
At this point, the server is running and can either be tested locally by posting
to `localhost/api/ttn-influx`, or deployed by giving it a publicly accessible
address and connecting the `/api/ttn-influx` endpoint to [The Things Network]'s
[HTTP Integration] service.Example payload data, and some test functions, can be found in the
[Einfluss.TestRequest](src/Einfluss/TestRequest.purs) module.## ACHTUNG!
Currently the service decodes [The Things Network] payloads into a `StrMap` of
`String`s (object keys) and `Number`s (object values), so sending any payload
that doesn't follow this format will fail during decoding.[The Things Network]: https://www.thethingsnetwork.org
[HTTP Integration]: https://www.thethingsnetwork.org/docs/applications/http/
[InfluxDB]: https://www.influxdata.com/time-series-platform/influxdb/
[yarn]: https://yarnpkg.com
[purescript]: http://www.purescript.org
[pulp]: https://github.com/purescript-contrib/pulp
[bower]: https://bower.io