Architecture walk through => http://youtu.be/e0N_2T7Tdf8
-
ALL work is to be done on topic branches & merged into master w pull requests
-
master is ongoing development branch
-
prod represents the current deployed code @ airpair.com
-
milestones are tagged with
git tag release/v0.M.m.x prod
-
reverts can be achieved using
git checkout -b prod release/v0.M.m.x prod
-
Install mongoDB
-
Install brunch.io & coffee-script
npm install brunch coffee-script -g
-
Run mongo
mongod
-
Install npm package
npm install
OPTIONAL: Setup a split-window terminal for steps 5a and 5b
5a) Run brunch server brunch w
to keep browser coffee files compiled and up-to-date
5b) Run npm start
to fire up the server (will reload on changes)
-
Open browser @ http://localhost:3333/
-
For testing, install PhantomJS & mocha-phantomjs & jake
npm install -g mocha mocha-phantomjs phantomjs jake
-
Run "npm run hooks" to set up the pre-push hooks"
Runs in node with mocha via jake (e.g api tests)
jake test:server
hit html & make http requests in browser or w PhantomJS
- Run brunch in test mode (test db/users etc.)
`brunch w -e test`
- Then execute tests
`http://localhost:4444/test/index.html` (in browser w mocha)
`mocha-phantomjs http://localhost:4444/test/index.html` (in terminal w mocha-phantomjs)
Tests should run on every push. To setup locally
cd .git/hooks
ln -nsf ../../build/git-hooks/pre-push
- docs on expect syntax chaijs.com/api/bdd/
- docs on using spy/fake/stub sinonjs.org/docs/
- docs on sinon chai syntax chaijs.com/plugins/sinon-chai
CSS lives in 3 places
-
'/vendor/styles' Vendor
-
/app/assets/css
Gets copied to /public/css and read as is -
/app/css
Gets compiles and combined per settings in/config.coffee
Files structured and combined into:
- [ap.css]
/app/styles/ap/*css
/app/styles/shared/*css
Styles for front end inheriting the WordPress epik theme which is an exact copy of the one served from the blog athttp://www.airpair.com/wp-content/themes/epik/style.css
( if dev node offline, can't work+ slower to load ) ( Add hack in dev to read local-copy ) | (PROB can't pull https: YET) )
--- [adm.css]
/app/styles/adm/*css
/app/styles/shared/*css
Styles and page layout relevant to "backend" administrator pages inheriting from bootstrap.
- the view redirects on success. solution:
v.renderSuccess = ->
- the view hasnt loaded data yet; wait for the models/collections to sync
- the story's step does not exist
- the story's step uses the wrong router