Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 1.74 KB

README.md

File metadata and controls

68 lines (45 loc) · 1.74 KB

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.