Management of users, roles, tenants and security/ACL in Node.js/MongoDB/Mongoose with self service signup
You need Node.js and MongoDB installed and running.
We use bcrypt
for hashing
secrets. If you have issues during installation related to bcrypt
then refer
to this wiki
page.
$ git clone [email protected]:jCatalog/user-tenant-security.git && cd ./user-tenant-security
$ npm install
WARNING: This will clear all data in existing users
, tenants
and
roles
MongoDB collections. It will also overwrite /config.js
if one
exists.
$ npm run setup
# > [email protected] setup E:\jCatalog\usertenantsecurity
# > node setup.js
# Project name: (User Tenant Security)
# MongoDB URL: (mongodb://localhost/user_tenant_security)
# Root user email: ([email protected])
# Root user password:
# Root user password:
# System email: ([email protected])
# SMTP host: (smtp.gmail.com)
# SMTP port: (465)
# SMTP username: ([email protected])
# SMTP password:
# Initiate CreateConfig ....
# Read Config File ....
# Start Writing Config File ....
# Done Writing Config File ....
# Setup complete.
$ npm start
# > [email protected] start E:\jCatalog\usertenantsecurity
# > node node_modules/nodemon/bin/nodemon.js -e js,md server
# 10 Oct 19:25:02 - [nodemon] v1.2.1
# 10 Oct 19:25:02 - [nodemon] to restart at any time, enter `rs`
# 10 Oct 19:25:02 - [nodemon] watching: *.*
# 10 Oct 19:25:02 - [nodemon] starting `node server server.js`
This will start the app using nodemon
.
nodemon
will watch for changes and restart the app as needed.