Skip to content

Commit 48b9ea9

Browse files
authored
Merge pull request #8 from krushiraj/doc-readme
Added documentations for CONTRIBUTING and COC.
2 parents 7b4e689 + 1d47155 commit 48b9ea9

File tree

5 files changed

+812
-26
lines changed

5 files changed

+812
-26
lines changed

.github/CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
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.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
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.
28+
29+
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.
30+
31+
## Scope
32+
33+
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.
34+
35+
## Enforcement
36+
37+
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.
38+
39+
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.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

.github/CONTRIBUTING.md

Lines changed: 242 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,242 @@
1+
# How to Contribute
2+
3+
Coderplex [Donations Page](https://donate.coderplex.org/) is a frontend application to accept donations to [Codeplex](https://coderplex.org/)
4+
5+
## Table Of Contents
6+
7+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
8+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
9+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
10+
11+
- [Code of Conduct](#code-of-conduct)
12+
- [Open Development](#open-development)
13+
- [Branching Model](#branching-model)
14+
- [Development Workflow](#development-workflow)
15+
- [Work on Issues](#work-on-issues)
16+
- [Proposing a Change](#proposing-a-change)
17+
- [Prerequisites](#prerequisites)
18+
- [Sending a Pull Request](#sending-a-pull-request)
19+
- [Running Locally](#running-locally)
20+
- [Before submitting](#before-submitting)
21+
- [Add yourself as a contributor](#add-yourself-as-a-contributor)
22+
- [Submitting PullRequest](#submitting-pullrequest)
23+
- [After submitting](#after-submitting)
24+
- [Received a review request](#received-a-review-request)
25+
- [How to get in touch](#how-to-get-in-touch)
26+
- [Appendix](#appendix)
27+
- [Node Version Manager](#node-version-manager)
28+
- [nvm for Linux & macOS](#nvm-for-linux--macos)
29+
- [nvm-windows for Windows](#nvm-windows-for-windows)
30+
- [Local host occupied](#local-host-occupied)
31+
32+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
33+
34+
## Code of Conduct
35+
36+
Coderplex has adopted [Contributor Covenant](https://github.com/coderplex/donation-page/blob/master/docs/CODE_OF_CONDUCT.md) that we expect project participants to adhere to.
37+
38+
## Open Development
39+
40+
All work related to the application takes place on Github itself. We use [Issues](https://github.com/coderplex/donation-page/issues) to track bugs, discuss ideas and to engage open source contributors. [Projects](https://github.com/coderplex/donation-page/projects) are used to keep track of everything and is our project management tool. We maintain [Wiki](https://github.com/coderplex/donation-page/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.
41+
42+
## Branching Model
43+
44+
The `master` branch of donation-page is relatively stable branch which we use for both development and deployment. We also have auto deployment on this branch itself i.e any changes in that branch gets reflected in [https://donate.coderplex.org](https://donate.coderplex.org).
45+
46+
## Development Workflow
47+
48+
We welcome pull requests from beginners and seasoned JavaScript developers alike!
49+
50+
### Work on Issues
51+
52+
1. Find an issue that needs assistance by searching for the [open issues](https://github.com/coderplex/donation-page/labels/help-wanted).
53+
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.
54+
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.
55+
56+
### Proposing a Change
57+
58+
1. Open a new issue if you would like report a bug or suggest improvements.
59+
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.
60+
61+
### Prerequisites
62+
63+
1. [NodeJS](https://nodejs.org/)
64+
65+
- Currently we are developing using the Node.js v10.x
66+
67+
```bash
68+
# To check node version
69+
node -v
70+
```
71+
72+
Any lower version than mentioned above may face some unexpected behaviour or erros. You can install any version of node along with the version that you have in your machine. For that you need <b>N</b>ode <b>V</b>ersion <b>M</b>anager.
73+
74+
> If you face problem updating your node then you might need a Node version manager tool. [Follow here](#node-version-manager)
75+
76+
1. [Now CLI](https://zeit.co/download)
77+
78+
- Minimum version v2.x+
79+
80+
The project depends on the 'now-cli' to run and build. You can install it by running `npm i -g now`
81+
82+
1) [Git](https://git-scm.com/download/) (Familiarity with git is mandatory).
83+
84+
### Sending a Pull Request
85+
86+
*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)*
87+
88+
#### Running Locally
89+
90+
1. Fork the [repository](https://github.com/coderplex/donation-page).
91+
1. Then clone your forked repository
92+
```bash
93+
git clone <your forked repository url>
94+
```
95+
1. Move to the repository root folder
96+
```bash
97+
cd donation-page
98+
```
99+
1. [Yarn](https://yarnpkg.com)
100+
101+
* Minimum version v1.2.0+
102+
* Installing instructions are at [official docs](https://yarnpkg.com/en/docs/install#windows-tab). Use yarn over npm
103+
104+
> Our team's official policy (for now) is: We only use [Yarn](https://yarnpkg.com/en/docs/install) as our official Node package manager, and so we request you to use Yarn instead of npm and commit `yarn.lock` file.
105+
106+
1. Install dependencies
107+
```bash
108+
yarn
109+
```
110+
1. Setting up with few things, to get it running.
111+
This project uses some environment variables that hold the values required to make API calls to the API provided by [Razorpay](https://razorpay.com/) and [Airtable](https://airtable.com/). You can ignore this if you're just focussing on the frontend. But, you would need these, if you want to test the API calls made to process the payments or make changes to the API.
112+
113+
Create two files named `.env` and `.env.build` and those files should look something like this.
114+
contents of `.env` file:
115+
```
116+
RZP_TEST_KEY=YOUR_TEST_KEY(optional)
117+
RZP_TEST_SECRET=YOUR_TEST_SECRET(optional)
118+
RZP_LIVE_KEY=
119+
RZP_LIVE_SECRET=
120+
AIRTABLE_KEY=
121+
AIRTABLE_BASE_ID=
122+
AIRTABLE_TABLE_NAME=
123+
```
124+
125+
contents of `.env.build` file:
126+
127+
```
128+
RZP_TEST_KEY=YOUR_TEST_KEY(optional)
129+
RZP_LIVE_KEY=
130+
```
131+
1. Start the development server
132+
```bash
133+
yarn dev
134+
```
135+
Go to `localhost:3000` in the browser of your choice.
136+
> You may get this [error](#local-host-occupied) if any other app is already running the above port.
137+
138+
#### Before submitting
139+
140+
1. From your fork, create a [branch](https://help.github.com/articles/creating-and-deleting-branches-within-your-repository/) and name it accordinly. eg. `typo-in-readme` or `issue-resolve-6` or `patch-fix-3`
141+
1. If you’ve fixed a bug or added code that should be tested, add tests!
142+
1. Ensure that all test pass
143+
```bash
144+
yarn test
145+
```
146+
1. Run code formatters
147+
```bash
148+
yarn lint
149+
```
150+
1. Add and commit your code. Please give meaning full commit messages and add what you've changed or added in the decription in brief so that it can be easy for reviewers to understand.
151+
152+
#### Add yourself as a contributor
153+
154+
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
155+
156+
To add yourself to the table of contributors on the `README.md`, please use the automated script as part of your PR:
157+
158+
```bash
159+
yarn run add-contributor
160+
```
161+
162+
Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR.
163+
164+
#### Submitting PullRequest
165+
166+
1. Pull latest code from [upstream repository's](https://help.github.com/articles/merging-an-upstream-repository-into-your-fork/)`master`, if in case anything new were merged while you were working on your fork.
167+
1. Push the code to your fork.
168+
1. Raise the pull request from your created branch to `master` branch of coderplex.
169+
1. Take some time to give a brief description of the work you have done.
170+
171+
#### After submitting
172+
173+
1. Wait for all checks to pass in below section.
174+
> You might see a check fail from now-bot saying that there are failures in deployment. Don't worry about it, you don't have access rights to deploy. You can see the status of your check once any reviewer triggers the deployment.
175+
1. The core team will review your pull request and either merge it, request changes to it, or close it with an explanation.
176+
<!-- 1. Your changes are deployed with a unique link `https://deploy-preview-xx--coderplex.netlify.com`.
177+
178+
_`- xx` is your pull request number._ -->
179+
180+
181+
##### Received a review request
182+
183+
- Work on the requested changes
184+
- Push the changes as you did earlier, the pull request will automatically catch those and update itself.
185+
186+
### How to get in touch
187+
188+
- Coderplex [Discord Channel](https://discord.gg/ydaGAG)
189+
- Tweet core team members :
190+
- Vinay Puppal [@VinayPuppal](https://twitter.com/vinaypuppal)
191+
192+
## Appendix
193+
194+
### Node Version Manager
195+
196+
#### [nvm](https://github.com/creationix/nvm) for Linux & macOS
197+
198+
```bash
199+
# Installation
200+
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
201+
202+
# Install latest node lts
203+
nvm install --lts
204+
205+
# Use installed version
206+
nvm use --lts
207+
208+
# Run the app in the same terminal session
209+
```
210+
211+
_Make sure you have [curl](https://curl.haxx.se/) installed_
212+
213+
#### [nvm-windows](https://github.com/coreybutler/nvm-windows) for Windows
214+
215+
It comes with an [installer](https://github.com/coreybutler/nvm-windows#installation--upgrades).
216+
217+
```bash
218+
# Install particular version
219+
nvm install 8.9.1
220+
221+
# Use installed version
222+
nvm use 8.9.1
223+
```
224+
225+
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.
226+
227+
### Local host occupied
228+
229+
```js
230+
Error: listen EADDRINUSE :::3000
231+
at Object._errnoException (util.js:1024:11)
232+
at _exceptionWithHostPort (util.js:1046:20)
233+
at Server.setupListenHandle [as _listen2] (net.js:1351:14)
234+
at listenInCluster (net.js:1392:12)
235+
at Server.listen (net.js:1476:7)
236+
at app.prepare.then (/home/m-zubairahmed/github/official/coderplex-frontend/server.js:26:6)
237+
at <anonymous>
238+
at process._tickCallback (internal/process/next_tick.js:188:7)
239+
error Command failed with exit code 1.
240+
```
241+
242+
If you get this error while running `yarn dev` then probably another app is occupying `localhost:3000`. You may want to close that and run the command again.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ Coderplex Foundation is a registered non-profit organization that is working tow
99
- next.js
1010
- tailwindcss
1111

12+
## Contributing to this project
13+
14+
Everyone is welcome to contribute to this project. Please read the [CONTRIBUTING](https://github.com/coderplex/donation-page/blob/master/docs/CONTRIBUTING.md) document to see how you can set-up and contribute to the project.
15+
1216
## Contributors ✨
1317

1418
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"scripts": {
1818
"test": "echo \"Error: no test specified\" && exit 1",
1919
"dev": "now dev",
20+
"add-contributor": "all-contributors add",
2021
"format": "prettier --write './**/*.+(js|jsx|json|md)'"
2122
},
2223
"keywords": [],
@@ -35,12 +36,13 @@
3536
"react-dom": "^16.8.6"
3637
},
3738
"devDependencies": {
39+
"all-contributors-cli": "^6.8.1",
3840
"autoprefixer": "^9.6.1",
3941
"cssnano": "^4.1.10",
4042
"husky": "^3.0.2",
4143
"lint-staged": "^9.2.1",
42-
"next-purgecss": "^3.1.1",
4344
"next-manifest": "^2.0.0",
45+
"next-purgecss": "^3.1.1",
4446
"postcss-easy-import": "^3.0.0",
4547
"prettier": "^1.18.2",
4648
"tailwindcss": "^1.0.5"

0 commit comments

Comments
 (0)