https://github.com/projectweekend/thpl-data-logger
Logs data from Pi-THPL-Data-Reporter in Postgres
https://github.com/projectweekend/thpl-data-logger
Last synced: 11 months ago
JSON representation
Logs data from Pi-THPL-Data-Reporter in Postgres
- Host: GitHub
- URL: https://github.com/projectweekend/thpl-data-logger
- Owner: projectweekend
- License: mit
- Created: 2015-11-23T01:43:41.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-12-02T02:41:24.000Z (over 10 years ago)
- Last Synced: 2025-03-27T15:53:16.922Z (over 1 year ago)
- Language: Python
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
THPL Data Logger
====================
This project subscribes to messages published by [Pi-THPL-Data-Reporter](https://github.com/projectweekend/Pi-THPL-Data-Reporter) and logs the data in a Postgres database.
Environment Variables
====================
The following environment variables are used:
* `THPL_DATABASE_URL` - Postgres database connection URL
* `PICLOUD_URL` - URL for the [picloud](https://github.com/exitcodezero/picloud) server
* `PICLOUD_API_KEY` - API key for the picloud server
Database Migrations
====================
Database migrations are handled by [Flyway](http://flywaydb.org/) and files are stored in the `/sql` directory. You can run migrations manually in the development environment using `docker-compose`. The included script `local_migrate.sh` uses an environment variable created by [Docker Compose](https://docs.docker.com/compose/env/) to find the IP address assigned to the database and execute the Flyway command to run migrations.
```
docker-compose run flyway ./local_migrate.sh
```
Run Locally
====================
The development environment for this project uses [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/). With those tools installed and database migrations applied, run the following to start it locally:
```
docker-compose up
```