Skip to content
This repository has been archived by the owner on Apr 6, 2020. It is now read-only.

boldare/xlab-7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XLAB

Services

This app is consists of 3 services:

  • Sensor - communicates with sensor via serial port and provides an API to retrieve latest value
  • API - fetches data from the Sensor or external service and posts it to remote database
  • SPA - presents the data in a fancy way

Prerequisites

Before running this project, you will need to configure the app.

Create a Firebase project

To run this app you will need a Firebase Project. You can create on here for free.

Obtain your Firebase Admin SDK private key in project settings and put it in api/config/xlab-smog.json.

Obtain WAQI API token

You will also need a World Air Quality Index API token.

Fill the parameters

Then just fill your parameters in:

  • api/config/default.js
  • sensor/config/config.js
  • spa/src/scripts/config/firebase-config.js

Running the app using Docker

The simpliest way to run this app is to use Docker together with Docker-Compose. Assuming you already have it installed, create an .env file:

cp .env.dist .env

and edit the variables to suit your needs making sure SENSOR_SERIAL_PORT is pointing to the serial port with sensor.

Raspberry Pi

You can easily run this project on Raspberry Pi making it fully featured mini smog monitor. However, there are some extra steps:

Uncomment the DOCKERFILE_SUFFIX=RPi line in .env file. It will tell Docker-Compose to use the DockerfileRPi file designed for this platform.

Run docker-compose up and wait for its completion. Note that building sensor and spa will take a lot of time because of compilation of node-sass and node-serialport.

Running the app locally

If you don't want to use Docker, you will need to install node 6. If you are using an unsupported platform, you will need to compile node-serialport so make sure you have build-essential package installed.

Just run:

npm install && npm start

in api, spa and sensor.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published