Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Node.js Dublin 2015 - Brewfactory: full-stack homebrew

Peter Marton
February 27, 2015

Node.js Dublin 2015 - Brewfactory: full-stack homebrew

Slides from the Node.js Dublin 2015 February

http://brewfactory.org/
http://www.nodejsdublin.com/

Peter Marton

February 27, 2015
Tweet

More Decks by Peter Marton

Other Decks in Programming

Transcript

  1. Brewfactory: full-stack homebrew
    Peter Marton
    @slashdotpeter

    View full-size slide

  2. $ whoami
    - work: RisingStack, Inc.
    - twitter: slashdotpeter
    - email: [email protected]
    - blog: http://blog.risingstack.com

    View full-size slide

  3. What is Brewfactory?
    - semi-automated brewing machine
    - hobby project
    - open-source project

    View full-size slide

  4. How to brew beer?
    (BIAB way)

    View full-size slide

  5. add water and malt

    View full-size slide

  6. hold temperature levels

    View full-size slide

  7. boil it and hops

    View full-size slide

  8. cool it fermentation

    View full-size slide

  9. bottle it enjoy!

    View full-size slide

  10. brewing sucks?
    … automate it!

    View full-size slide

  11. Brew like a boss

    View full-size slide

  12. What’s on the technology side?

    View full-size slide

  13. JavaScript everywhere
    2007 2015
    HW Microcontroller IoT devices from $10
    Control HW C, C++ Node.js:
    Johnny-Five, Tessel
    Web server .net, Java, PHP Node.js
    Database SQL MongoDB: JS API
    WebUI JavaScript: jQuery JavaScript: SPA
    (React, Angular etc.)

    View full-size slide

  14. Node.js in IoT
    - vibrant community
    - extreme modularity
    - high performance

    View full-size slide

  15. Johnny-Five
    - “jQuery of the IoT”
    - servo.to( 90 ); button.on(‘down’, fn);
    - Arduino compatible boards
    - Node.js

    View full-size slide

  16. Hardware parts
    - digital temp. sensor
    - DS18B20 (1-Wire)
    - heating elements
    - PWM (pulse-width modulation)
    - Relay (solid state)
    - controller
    - PID

    View full-size slide

  17. IoT device: RaspberryPi
    - credit-card sized
    - linux
    - usb ports
    - ethernet
    - NO built-in Wi-Fi
    - any languages

    View full-size slide

  18. IoT device: SparkCore
    - pint-sized
    - arduino compatible
    - built-in Wi-Fi
    - C++
    - Spark’s cloud

    View full-size slide

  19. Architecture

    View full-size slide

  20. Architecture

    View full-size slide

  21. BrewCore
    - Node.js ~0.12 / io.js
    - Koa
    - WebSockets
    - Spark’s cloud
    - https://github.com/BrewCore

    View full-size slide

  22. BrewMobile
    - Swift
    - Reactive Cocoa
    - WebSockets
    by @vasarhelyia

    View full-size slide

  23. BrewUI - Isomorphic
    - React app with Flux
    - CommonJS (Node style)
    - available as npm module
    - https://github.com/BrewUI

    View full-size slide

  24. Isomorphic JavaScript
    “JavaScript code that can be shared between
    environments.” - Spike Brehm

    View full-size slide

  25. Why is it good for me?
    - power of server rendering
    - SEO
    - legacy support
    - speed of Single Page Apps (SPA)

    View full-size slide

  26. Isomorphic server side

    View full-size slide

  27. Isomorphic client side

    View full-size slide

  28. Isomorphic challenges
    - data fetching: talk about this later
    - init app on both sides
    - singleton app on client -> request scoped on server

    View full-size slide

  29. Data fetching problem
    - environment specific problems
    - should be shimmed
    - same functionality and interface
    - different implementation: AJAX / WS / DB call / micro-service / ..
    - “Full Stack Flux”
    - Pete Hunt: React.js Conf 2015 - Full Stack Flux

    View full-size slide

  30. Demo
    (http://brewcore-demo.herokuapp.com)

    View full-size slide

  31. Contribute!
    github.com/brewfactory

    View full-size slide

  32. Q&A
    Thank you!
    http://brewfactory.org

    View full-size slide