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.
This project uses MongoDB as database through the Mongoose library.
Install the dependencies:
npm installCopy the .env.example file to .env:
cp .env.example .envUpdate the variables to correspond your environment.
Generate the RSA keys:
npm run key:generateor
node keys.jsYou 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 upIf 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 -pCreate the super user
docker-compose exec app node initDatabase.jsThis project doesn't have a front-end, yet.