We love pull requests from everyone. Any contribution is valuable, but there are two issue streams that we especially love people to work on:
-
Our delivery backlog, is managed via a ZenHub board (ZenHub extensions are available for most major browsers). We use a Kanban-style approach, whereby devs pick issues from the top of the backlog which has been organised according to current priorities. If you have some time and are interested in working on some issues from the backlog, please make yourself known on the [#dev][slack-dev] channel on Slack and we can direct you to the most appropriate issue to pick up.
-
Our list of bugs and other self-contained issues that we consider to be a good starting point for new contributors, or devs who aren’t able to commit to seeing a whole feature through. These issues are marked with the
# good first issuelabel.
-
Clone the repo:
-
Set up your development environment:
- Install
node 12.* - Run
npm installto install dependencies - Install
docker
- Install
-
Configure app:
- Check Configuration Section for configuration instructions
- Check
/.env.samplefile for required variables
-
Start the app
4.1 Working on client-side only
docker-compose -f ./docker-compose.all.yml up4.2 Working on both
-
Start all app dependencies in a containers
docker-compose -f ./docker-compose.yml up -
Start app
npm start
-
-
Client-side development
Check client/README.md for instructions
| Environment variable | Command-line argument | Format | Default value | Description |
|---|---|---|---|---|
NODE_ENV |
nodeEnv |
production/development/test | development | |
HOST |
ipAdress |
ipaddress | 0.0.0.0 | The IP address to bind. |
PORT |
port |
port | 7000 | The PORT to bind. |
COOKIE_SECRET |
cookieSecret |
String | super-secret | Secret used to sign cookies |
LOG_LEVEL |
logLevel |
error/warn/info/verbose/debug/silly | debug | - |
DEPLOY_ENV |
deployEnv |
String | develop | Deployment environment name |
DB_USERNAME |
dbUsername |
- | - | - |
DB_PASSWORD |
dbPassword |
- | - | - |
DB_HOST |
dbHost |
String | localhost:27017 | - |
DB_NAME |
dbName |
String | accept-dev-local | - |
COGNITO_CLIENT_ID |
cognitoClientId |
String | request | AWS Cognito "App client id" |
COGNITO_CLIENT_SECRET |
cognitoClientSecret |
String | request | AWS Cognito "App client secret" |
COGNITO_DOMAIN |
cognitoDomain |
String | request | AWS Cognito "Domain name" |
COGNITO_REGION |
cognitoRegion |
String | request | AWS Cognito Region |
COGNITO_USER_POOL_ID |
cognitoUserPoolId |
String | request | AWS Cognito User Pool ID |
COGNITO_LOGIN_REDIRECT_URI |
cognitoLoginRedirectUri |
url | request | AWS Cognito App Client LOGIN redirect_uri |
COGNITO_LOGOUT_REDIRECT_URI |
cognitoLogoutRedirectUri |
url | request | AWS Cognito App Client LOGOUT redirect_uri |
CLOUDINARY_CLOUD_NAME |
cloudinaryName |
String | request | Cloudinary Clound name |
CLOUDINARY_API_KEY |
cloudinaryApiKey |
String | request | Cloudinary API Key |
CLOUDINARY_API_SECRET |
cloudinaryApiSecret |
String | request | Cloudinary API Secret |
BLOCKCHAIN_HTTP_ADDRESS |
blockchainHttpAddress |
String | request | Blockchain address for HTTP provider |
BLOCKCHAIN_WS_ADDRESS |
blockchainWsAddress |
String | request | Blockchain address for WebSocker provider |
BLOCKCHAIN_TOKEN_CONTRACT_ADDRESS |
tokenContractAddress |
String | request | Token contract address |
BLOCKCHAIN_TOKEN_SPONSOR_ADDRESS |
tokenSponsorAddress |
String | request | Token Sponsor Public Address |
BLOCKCHAIN_TOKEN_SPONSOR_PRIVATE_KEY |
tokenSponsorPrivateKey |
String | request | Token Sponsor Private Key |
There are several ways to provide configuration options and variables.
We're using dotenv + convict
In the following order of precendence:
-
Command line arguments.
$ npm start --someVariable 10
-
Environment variables.
$ SOME_VARIABLE=10 npm start
-
Variables defined in
/.envfilepreferred for local development
eg. contents of
/.envfileSOME_VARIABLE=10 -
Configuration in
/config/env/*.jsonfilesdepends on environment name (
development|production|test)eg. contents of development.json
{ "someVariable": 10 } -
Defaults specified in
/config/index.jsfile as part of schemaeg. schema definition
// ... someVariable: { doc: 'Some sample variable', format: Number, default: 10, arg: 'someVariable', env: 'SOME_VARIABLE' }, // ...
Application depends on some live 3rd-party services. In order to develop locally you'll need to provide these values.
Please contact Placeholder Name placeholder@name.com
We'll use slightly modified git flow.
Please read and refer from now on to Atlassian Git Flow and Root
-
master- contains production-ready code, should be always clean and ready to be deployed to production environment -
development- contains complete code(no WIP code), only this branch will be merged tomaster -
feature/*- feature branches. Always created from developMUST contain issue ID and short description. eg.
feature/123-some-short-description -
fix/*- bugfix branchesMUST contain issue ID and short description. eg.
fix/123-bug-description
- Make sure everything works as expected
- Make sure linter and tests pass
- Write a good commit message. And don't forget to include ticket ID in commit message, if applicable. So that commit message will look like
#123 short commit summary in imperative form
detailed description, if necessary
TODO complement
Before opening a pull request, make sure:
-
Task is completed/implemented according to task description
-
All existing unit tests pass, if applicable
-
You've implemented unit tests for your task, if applicable
-
You've run local build and tested your task there
-
No lint errors, you did everything possible to reduce amount of warnings as much as possible
-
Make sure there won't be any conflicts
git checkout master git pull --rebase origin master git checkout feature/your-feature-branch-name git rebase master OR git checkout master git pull --rebase origin master git checkout feature/your-feature-branch-name git merge master --no-ff
Only then, feel free to open pull request.
Once PR is reviewed by required teammates, it will be merged back to develop.
NOTE!
We're not using fast-forward and squash when merging, use
--no-ff, DO NOT use--squashor--ff
Nodejs 8.10, npm, yarn
- npm install
- npm run lint
- npm test
- cd client
- npm install
- npm run test
- cd ..
- npm run build:client
Should contain
package.json
package-lock.json
app.js
/app
/config
/public
/migrations
Add COGNITO_CUSTOMIZER_ACCESS_KEY_ID, COGNITO_CUSTOMIZER_SECRET_ACCESS_KEY and COGNITO_REGION in .env file OR specify those in your environment variables
npm run cognito:upload:customization
To create migration script run
node ./scripts/migrate.js create my-test-migration
this will create migration script ${date}-my-test-migration.js in ./migrations folder