Job board which open source projects can use to find design contributors.
Server
expressBackend frameworkexpress-sessionExpress code modulebody-parser*Express core modulecookie-parserExpress core moduleerrorhandlerExpress error handlercompressionEnables gzip compression for expressejsTemplate language for express html filesmongooseLibrary for managing data in MongoDBnode-jsxJust-in-time JSX parses to require .jsx files in nodepassportAuthentication librarylog4jsProvides better logging than console.log
Client
bluebirdBest available promise libraryfluxFacebook's flux library which provides DispatcherreactCore react libraryreact-routerRouter implemented with react
Note that some of the client libraries are also used in server in initial render
Development
autoprefixerCSS postprocessor which adds vendor prefixesbrowserifyModule loader to organize client-side codereactifyBrowserify transform to support JSX syntaxwatchifyFaster version of browserify for local developmentclean-cssCSS minifiernode-inspectorNode debugger. Used in npm run debug-serverstylusCSS preprocessor like SASS/LESSuglify-jsJS minifierwatchWatches 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_PRODUCTIONis 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 startin 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