Slide 1

Slide 1 text

Building Do on Heroku

Slide 2

Slide 2 text

Gopal Patel, Director of Engineering gopal@do.com • @nixme github.com/nixme

Slide 3

Slide 3 text

Social Productivity Everywhere “ ”

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

SINGLE PAGE

Slide 7

Slide 7 text

SINGLE PAGE MOBILE FIRST

Slide 8

Slide 8 text

SINGLE PAGE MOBILE FIRST MANY CLIENTS

Slide 9

Slide 9 text

↑ ↓ RUBY Heroku Postgres, New Relic, Logplex… ADD-ONS iOS Android Desktop Widgets CoffeeScript + Backbone.js WEB APPS NATIVE CLIENTS CUSTOM UI FRAMEWORK

Slide 10

Slide 10 text

API First BEST PRACTICE

Slide 11

Slide 11 text

API First BEST PRACTICE

Slide 12

Slide 12 text

Build Platform API First BEST PRACTICE

Slide 13

Slide 13 text

Build Platform Separation of concerns. Modularity. API First BEST PRACTICE

Slide 14

Slide 14 text

Build Platform Separation of concerns. Modularity. Constraints lead to guided design API First BEST PRACTICE

Slide 15

Slide 15 text

Build Platform Separation of concerns. Modularity. Constraints lead to guided design Speak HTTP API First BEST PRACTICE

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

def hello puts 'Hello World!' end hello # => Hello World

Slide 18

Slide 18 text

class Note include SoftDelete def initialize(title = 'Untitled') @id = Sequence.next_id @title = title @body = 'Enter your note...' end def print puts "#{@id}: #{@title} - #{@body}" end end

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

VIEW MODEL CONTROLLER BROWSER ↑ ↓ ↑ ↓ ROUTER ↑ ↓ ↑ ↓

Slide 21

Slide 21 text

JSON MODEL CONTROLLER BROWSER ↑ ↓ ↑ ↓ ROUTER ↑ ↓ ↑ ↓

Slide 22

Slide 22 text

Notes Controller RUBY DEMO

Slide 23

Slide 23 text

The New Age of JS BIG MOVES

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

