Dongs n Stars
This application is a tracker for dong points (when someone does something stupid) and rockstar nominations (when someone does something noteworthy)
seting up dev environment
- Download the repo and run
npm install
- create a .env file in the root directory with the following paramters
- MAILGUN_USERNAME
- MAILGUN_PASSWORD
- MONGODB
- TOKEN_SECRET
- Ensure you have a mailgun account and fill in values accordingly
- MongoDB connection string can be local or hosted (e.x. mongolab)
- Token Secret should be a strongly generated alpha-numeric string
- Ensure gulp is install globally (possibly other dependencies if running throws dependency errors)
building
Run npm build
of gulp build
to build one JS application file and another JS template file in public/js
Run either 'npm start
developing
- Build -
npm build
- Start server -
npm
- Watch file changes -
npm watch
For use in visual studio code:
- Create a standard launch.json run file py pressing F5 and chooseing Node.js
- Create a new task
ctrl+shift+p
and type task
and choose configure task runner. Se sample below
- Run server with
F5
and then run watch task with ctrl+shift+p
and type task
and choose run task and choose default
- This should open up browser window with brosersync that will refresh with any front-end changes. For backend changes, you will have to restart the server.
.vscode/task.json
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"args": ["--no-color"],
"showOutput": "always",
"tasks": [
{
"taskName": "default",
"args": [],
"isBuildCommand": true,
"isWatching": true
}
]
}
deploying
only Heroku instructions included
- Create a heroku application
- Set global variables on heroku using CLI or the web console.
- MAILGUN_USERNAME
- MAILGUN_PASSWORD
- MONGODB
- TOKEN_SECRET
- Follow Heroku instructions here for setting a remote
- ansure any changes made are added/committed to git
- run
git push heroku master
to deploy
- ENJOY!