Demo is build with Lumen for the back-end and Vue.js for the front-end. Pusher is used for realtime broadcasting/synconizing of scores.
This demo was tested with a current version of Laravel Homestead, but other setups should work as well, as long as following minimum requirements are fulfilled:
PHP >= 5.5.9
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
MySQL/MariaDB/Sqlite3/Postgres
-
run
composer install
-
open file .env and adjust settings
-
setup database according to name specified in .env file
-
run
php artisan migrate
(will create "players" table in db) -
run
php artisan db:seed
(will create 6 player with a random name and random score)
- Add (unit)-tests to test functionality
- replace jQuery with vue-resource, because jQuery is only really used for AJAX calls and vue-resource has less overhead
- test other broadcasting driver (Redis)
- I tried to use PHP and multiple database operations for this demo, which is possibly slower that a full front-end approach
- Caching of player-list that clients request