| Prerequisite | Version |
|---|---|
| MongoDB | ~ ^3 |
| Node.js | ~ ^6 |
| npm (comes with Node) | ~ ^3 |
Updating to the latest releases is recommended.
Before you start working, you will need to create a separate branch specific to the issue / feature you're working on. You will push your work to this branch. All pull requests to devCircle should be made against the 'develop' branch. Any pull requests against the master branch will be auto closed without review.
Name the branch something like fix/xxx or feature/xxx where xxx is a short description of the changes or feature you are attempting to add. For example fix/email-login would be a branch where you fix something specific to email login.
To create a branch on your local machine (and switch to this branch):
$ git checkout -b [name_of_your_new_branch]If you need more help with branching, take a look at this.
There are a few API keys that you'll have to create files for in order for localhost setups to work.
Create a file named config.js, place it in server/app/githubAPI, and structure like so:
module.exports = '' //your token hereCreate a file named auth.js, place it in server/config, and structure it like so:
module.exports = {
'github':{
'clientID': '', //token here
'clientSecret': '', //secret key here
'callbackURL': 'http://localhost:4000/auth/github/callback'
}
};Once you have devCircle cloned, before you start the application, you first need to install all of the dependencies:
# Install NPM dependencies
npm installNow you will need to start MongoDB, then you can start the application:
# Start the mongo server in a separate terminal
mongod
# Build devCircle
# This will create a production build of the app.
# This command should be run whenever you
# make any changes to the React components.
npm run build
# start the node server
node serverNow navigate to your browser and open http://localhost:4000.
Here are a few loose rules to follow when contributing code:
- Spaces over tabs.
- Space Size should be 4 for all javascript files, except those that have JSX, in which case size should be 2.
- Single quote over double quote, except where apostrophies must be escaped.
- String interpolation over string concatenation.
- Prefer fat arrow functions for anonymous functions, except where lexical 'this' would otherwise be a problem.
- Const for assignments, except where reassignment is necessary, then use let.
- Prefer single purpose functions.
- Avoid side effects in functions.
- Avoid implied returns in multi-line arrow functions, except for JSX.
- HTML: dash-case.
- Javascript: camelCase.
- Database: snake_case.