Skip to content

Latest commit

 

History

History
121 lines (73 loc) · 3.1 KB

CONTRIBUTING.md

File metadata and controls

121 lines (73 loc) · 3.1 KB

Contribution

Following are the steps which should get you started.

Prerequisites

  • NodeJS & npm

  • MongoDB community server

  • Localhost CA certificate

  • .env file, see .sample.env

  • custom config/config.json - all config keys signed with a custom ssh key from custom .env file.

Optionally

Fulfiling Requirements

  • NodeJS can be installed from the official website. Make sure that you're able to run node as well as npm command via your terminal.

  • MongoDB community server can be downloaded from the official website. Then make sure the database server runs on mongodb://localhost:27017/.

  • To generate localhost .pem files locally in project folder, mkcert can be used. Follow the instructions provided in their repository, and generate localhost.pem & localhost-key.pem in project root.

  • .env file provides environment variables for local server. This can be created manually following the pattern in .sample.env and obtaining values from repository secret, or by asking the owner to provide it to you.

  • config/config.json can be generated using npm run newconfig. See README for more details on this.

In repository

Clone

git clone <GIT_REPOSITORY_LINK>

Install Packages

npm install

Follow config keys generation steps from README.md.

Test run

npm test

Should pass all tests.

Server run

npm run devserver

Console must log

Connected to <YOUR_DATABASE_NAME>
listening on 3000 (https)

Navigate to https://localhost:3000/ in your browser. The webapp should get running.

In case the server fails to run, go through all the steps carefully, specially the steps for .pem certificate generation and .env file. Also make sure the mongodb community server is running on the required port before you start the node server.

Making changes

Switch branch

git checkout -b <YOUR_BRANCH_NAME>

Keep the branch name descriptive to the changes you're about to make.

The details of project are thouroughly discussed in DOCUMENTATION.md and can be referred.

On changes done

It is advisable to break server before moving on to VCS.

If you have installed commititzen (cz command is enabled on your system), then you can run the following command.

npm run commit

The above command executes the following commands sequentially.

npm test
git status
git add .
git status
git cz

If git cz throws any error, then you can always proceed with git commit. However, do run npm test before commiting any changes.

Changes on remote

git pull
git push -u origin <YOUR_BRANCH_NAME>

Create pull requests with proper description of updates and changes made.