This is the back end service running on node.js with mongodb, installed with docker. Click here to see the project description.
Prerequisites: Please ensure you have Node.js v8 or higher and Docker v18.06.1 or higher installed. Mailgun will be needed for the email messaging service. The docker setup includes mongoDB without additional database installation.
-
Clone the repo:
git clone https://github.com/norestlabs/mousekyc-be.git
-
Modify server configuration in
src/config/default.js
.db
is to choose the local or docker mongoDB.email
is for providing your mailgun credentials.baseUrl
is to choose your localhost server or mousebelt's. -
Ensure Docker is running and execute the command:
docker-compose build docker-compose up
-
Leave the current terminal open, and in new terminal window you can see the processes running with the command:
docker ps -a
-
Now you can proceed with the mousekyc-fe and mousekyc-admin repos.
If you prefer not to use docker or have a port conflict, you should manually install MongoDB.
- Once you have downloaded and installed MongoDB from https://www.mongodb.com/download-center/community
- You will have to create and run an instance in a separate terminal window. See details here https://docs.mongodb.com/manual/tutorial/manage-mongodb-processes/
- Update the config setting on line 3, file
src/config/default.js
to use the local dbdb: 'mongodb://localhost:27017/kyc-db'
- Run mongodb and start the app:
mongod npm start
Copy and rename the backup js files extension in the config folder. Modify the following files to suit your needs.
src/config/development.js.bak
src/config/production.js.bak
src/config/test.js.bak
docker-compose -f docker-compose.test.yml up
Check output results with:
curl -i http://localhost:3000/global/countries
Install pm2
sudo npm -g install pm2
Run backend service in development mode
pm2 start pm2.json
Run backend service in production mode
pm2 start --env production pm2.json
Restart backend
pm2 restart mousekyc-backend
API Docs can be found inside the repo wiki.