My future website, "Dilemme", French website based on either.io concept.
Work in progress.
Install and run
MongoDB is required.
Environment variables have to be set in a ".env" file at the root of the project (see
.env.sample file) (I use dotenv).
7 environment variables are required :
NODE_ENV: "development" or "production"
ROOT_PATH: root URL (for example : http://dilemme.io, or http://localhost:3131) WITHOUT trailing slash but WITH leading "http://"
MONGO_URI: database URI, with user and password if required
MONGO_TEST_URI: test database URI, with user and password if required (only if you want to run tests)
GMAIL_USER: GMail user for sending mail
GMAIL_PASSWORD: GMail password for sending mail
FB_ID: Facebook app ID, used for Facebook authentication (create an app on Facebook developper website)
FB_SECRET: Facebook app secret
TWITTER_ID: Twitter app ID, used for Twitter authentication (create an app on Twitter developper website)
TWITTER_SECRET: Twitter app secret
GOOGLE_ID: Google app client ID, used for Google authentication (create an app and a client for the app on Google developper console and enable Google+ API access)
GOOGLE_SECRET: Google app client secret
CODACY_SECRET: Codacy token, used to send test coverage data to Codacy with Gulp
$ npm install -g gulp $ npm install -g bower
Classic stuff to launch the application :
$ npm install $ bower install $ gulp build $ node server
On the first start, sample data will be automatically pushed to the database.
Then go to http://localhost:3131 and everything should be fine.
Default admin credentials are 'joe'/'joe'.
Useful Gulp tasks
$ gulp build
- Concat and minify JS files
- Build Stylus files to CSS, concat and minify CSS
- Compile Jade views to HTML
$ gulp lint
- Run JSHint on sources
- Run JSCS on sources using Google JS Code Style customized with two rules :
- No limitation for line length
- Trailing white spaces forbidden
$ gulp watch
- Launch server.js using gulp-nodemon
- Watch for any change in JS sources (client side) and rebuild them
- Watch for any change in Stylus sources and rebuild them
- Same for Jade files
- Watch for any change in JS files inside of /server directory and relaunch server.js
$ gulp debug
- Launch server.js with debug port set to 3132
- Watch files like the
$ gulp test
- Launch tests (only some tests server side for now, work in progress)
- Generate coverage report in
Populate database with sample data
$ gulp init-db
- Delete everything in the database and populate it with sample data (from