Skip to content

Gratheon/telemetry-api

Repository files navigation

gratheon / telemetry-api 📊

Backend service responsible for logging metrics into timeseries database (influx). Expected to run in the cloud and receive IoT data from beehives.

Main goal and feature is described in Notion

Metrics

  • ✅ temperature
    • TODO: add 3d temperature endpoint /metrics/temperature
  • ✅ beehive weight (over time)
  • ✅ humidity

TODO

  • CO2 levels
  • atmospheric pressure
  • bee traffic (in/out) at the hive entrance
  • audio noise volume
  • vibrations
  • wind speed

Screenshot 2024-07-06 at 03 38 52

URLs

URL Description
http://telemetry.gratheon.com Production
http://localhost:8600 Local dev

APIs

This service provides two types of APIs

  • GraphQL API - most flexible and type safe for web-app, not versioned
  • REST API - more of a legacy API, intended for IoT devices, versioned

Installation & development

Checkout grafana first from https://github.com/Gratheon/grafana Start those pods to have influx with docker-compose

  • Open http://localhost:5300/
  • login into influxdb
  • open Load Data -> API Tokens -> Generate API Token so that telemetry-api could write data to influxdb
  • Change INFLUXDB_TOKEN in docker-compose.dev.yml and set it to the token you generated

Then start telemetry api:

just start

Architecture

flowchart LR
	hardware-beehive-sensors[<a href="https://github.com/Gratheon/hardware-beehive-sensors">hardware-beehive-sensors</a>] -."send aggregate (5sec)\n metric value".-> telemetry-api

	telemetry-api --"update beehive entrance daily traffic counters"--> mysql[(<a href="https://github.com/Gratheon/mysql">mysql</a>)]
	beehive-entrance-video-processor[<a href="https://github.com/Gratheon/beehive-entrance-video-processor">beehive-entrance-video-processor</a>] -."send entrance\n traffic metric".-> telemetry-api
	telemetry-api --"store bee traffic timeseries" --> influx[(<a href="https://github.com/Gratheon/grafana">influx</a>)]
	grafana[(<a href="https://github.com/Gratheon/grafana">grafana</a>)] --"fetch history"--> influx

	telemetry-api --"verify API tokens for REST calls"--> user-cycle[<a href="https://github.com/Gratheon/user-cycle">user-cycle</a>]
	web-app[<a href="https://github.com/Gratheon/web-app">web-app</a>] --"display advanced configureable graphs"--> grafana
	web-app --"query for simplistic metrics\nPOST graphql"-->graphql-router[<a href="https://github.com/Gratheon/graphql-router">graphql-router</a>]--> telemetry-api

Loading

About

Backend service to log beehive timeseries data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages