|
| 1 | +# How to Contribute |
| 2 | + |
| 3 | +Coderplex web application comprises of two repositories : |
| 4 | + |
| 5 | +* [OpenRank-Frontend](https://github.com/coderplex/openrank-frontend) : Frontend of the application |
| 6 | + |
| 7 | +* [OpenRank-Backend](https://github.com/coderplex/openrank-backend) : Backend of the application, where API calls are made. |
| 8 | + |
| 9 | +* [OpenRank-Execution](https://github.com/coderplex/openrank-backend) : Backend of the application, where code execution and server-side testing happens. |
| 10 | + |
| 11 | +## Table Of Contents |
| 12 | + |
| 13 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 14 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 15 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 16 | + |
| 17 | +- [Code of Conduct](#code-of-conduct) |
| 18 | +- [Open Development](#open-development) |
| 19 | +- [Branching Model](#branching-model) |
| 20 | +- [Development Workflow](#development-workflow) |
| 21 | + - [Work on Issues](#work-on-issues) |
| 22 | + - [Proposing a Change](#proposing-a-change) |
| 23 | + - [Prerequisites](#prerequisites) |
| 24 | + - [Sending a Pull Request](#sending-a-pull-request) |
| 25 | + - [Running Locally](#running-locally) |
| 26 | + - [Before submitting](#before-submitting) |
| 27 | + - [Add yourself as a contributor](#add-yourself-as-a-contributor) |
| 28 | + - [Submitting PullRequest](#submitting-pullrequest) |
| 29 | + - [After submitting](#after-submitting) |
| 30 | + - [Received a review request](#received-a-review-request) |
| 31 | + - [How to get in touch](#how-to-get-in-touch) |
| 32 | +- [Appendix](#appendix) |
| 33 | + - [Node Version Manager](#node-version-manager) |
| 34 | + - [nvm for Linux & macOS](#nvm-for-linux--macos) |
| 35 | + - [nvm-windows for Windows](#nvm-windows-for-windows) |
| 36 | + - [Local host occupied](#local-host-occupied) |
| 37 | + |
| 38 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 39 | + |
| 40 | +## Code of Conduct |
| 41 | + |
| 42 | +Coderplex has adopted [Contributor Covenant](/.github/CODE_OF_CONDUCT.md) that we expect project participants to adhere to. |
| 43 | + |
| 44 | +## Open Development |
| 45 | + |
| 46 | +All work related to the application takes place on Github itself. We use [Issues](https://github.com/coderplex/openrank-frontend/issues) to track bugs, discuss ideas and to engage open source contributors. [Projects](https://github.com/coderplex/openrank-frontend/projects) are used to keep track of everything and is our project management tool. We maintain [Wiki](https://github.com/coderplex/openrank-frontend/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. |
| 47 | + |
| 48 | +## Branching Model |
| 49 | + |
| 50 | +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](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. |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +_A pull request to any other branch may most likely be closed by our bots_. |
| 55 | + |
| 56 | +## Development Workflow |
| 57 | + |
| 58 | +We welcome pull requests from beginners and seasoned javaScript developers alike! |
| 59 | + |
| 60 | +### Work on Issues |
| 61 | + |
| 62 | +1. Find an issue that needs assistance by searching for the [open issues](https://github.com/coderplex/openrank-frontend/labels/help-wanted). |
| 63 | +1. 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. |
| 64 | +1. 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. |
| 65 | + |
| 66 | +### Proposing a Change |
| 67 | + |
| 68 | +1. Open a new issue if you would like report a bug or suggest improvements. |
| 69 | +1. 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. |
| 70 | + |
| 71 | +### Prerequisites |
| 72 | + |
| 73 | +1. [NodeJS](https://nodejs.org/) |
| 74 | + |
| 75 | + * Minimum version v8.0.0+ |
| 76 | + |
| 77 | + ```bash |
| 78 | + # To check node version |
| 79 | + node -v |
| 80 | + ``` |
| 81 | + |
| 82 | + Any lower version than mentioned above may results in this [error](https://github.com/coderplex/coderplex/issues/100). |
| 83 | + |
| 84 | + > If you face problem updating your node then you might need a Node version manager tool. [Follow here](#node-version-manager) |
| 85 | + |
| 86 | +1. [Git](https://git-scm.com/download/linux) (Familiarity with git is mandatory). |
| 87 | + |
| 88 | +### Sending a Pull Request |
| 89 | + |
| 90 | +*Working on your first Pull Request? You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)* |
| 91 | + |
| 92 | +#### Running Locally |
| 93 | + |
| 94 | +1. Fork the [repository](https://github.com/coderplex/coderplex). |
| 95 | +1. Then clone your forked repository |
| 96 | + ```bash |
| 97 | + git clone <your forked repository url> |
| 98 | + ``` |
| 99 | +1. Move to the repository root folder |
| 100 | + ```bash |
| 101 | + cd openrank-frontend |
| 102 | + ``` |
| 103 | +1. Install dependencies |
| 104 | + ```bash |
| 105 | + npm install |
| 106 | + ``` |
| 107 | +1. Start the development server |
| 108 | + ```bash |
| 109 | + npm run serve |
| 110 | + ``` |
| 111 | + App now opens at `localhost:8080` 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:8080](http://localhost:8080) in the browser of your choice. |
| 112 | + > You may get this [error](#local-host-occupied) if any other app is already running the above port. |
| 113 | + |
| 114 | +#### Before submitting |
| 115 | + |
| 116 | +1. From your fork, create a [branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) and name it. eg. `typo-in-readme` or `issue-9-fix` or `issue-12-feature-addition` |
| 117 | +1. If you’ve fixed a bug or added code that should be tested, add tests! |
| 118 | +1. Ensure that all test pass |
| 119 | + ```bash |
| 120 | + npm run test |
| 121 | + ``` |
| 122 | +1. Run code formatters |
| 123 | + ```bash |
| 124 | + npm run lint |
| 125 | + ``` |
| 126 | +1. Add and commit your code. Please give meaning full commit messages. |
| 127 | + |
| 128 | +#### Add yourself as a contributor |
| 129 | + |
| 130 | +This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! |
| 131 | + |
| 132 | +To add yourself to the table of contributors on the `README.md`, please use the automated script as part of your PR: |
| 133 | + |
| 134 | +```bash |
| 135 | +yarn run add-contributor |
| 136 | +``` |
| 137 | + |
| 138 | +Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR. |
| 139 | + |
| 140 | +#### Submitting PullRequest |
| 141 | + |
| 142 | +1. Pull latest code from [upstream repository's](https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/)`develop`, if in case anything new were merged while you were working on your fork. |
| 143 | +1. Push the code to your fork. |
| 144 | +1. Raise the pull request from your created branch to `develop` branch of coderplex. [why develop instead of master branch?](https://www.atlassian.com/git/tutorials/comparing-workflows) |
| 145 | +1. Take some time to give a brief description of the work you have done. |
| 146 | + |
| 147 | +#### After submitting |
| 148 | + |
| 149 | +1. Wait for all checks to pass in below section. |
| 150 | +1. Your changes are deployed with a unique link `https://deploy-preview-xx--coderplex.netlify.com`. |
| 151 | + |
| 152 | + _`- xx` is your pull request number._ |
| 153 | + |
| 154 | +1. The core team will review your pull request and either merge it, request changes to it, or close it with an explanation. |
| 155 | + |
| 156 | +##### Received a review request |
| 157 | + |
| 158 | +* Work on the requested changes |
| 159 | +* Push the changes as you did earlier, the pull request will automatically catch those and update itself. |
| 160 | + |
| 161 | +### How to get in touch |
| 162 | + |
| 163 | +* OpenRank [Discord Channel](https://discord.gg/ppXaS3) |
| 164 | +<!-- * Tweet core team members : |
| 165 | + * Vinay Puppal [@VinayPuppal](https://twitter.com/vinaypuppal) |
| 166 | + * Md-ZubairAhmed [@Md_ZubairAhmed](https://twitter.com/Md_ZubairAhmed) --> |
| 167 | + |
| 168 | +## Appendix |
| 169 | + |
| 170 | +### Node Version Manager |
| 171 | + |
| 172 | +#### [nvm](https://github.com/creationix/nvm) for Linux & macOS |
| 173 | + |
| 174 | +```bash |
| 175 | +# Installation |
| 176 | +curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash |
| 177 | + |
| 178 | +# Install latest node lts |
| 179 | +nvm install --lts |
| 180 | + |
| 181 | +# Use installed version |
| 182 | +nvm use --lts |
| 183 | + |
| 184 | +# Run the app in the same terminal session |
| 185 | +``` |
| 186 | + |
| 187 | +_Make sure you have [curl](https://curl.haxx.se/) installed_ |
| 188 | + |
| 189 | +#### [nvm-windows](https://github.com/coreybutler/nvm-windows) for Windows |
| 190 | + |
| 191 | +It comes with an [installer](https://github.com/coreybutler/nvm-windows#installation--upgrades). |
| 192 | + |
| 193 | +```bash |
| 194 | +# Install particular version |
| 195 | +nvm install 8.9.1 |
| 196 | + |
| 197 | +# Use installed version |
| 198 | +nvm use 8.9.1 |
| 199 | +``` |
| 200 | + |
| 201 | +Still facing problem this [article](https://medium.com/appseed-io/how-to-run-multiple-versions-of-node-js-with-nvm-for-windows-ffbe5c7a2b47) from [@skounis](https://twitter.com/skounis) explain in details. |
| 202 | + |
| 203 | +### Local host occupied |
| 204 | + |
| 205 | +```js |
| 206 | +Error: listen EADDRINUSE :::3000 |
| 207 | + at Object._errnoException (util.js:1024:11) |
| 208 | + at _exceptionWithHostPort (util.js:1046:20) |
| 209 | + at Server.setupListenHandle [as _listen2] (net.js:1351:14) |
| 210 | + at listenInCluster (net.js:1392:12) |
| 211 | + at Server.listen (net.js:1476:7) |
| 212 | + at app.prepare.then (/home/m-zubairahmed/github/official/coderplex-frontend/server.js:26:6) |
| 213 | + at <anonymous> |
| 214 | + at process._tickCallback (internal/process/next_tick.js:188:7) |
| 215 | +error Command failed with exit code 1. |
| 216 | +``` |
| 217 | + |
| 218 | +If you get this error while running `rpm run serve` then probably another app is occupying `localhost:8080`. You may want to close that and run the command again. |
0 commit comments