diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..6fb0028 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,23 @@ +{ + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": false, + "contributors": [ + { + "login": "sbvkrishna", + "name": "Bala Vijaya Krishna Saladi", + "avatar_url": "https://avatars0.githubusercontent.com/u/37334979?s=460&v=4", + "profile": "http://sbvkrishna.github.io", + "contributions": [ + "doc" + ] + } + ], + "contributorsPerLine": 7, + "projectName": "openrank-execution", + "projectOwner": "coderplex", + "repoType": "github", + "repoHost": "https://github.com" +} diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..031921b --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at pr@coderplex.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..b838a36 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,227 @@ +# How to Contribute + +Coderplex web application comprises of two repositories : + +* [OpenRank-Frontend](https://github.com/coderplex/openrank-frontend) : Frontend of the application + +* [OpenRank-Backend](https://github.com/coderplex/openrank-backend) : Backend of the application, where API calls are made. + +* [OpenRank-Execution](https://github.com/coderplex/openrank-backend) : Backend of the application, where code execution and server-side testing happens. + +## Table Of Contents + + + + + +- [Code of Conduct](#code-of-conduct) +- [Open Development](#open-development) +- [Branching Model](#branching-model) +- [Development Workflow](#development-workflow) + - [Work on Issues](#work-on-issues) + - [Proposing a Change](#proposing-a-change) + - [Prerequisites](#prerequisites) + - [Sending a Pull Request](#sending-a-pull-request) + - [Running Locally](#running-locally) + - [Before submitting](#before-submitting) + - [Add yourself as a contributor](#add-yourself-as-a-contributor) + - [Submitting PullRequest](#submitting-pullrequest) + - [After submitting](#after-submitting) + - [Received a review request](#received-a-review-request) + - [How to get in touch](#how-to-get-in-touch) +- [Appendix](#appendix) + - [Node Version Manager](#node-version-manager) + - [nvm for Linux & macOS](#nvm-for-linux--macos) + - [nvm-windows for Windows](#nvm-windows-for-windows) + - [Local host occupied](#local-host-occupied) + + + +## Code of Conduct + +Coderplex has adopted [Contributor Covenant](/.github/CODE_OF_CONDUCT.md) that we expect project participants to adhere to. + +## Open Development + +All work related to the application takes place on Github itself. We use [Issues](https://github.com/coderplex/openrank-backend/issues) to track bugs, discuss ideas and to engage open source contributors. [Projects](https://github.com/coderplex/openrank-backend/projects) are used to keep track of everything and is our project management tool. We maintain [Wiki](https://github.com/coderplex/openrank-backend/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](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](https://i.imgur.com/KPO2dLul.png) + +_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](https://github.com/coderplex/openrank-backend/labels/help-wanted). +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. +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. + +### Proposing a Change + +1. Open a new issue if you would like report a bug or suggest improvements. +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. + +### Prerequisites + +1. [NodeJS](https://nodejs.org/) + + * Minimum version v8.0.0+ + + ```bash + # To check node version + node -v + ``` + + Any lower version than mentioned above may results in this [error](https://github.com/coderplex/coderplex/issues/100). + + > If you face problem updating your node then you might need a Node version manager tool. [Follow here](#node-version-manager) + +1. [Git](https://git-scm.com/download/linux) (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](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)* + +#### Running Locally + +1. Fork the [repository](https://github.com/coderplex/coderplex). +1. Then clone your forked repository + ```bash + git clone + ``` +1. Move to the repository root folder + ```bash + cd openrank-backend + ``` +1. Install dependencies + ```bash + npm install + ``` +1. 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. +1. Migrate the models to database. + ```bash + npm run migrate + ``` +1. Start the development server + ```bash + //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](http://localhost:8000) in the browser of your choice. + > You may get this [error](#local-host-occupied) if any other app is already running the above port. + +#### Before submitting + +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` +1. If you’ve fixed a bug or added code that should be tested, add tests! +1. Ensure that all test pass + ```bash + npm run test + ``` +1. Run code formatters + ```bash + npm run lint + ``` +1. Add and commit your code. Please give meaning full commit messages. + +#### Add yourself as a contributor + +This project follows the [all-contributors](https://github.com/kentcdodds/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: + +```bash +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'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. +1. Push the code to your fork. +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) +1. 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. +1. Your changes are deployed with a unique link `https://deploy-preview-xx--coderplex.netlify.com`. + + _`- xx` is your pull request number._ + +1. 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 + +* OpenRank [Discord Channel](https://discord.gg/ppXaS3) + + +## Appendix + +### Node Version Manager + +#### [nvm](https://github.com/creationix/nvm) for Linux & macOS + +```bash +# 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](https://curl.haxx.se/) installed_ + +#### [nvm-windows](https://github.com/coreybutler/nvm-windows) for Windows + +It comes with an [installer](https://github.com/coreybutler/nvm-windows#installation--upgrades). + +```bash +# Install particular version +nvm install 8.9.1 + +# Use installed version +nvm use 8.9.1 +``` + +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. + +### Local host occupied + +```js +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 + 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. diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..dd84ea7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000..48d5f81 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..bbcbbe7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..25fa61d --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,44 @@ + + + + + + +# What kind of change does this PR introduce + + + +## What is the current behavior + + + +## What is the new behavior + + + +### Checklist for this PR + + + + + +* [ ] I have read [contributing guidelines](/.github/CONTRIBUTING.md). +* [ ] I executed `npm run lint` locally to format my code. +* [ ] I added revelant Tests to verify my code. +* [ ] All tests `npm run test` ran successfully. +* [ ] Pull request is towards `develop` branch. +* [ ] Added myself to contributors table +* [ ] Documentation +* [ ] Ready to be merged + + + + diff --git a/README.md b/README.md new file mode 100644 index 0000000..f9738c0 --- /dev/null +++ b/README.md @@ -0,0 +1,42 @@ +# openrank-execution +[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors) + +_This is the Back-end Code-Execution repository for the OpenRank project._ + +## You're most welcome for your contributions + + ### Contributing + Want to contribute? Please go through the [CONTRIBUTING](/.github/CONTRIBUTING.md) and [CODE OF CONDUCT](/.github/CODE_OF_CONDUCT.md) to know how to contribute to us. + + ### Issues and feature requests + Found some issues/bugs? (or) Do you have any new feature request in your mind? Please look at [BUG REPORT](/.github/ISSUE_TEMPLATE/bug_report.md) for reporting bugs/issues, and use [FEATURE REQUEST](/.github/ISSUE_TEMPLATE/feature_request.md) template to send your feature request. + + Want to raise an issue which doesn't fit in above two? Use [CUSTOM TEMPLATE](/.github/ISSUE_TEMPLATE/custom.md) + + +## Project setup +``` +git clone https://github.com/coderplex/openrank-execution.git +cd openrank-execution +npm install +``` + +### Compiles and hot-reloads for development +``` +npm run start +``` + +## Contributors ✨ + +Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + +
+ + + +This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!