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

Creating a dashboard (phpworld)

Creating a dashboard (phpworld)

Freek Van der Herten

November 14, 2016
Tweet

More Decks by Freek Van der Herten

Other Decks in Technology

Transcript

  1. Creating a dashboard
    with Laravel,
    Vue and Pusher

    View Slide

  2. About me
    Freek Van der Herten
    Partner & developer at SPATIE
    @freekmurze
    https://murze.be

    View Slide

  3. Since 2003
    Websites, applications and webshops
    Team
    4 developers, 1 manager
    Specialization
    Laravel development

    View Slide

  4. OPEN SOURCE SOFTWARE

    View Slide

  5. Open source software
    ± 80 packages on Packagist
    + 1 200 000 downloads total, ±200 000 downloads a month
    A lot of benefits: learning, forced to write documentation and
    tests, showing the quality of our work, eating our own dogfood

    View Slide

  6. https://spatie.be/opensource

    View Slide

  7. OUR OFFICE

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. https://github.com/spatie/dashboard.spatie.be

    View Slide

  14. View Slide

  15. View Slide

  16. View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. HIGH LEVEL OVERVIEW

    View Slide

  24. The dashboard is a single HTML page
    Displayed by a full screen browser
    Without full page reload
    Each tile wil be updated by JavaScript
    Each tile has it’s own update frequency
    In short

    View Slide

  25. Technology stack
    Laravel Pusher Vue.js

    View Slide

  26. Laravel 5.3
    Render the initial page
    Fetch data from external API’s (scheduled)
    Broadcast events when new data has arrived
    Laravel

    View Slide

  27. spatie/laravel-google-calendar
    spatie/last-fm-now-playing
    spatie/packagist-api
    graham-campbell/github
    Laravel

    View Slide

  28. Provides full-duplex communication channels over a single TCP
    connection
    Transporting events from server to the browser
    In realtime
    Secure
    Paid service
    Pusher

    View Slide

  29. WebSockets
    Transporting events from server to the browser
    In realtime
    Secure
    Paid service
    Pusher

    View Slide

  30. Transporting events from server to the browser
    In realtime
    Secure
    Paid service
    Pusher
    Magic

    View Slide

  31. Lot of ♥ from the Laravel community
    Easy to learn
    Each tile is a component
    Listen for incoming events
    Update the tile
    Vue 2
    Vue.js

    View Slide

  32. DEMO

    View Slide

  33. Grid system
    The clock tile
    The Packagist tile
    Topics

    View Slide

  34. There will be 

    some live coding
    We’ll use 

    an internet connection

    View Slide

  35. DISPLAYING ON A TV

    View Slide

  36. Raspberry Pi 2

    View Slide

  37. Raspberry Pi 2
    Powered by the USB port from the TV
    Uses Raspbian Jessie
    Boots into Chromium 51 in fullscreen mode
    Setup

    View Slide

  38. TRY IT OUT YOURSELF

    View Slide

  39. Source code
    https://github.com/spatie/dashboard.spatie.be
    Blog posts
    https://murze.be/2016/06/building-dashboard-using-laravel-vue
    https://murze.be/2016/06/grid-layout-dashboard/
    Documentation

    View Slide

  40. ROUND UP

    View Slide

  41. https://laravel.com
    https://pusher.com
    https://vuejs.com
    https://vuecasts.com
    Interesting links

    View Slide

  42. https://www.geckoboard.com/
    http://www.cyfe.com/
    https://razorflow.com/
    http://dashing.io/ 

    Built by Shopify, Ruby. No longer maintained, but works great
    https://panic.com/statusboard/
    Alternatives

    View Slide

  43. Credits
    Willem Van Bockstal
    @willemvbockstal
    Looks + grid system
    Sebastian De Deyne
    @sebdedeyne
    Scrutinising + JS wizardry

    View Slide

  44. QUESTIONS?

    View Slide

  45. Thank you!
    https://speakerdeck.com/freekmurze/creating-a-dashboard-phpworld
    https://joind.in/talk/19484
    http://lanyrd.com/2016/phpworld/sfkfry/
    https://spatie.be/opensource
    https://murze.be
    https://murze.be/newsletter

    View Slide

  46. 2016
    2016

    View Slide