Slide 1

Slide 1 text

Creating a dashboard with Laravel, Vue and Pusher

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

OPEN SOURCE SOFTWARE

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

https://spatie.be/opensource

Slide 7

Slide 7 text

OUR OFFICE

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

No content

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

No content

Slide 23

Slide 23 text

HIGH LEVEL OVERVIEW

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

Technology stack Laravel Pusher Vue.js

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

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

Slide 30

Slide 30 text

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

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

DEMO

Slide 33

Slide 33 text

Grid system The clock tile The Packagist tile Topics

Slide 34

Slide 34 text

There will be 
 some live coding We’ll use 
 an internet connection

Slide 35

Slide 35 text

DISPLAYING ON A TV

Slide 36

Slide 36 text

Raspberry Pi 2

Slide 37

Slide 37 text

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

Slide 38

Slide 38 text

TRY IT OUT YOURSELF

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

ROUND UP

Slide 41

Slide 41 text

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

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

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

Slide 44

Slide 44 text

QUESTIONS?

Slide 45

Slide 45 text

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

Slide 46

Slide 46 text

2016 2016