This nodejs express app provides a simple yet powerful way to create a Iot Input&Output backend in minutes.
You only need to configure the default configuration for your project (in an intuitive yaml file) and it will automatically create a simple HTTP-Server with all nessesary endpoints and on top a WebSocket, which will receive changes on the configuration in a blink of an eye!
npm install
npm start
Your project can be defined in a /config.yml
. You can modify the /sample.config.yml or use it as reference.
This will be the default configuration of your project. With POST Endpoints these configurations can be changed by your devices.
# simple on / off logic
# controllable via endpoint: HTTP GET & POST /lamp1, resp. /lamp2
lamp1: true
lamp2: true
# nested objects
# controllable via endpoint: HTTP GET & POST /livingroom/lamp, resp. /kitchen/lamp
livingroom:
lamp:
brightness: 0.5
power: true
window: false
kitchen:
lamp: false
window: false
# you also can utilize datatypes
# controllable via endpoint: HTTP GET & POST /volume, etc..
volume: 0.1
brightness: 100
status: "online"
You'll also find a .env.sample
which (after you renamed it to .env
) basicly allows you to change the ports of your project and define other sensitive configurations.
- Install NodeJS on a RaspberryPi
- Install this Repository
- Run the app
- Connect devices within your local network / wifi (ws://mySuperRaspberryIP:3000 or http://mySuperRaspberryIP:8080)
- Might need to fork it and make your changes for configuraitons
- You can use services like Heroku to host this app. (Free-Tier should be sufficient enough)
- Connect devices via the internet with http://myiotbackend.herokuapp.com
- configuration via yaml
- build & retrieve current configuration via HTTP GET requests
- create WebSocket, list connected devices, send current configration to connected devices
- change current configuration via HTTP POST & PATCH requests
- notify connected devices via WebSocket on changes
- simple access-key-based authentification
- persistent changed configuration (save current configuration to file system)