Our apply website and server (Node.js + MongoDB)
Run from your terminal:
git clone git@github.com:dvcoders/dvcoders-apply.git
cd dvcoders-apply
npm installThen you need to create a .env file for the environment variables for your Github API key, Github User-Agent header, and Slack token:
GITHUB_API_KEY- Github API keyGITHUB_USER_AGENT- Your Github usernameSLACK_TOKEN- Slack tokenSLACK_WEBHOOK_URI- Slack webhook URI
Example:
GITHUB_API_KEY=9f869b245f49641b12137cb202ccb82c3f870eb9
GITHUB_USER_AGENT=dvcoders
SLACK_TOKEN=xoxp-1495209272-1796258573-9288732744-1b9d2f09
SLACK_WEBHOOK_URI=https://hooks.slack.com/services/X0AB9CDE0/A0B12CD3E/a6Bcde3fGh45iJKlmnOp
Make sure you have MongoDB running. On OSX, you can run:
brew install mongodb
brew services start mongodbUse nodemon to restart the server automatically when changes are made.
npm install -g nodemon
nodemon app.jsUse pm2 to handle log management and server crashes.
npm install -g pm2
cat <<EOF > server.json
{
"apps": [{
"name": "dvcoders-apply",
"script": "app.js",
"watch": true
}]
}
EOF
pm2 start server.jsonSet up all the required env variables, install development dependencies, and run from your terminal:
npm test