$('.name').bind('change', function(event) { $.ajax({ type: "PUT", url: "/names/" + $(event.target).attr('context_id'), data: { value: $(event.target).attr('data-value') }, success: function(response) { statusIcon = $('.name + .status'); statusIcon.show(); setTimeout(function() { statusIcon.hide(); }, 5000); }, error: function(response) { console.log(response); $('.name').attr('disabled', true); } }); }); $('.name_delete').click(function(event) { event.preventDefault(); id = $(event.target).attr('context_id'); if (confirm('Are you sure?')) { $.ajax({ type: "DELETE", url: "/names/" + id, success: function(response) { $(".row-" + id).remove(); $(".row-" + (id + 1)).focus(); },

Slide 26

Slide 26 text

No content

Slide 27

Slide 27 text

Backbone.Events binds and triggers

Slide 28

Slide 28 text

Backbone.Events binds and triggers Backbone.Router front-end routing, pushState

Slide 29

Slide 29 text

Backbone.Events binds and triggers Backbone.Router front-end routing, pushState Backbone.View controllers for your UI

Slide 30

Slide 30 text

Backbone.Events binds and triggers Backbone.Router front-end routing, pushState Backbone.View controllers for your UI Backbone.Model domain objects

Slide 31

Slide 31 text

Backbone.Events binds and triggers Backbone.Router front-end routing, pushState Backbone.View controllers for your UI Backbone.Model domain objects Backbone.Collection model sets

Slide 32

Slide 32 text

var object = {}; _.extend(object, Backbone.Events); object.on("alert", function(msg) { alert("Triggered " + msg); }); object.trigger("alert", "an event"); Backbone.Events

Slide 33

Slide 33 text

var Note = Backbone.Model.extend({ initialize: function() {…}, coordinates: function() {…}, }); var note = new Note({ title: "Today's Dinner", body: … }); note.on("error", function(model, error) {…}); note.save(); Backbone.Model

Slide 34

Slide 34 text

var DocumentRow = Backbone.View.extend({ tagName: "li", className: "document-row", events: { "click .icon": "open", "click .button.edit": "openEditDialog", "click .button.delete": "destroy" }, render: function() {…} }); Backbone.View

Slide 35

Slide 35 text

Do’s Router COFFEESCRIPT DEMO

Slide 36

Slide 36 text

Ember Knockout Spine

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

number = 42 flag = true greeting = 'world' var flag, greeting, number; number = 42; flag = true; greeting = 'world';

Slide 41

Slide 41 text

square = (x) -> x * x cube = (x) -> x * square x @customer = new Customer $('.cart').on 'click', (event) => @customer.buy event.target var cube, square, _this = this; square = function(x) { return x * x; }; cube = function(x) { return x * square(x); }; this.customer = new Customer; $('.cart').on('click', function(event) { return _this.customer.buy(event.target); });

Slide 42

Slide 42 text

kids = brother: name: "Max" age: 11 sister: name: "Ida" age: 9 var kids; kids = { brother: { name: "Max", age: 11 }, sister: { name: "Ida", age: 9 } };

Slide 43

Slide 43 text

for own view, element of views $(element).remove() view.removed = true var element, view, __hasProp = Object.prototype.hasOwnProperty; for (view in views) { if (!__hasProp.call(views, view)) continue; element = views[view]; $(element).remove(); view.removed = true; }

Slide 44

Slide 44 text

coffeescript.org

Slide 45

Slide 45 text

coffeescript.org sass-lang.com

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

BUNDLE (Sprockets) ↓ MINIFY (UglifyJS) COMPRESSION (GZIP) git push ↓ ↓

Slide 49

Slide 49 text

BUNDLE (Sprockets) ↓ MINIFY (UglifyJS) COMPRESSION (GZIP) git push ↓ ↓ ↑ ↓ → CLOUDFRONT ↑ ↓

Slide 50

Slide 50 text

web: unicorn -p $PORT -c ./config/unicorn.rb worker: rake resque:work QUEUE=notifications,... workerprovisioning: rake resque:work QUEUE=provisioning,... scheduler: rake resque:scheduler VERBOSE=true Procfile

Slide 51

Slide 51 text

BACKUPS • FORKING • FOLLOWING

Slide 52

Slide 52 text

No content

Slide 53

Slide 53 text

CONTINUOUS INTEGRATION AUTOMATED TESTING

Slide 54

Slide 54 text

CONTINUOUS DEPLOYMENT

Slide 55

Slide 55 text

CONTINUOUS DEPLOYMENT FEATURE FLAGS if Do.Flags.check ‘recurrence’ # Recurring Tasks Code

Slide 56

Slide 56 text

Design HOW WE DO

Slide 57

Slide 57 text

Design HOW WE DO User Experience is #1

Slide 58

Slide 58 text

Design HOW WE DO User Experience is #1 Engineering + Design = Like

Slide 59

Slide 59 text

Design HOW WE DO User Experience is #1 Engineering + Design = Like Design is a process / conversation

Slide 60

Slide 60 text

Design HOW WE DO User Experience is #1 Engineering + Design = Like Design is a process / conversation We work together. Everyone commits.

Slide 61

Slide 61 text

WHAT WAS THIS TALK ABOUT? API First Expressive Languages Modern Browsers Continuous Deployment

Slide 62

Slide 62 text

WHAT WAS THIS TALK ABOUT? API First Expressive Languages Modern Browsers Continuous Deployment Loosely-coupled Code Tightly-coupled Team

Slide 63

Slide 63 text

do.com

Slide 64

Slide 64 text

THE PANEL Manav Monga Product Guy. @xmanav Bing Yang Product Guy. @bsbox David Yung Developer. @azethoth Austin Bales Designer. @arbales http://pris.ma/9M