Job board which open source projects can use to find design contributors.
Server
express
Backend frameworkexpress-session
Express code modulebody-parser*
Express core modulecookie-parser
Express core moduleerrorhandler
Express error handlercompression
Enables gzip compression for expressejs
Template language for express html filesmongoose
Library for managing data in MongoDBnode-jsx
Just-in-time JSX parses to require .jsx files in nodepassport
Authentication librarylog4js
Provides better logging than console.log
Client
bluebird
Best available promise libraryflux
Facebook's flux library which provides Dispatcherreact
Core react libraryreact-router
Router implemented with react
Note that some of the client libraries are also used in server in initial render
Development
autoprefixer
CSS postprocessor which adds vendor prefixesbrowserify
Module loader to organize client-side codereactify
Browserify transform to support JSX syntaxwatchify
Faster version of browserify for local developmentclean-css
CSS minifiernode-inspector
Node debugger. Used in npm run debug-serverstylus
CSS preprocessor like SASS/LESSuglify-js
JS minifierwatch
Watches changes in a directory and runs given command
All parts of the service are hosted in Heroku. There are two environments:
These environments are replicants of each other, they both have these addons:
- MongoLab for database
- Papertrail for centralized logging handling
- Heroku builds our web app after each deployment, we have build tools in devDependencies. That's why
NPM_CONFIG_PRODUCTION
is set tofalse
. See https://devcenter.heroku.com/articles/nodejs-support
Guide to get the environment running in your local machine.
-
Node.js + npm tools
-
Heroku toolbelt
-
MongoDB
-
Editorconfig to your editor
This way text formatting is consistent within team
-
JSHint to your editor
Add environment variables to local-env.sh
.
See local-env.sh.sample for an example configuration.
Add heroku remotes to your git repo:
git remote add qa [email protected]:designopen-board-qa.git
git remote add prod [email protected]:designopen-board.git
If you don't have rights to push to the remote and get this error: Permission denied (publickey)
. See Adding keys to Heroku.
In project root:
npm install
This project uses npm scripts as task automation.
To start local server:
- In first terminal, run
npm start
in the root of the project - In second terminal, run
npm run watch
. That'll watch changes in stulys and jsx files.
There's no live reload.
Database migrations are handled with node-db-migrate. When creating new migration scripts, see their API documentation. Important: Their MongoDB driver does not implement many of the functions mentioned in API, check source code. They have documentation also here: http://db-migrate.readthedocs.org/en/v0.9.x/.
Note: to use db-migrate
command, you must install it globally with npm install db-migrate -g
, otherwise you have to use: ./node_modules/db-migrate/bin/db-migrate
.
Whenever you have data changes in models, you must create a new migration script:
db-migrate create descriptive-name-for-the-migration
- Edit the created migration script template in
./migrations/
Migration shortcuts
Release flow:
-
Merge changes to master
-
Wait for green light in CI
-
Push changes to desired environment, for example qa:
git checkout master git push qa
You can also release a certain local branch. For example releasing from node branch to qa:
git push qa node:master
-
Check that the environment responds and logs look ok