Git Product home page Git Product logo

open-iot's Introduction

Open IoT

Build Status Coverage Status Docker Pulls

Open IoT is intended to be a flexible IoT backend and gateway management system, offering:

  • easy and secure data ingestion
  • device registry
  • data flow management
  • simple data transformations
  • MQTT and HTTP transports

How to build and run it locally

# Using Docker Compose
docker-compose up -d --build

Building, testing and development

# To build the frontend only once
npm run build

# To continuously watch for changes on the frontend
npm run watch

# To follow the logs of the backend
docker logs -f openiot_ui_1

# To run tests
npm test

# To run tests with coverage
npm run test:coverage

# To run tests with logger enabled
env TEST_LOGGER=true npm test

Deployment

  1. Generate SSL certificates for your domain.
  • Place the server private key in server_key.pem file
  • Place the certificate chain of the server certificate and the root certificate by inserting them one after another (in that order) in server_certificate.pem file.
  • Copy the two files in a psersistent directory on the docker host and create symlinks with the domain name (note that the names are important):
    • /certs/server_certificate.pem
    • /certs/iot.example.com.crt -> /certs/server_certificate.pem
    • /certs/server_key.pem
    • /certs/iot.example.com.key -> /certs/server_key.pem
  1. Copy docker-compose-prod.yml to your host as docker-compose.yml and update it by changing the following fields:
  • services.proxy.volumes[1] = /certs:/etc/nginx/certs/
  • services.broker.environment.RABBITMQ_ERLANG_COOKIE = cookie_secret
  • services.ui.environment.VIRTUAL_HOST = iot.example.com
  • services.ui.environment.DB_CONNECTION = mongodb://db/prod
  • services.ui.environment.ENCRYPTION_SECRET = encryption_secret
  • services.ui.environment.HANDLER_KEY = handler_key
  • services.ui.environment.HANDLER_SECRET = handler_secret
  1. (Optional) Add MongoDB service to composition. Don't forget to mount a persistent directories on the docker host as /data/db and /data/configdb volumes in the Mongo container:
db:
    image: mongo:latest
    ports:
        - 27017:27017
    hostname: db
    volumes:
        - /path/to/mongodb/data/db:/data/db
        - /path/to/mongodb/data/configdb:/data/configdb
  1. Run docker-compose up -d

How to update

Create a redeploy.sh script next to docker-compose.yml with the following contents:

#!/bin/bash
docker pull pvorotnikov/open-iot-proxy:latest
docker pull pvorotnikov/open-iot-broker:latest
docker pull pvorotnikov/open-iot-ui:latest
docker-compose up -d

Run it every time you need to update the service

open-iot's People

Contributors

pvorotnikov avatar dependabot[bot] avatar

Watchers

 avatar

Forkers

adishyam

open-iot's Issues

Contact Info?

Hey Petar,
I ran across your repo this afternoon while looking for some IoT integration setup. Any chance I can talk to you about some side work to help me out on a project I have been building? Hit me up on discord if you can at fender21#5435. I have yet to run across someone pull all these components together so cleanly, so I'm hoping we can catch up.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.