Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Latest commit

 

History

History
227 lines (161 loc) · 9.67 KB

CONTRIBUTING.md

File metadata and controls

227 lines (161 loc) · 9.67 KB

How to Contribute

Coderplex web application comprises of two repositories :

Table Of Contents

Code of Conduct

Coderplex has adopted Contributor Covenant that we expect project participants to adhere to.

Open Development

All work related to the application takes place on Github itself. We use Issues to track bugs, discuss ideas and to engage open source contributors. Projects are used to keep track of everything and is our project management tool. We maintain Wiki for structuring our long term thoughts. Both core team members and contributors sends a pull request which goes through the same review process. Whole process is as transparent as it can be and we strive to keep it that way.

Branching Model

The master branch of coderplex is relatively stable branch which we update for every release. We also have auto deployment in place for that particular branch i.e any changes in that branch gets reflected in https://openrank.coderplex.org. It is highly recommended for both maintainers and contributors to raise a pull request to develop branch. Before every release we throughly test develop branch and merge into master.

Imgur

A pull request to any other branch may most likely be closed by our bots.

Development Workflow

We welcome pull requests from beginners and seasoned javaScript developers alike!

Work on Issues

  1. Find an issue that needs assistance by searching for the open issues.
  2. If you decide to fix an issue, please be sure to check the comment thread in case somebody is already working on a fix. If nobody is working on it at the moment, please leave a comment stating that you intend to work on it so other people don’t accidentally duplicate your effort.
  3. If somebody claims an issue but doesn’t follow up for more than a weeks, it’s fine to take over it but you should still leave a comment.

Proposing a Change

  1. Open a new issue if you would like report a bug or suggest improvements.
  2. Please wait for core team members to comment on the thread. This lets us reach an agreement on your proposal before you put significant effort into it.

Prerequisites

  1. NodeJS

    • Minimum version v8.0.0+
    # To check node version
    node -v

    Any lower version than mentioned above may results in this error.

    If you face problem updating your node then you might need a Node version manager tool. Follow here

  2. Git (Familiarity with git is mandatory).

Sending a Pull Request

Working on your first Pull Request? You can learn how from this free series How to Contribute to an Open Source Project on GitHub

Running Locally

  1. Fork the repository.
  2. Then clone your forked repository
     git clone <your forked repository url>
  3. Move to the repository root folder
     cd openrank-backend
  4. Install dependencies
     npm install
  5. Create a .env file and values from .env.example. Change the values according to the environment that you're using to run the project. Make sure that you have database server running at port that you specified in the .env file.

    Note: You need to create a database manually because sequelize doesn't support creation of users and databases.

  6. Migrate the models to database.
     npm run migrate
  7. Start the development server
     //for development server using nodemon
     npm run start:dev
     //for running server using node
     npm run start
    App now opens at localhost:8000 in your default browser. If it doesn't, once you see a message on console saying the development server is hosted at above mentioned address. Please visit localhost:8000 in the browser of your choice.

    You may get this error if any other app is already running the above port.

Before submitting

  1. From your fork, create a branch and name it. eg. typo-in-readme or issue-9-fix or issue-12-feature-addition
  2. If you’ve fixed a bug or added code that should be tested, add tests!
  3. Ensure that all test pass
     npm run test
  4. Run code formatters
     npm run lint
  5. Add and commit your code. Please give meaning full commit messages.

Add yourself as a contributor

This project follows the all-contributors specification. Contributions of any kind welcome!

To add yourself to the table of contributors on the README.md, please use the automated script as part of your PR:

yarn run add-contributor

Follow the prompt and commit .all-contributorsrc and README.md in the PR.

Submitting PullRequest

  1. Pull latest code from upstream repository'sdevelop, if in case anything new were merged while you were working on your fork.
  2. Push the code to your fork.
  3. Raise the pull request from your created branch to develop branch of coderplex. why develop instead of master branch?
  4. Take some time to give a brief description of the work you have done.

After submitting

  1. Wait for all checks to pass in below section.

  2. Your changes are deployed with a unique link https://deploy-preview-xx--coderplex.netlify.com.

    - xx is your pull request number.

  3. The core team will review your pull request and either merge it, request changes to it, or close it with an explanation.

Received a review request
  • Work on the requested changes
  • Push the changes as you did earlier, the pull request will automatically catch those and update itself.

How to get in touch

Appendix

Node Version Manager

nvm for Linux & macOS

# Installation
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash

# Install latest node lts
nvm install --lts

# Use installed version
nvm use --lts

# Run the app in the same terminal session

Make sure you have curl installed

nvm-windows for Windows

It comes with an installer.

# Install particular version
nvm install 8.9.1

# Use installed version
nvm use 8.9.1

Still facing problem this article from @skounis explain in details.

Local host occupied

Error: listen EADDRINUSE :::8000
    at Object._errnoException (util.js:1024:11)
    at _exceptionWithHostPort (util.js:1046:20)
    at Server.setupListenHandle [as _listen2] (net.js:1351:14)
    at listenInCluster (net.js:1392:12)
    at Server.listen (net.js:1476:7)
    at app.prepare.then (/home/m-zubairahmed/github/official/openrank-backend/server.js:26:6)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
error Command failed with exit code 1.

If you get this error while running rpm run start:dev then probably another app is occupying localhost:8000. You may want to close that and run the command again.