Slide 1

Slide 1 text

MINT SOURCE

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Andy Appleton @appltn http://mintdigital.com

Slide 4

Slide 4 text

What, why?

Slide 5

Slide 5 text

Node.js - Redis - Heroku CoffeeScript - Socket.IO

Slide 6

Slide 6 text

Simple Heroku deploy $ git clone [email protected]:mintdigital/mint-source.git $ heroku create appname --stack cedar $ git push heroku master $ heroku ps:scale web=1 $ heroku addons:add redistogo:nano $ heroku config:add NODE_ENV=production

Slide 7

Slide 7 text

Optional HTTP Auth $ heroku config:add AUTH_ENABLED=true $ heroku config:add AUTH_USER=chunky $ heroku config:add AUTH_PASS=bacon

Slide 8

Slide 8 text

http://github.com/user/project/admin/hooks

Slide 9

Slide 9 text

{ "before": "5aef35982fb2d34e9d9d4502f6ede1072793222d", "repository": { "url": "http://github.com/mint-digital/mint-source", "name": "mintdigital", "description": "A simple Node.js status board showing github commits and more.", "watchers": 5, "forks": 2, "private": 1, "owner": { "name": "mintdigital" } }, "commits": [ { "id": "41a212ee83ca127e3c8cf465891ab7216a705f59", "url": "http://github.com/mintdigital/mint-source/commit/41a212ee83ca127e3891ab7216a705f59", "author": { "email": "[email protected]", "name": "Andrew Appleton" }, "message": "Devs love bacon", "timestamp": "2011-11-15T14:57:17-08:00", "added": ["filepath.rb"] POST http://appname.herokuapp.com/github_prh

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Jenkins CI http://jenkins-ci.org/

Slide 12

Slide 12 text

Notification Plugin (post build hooks for Jenkins) https://wiki.jenkins-ci.org/display/JENKINS/Notification+Plugin

Slide 13

Slide 13 text

$ heroku config:add JENKINS_ENABLED=true http://your-ci-box/job/project-name/configure

Slide 14

Slide 14 text

{ "name":"bacon", "url":"http://devslovebacon.com", "build":{ "number":1, "phase":"FINISHED", "status":"FAILURE", "url":"job/project/5", "fullUrl":"http://your-ci-box/job/project/5" } } POST http://appname.herokuapp.com/jenkins_pbh

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

no HTTP auth support, so Jenkins box IP whitelisting $ heroku config:add JENKINS_IP=60.70.80.90

Slide 17

Slide 17 text

Discretion $ redis-cli > lpush Discretions "{\"orig\":\"secret\", \"subs\":\"public\"}"

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Last.fm http://www.last.fm/api

Slide 20

Slide 20 text

POST http://appname.herokuapp.com/github_prh $ heroku config:add LASTFM_ENABLED=true $ heroku config:add LASTFM_KEY=12345... $ heroku config:add LASTFM_USER=mintdigital Last.fm API credentials

Slide 21

Slide 21 text

Polling on the server, send data to clients via Socket.IO

Slide 22

Slide 22 text

What’s next?

Slide 23

Slide 23 text

app.get('/javascripts/:resource.js', (req, res) -> # Compile and serve client side CoffeeScript on the fly filePath = "./public/javascripts/#{req.params.resource}.coffee" fs.readFile(filePath, 'utf-8', (err, data) -> res.writeHead(200, {'Content-Type': 'application/javascript'}) res.write(coffee.compile(data)) res.end() ) ) CS > JS Caching

Slide 24

Slide 24 text

Server Sent Events (Possibly)

Slide 25

Slide 25 text

More Services Tweets, Foursquare checkins Generic notification endpoint

Slide 26

Slide 26 text

Available now on Github https://github.com/mintdigital/mint-source

Slide 27

Slide 27 text

http://devslovebacon.com