Skip to content

RESTful API server for a home automation controller server built in Express

License

Notifications You must be signed in to change notification settings

esron/systranca-server

Repository files navigation

SysTranca Server Project

JavaScript Style Guide Build Status CodeQL

This project was born when I came too early at my work building. We are a small startup on Vale do São Francisco, Brazil.

The objective of this project is provide an API with authentication and authorization for users to login into a home automation server that can, for now, open a electronic lock.

Instructions

This project uses MongoDB as database through the Mongoose library.

Install the dependencies:

npm install

Copy the .env.example file to .env:

cp .env.example .env

Update the variables to correspond your environment.

Generate the RSA keys:

npm run key:generate

or

node keys.js

Docker SetUp

You will also need a MongoDb instance and a MQTT broker.

This project comes with a docker-compose.ym file to help you deploy that locally, just:

docker-compose up

If you see this error when to execute node container:

Internal watch failed: ENOSPC: System limit for number of file watchers reached, watch '/home/node/app/README.md'

execute this to fix it:

sudo sysctl fs.inotify.max_user_watches=582222 && sudo sysctl -p

Create the super user

docker-compose exec app node initDatabase.js

This project doesn't have a front-end, yet.