This demo is meant to demonstrate several understandings:
- General understanding of PHP7 and OOP programming.
- Infrastructure and Ops with docker and bash scripts.
- Server management and configuration with Nginx Web Server and supervisor process manager.
- Web Socket subscriptions for passing real-time messages between clients via a server.
- The Laravel 6 framework and project structure in general.
- Authentication gated pages in web applications.
- External data sourcing via ajax network calls.
To test this demo in full locally follow the steps below:
You must have a .env file in the /laravel/ directory to inform laravel about the DB connections and the BROADCAST_DRIVER should be redis for development.
Service hostname variables need to match the hostnames inside the container network environment so:
REDIS_HOST=redis
REDIS_CLIENT=predis # predis is the client for this demo
DB_HOST=mysqldb
note: This is assuming Docker and Docker-Composer are installed and this is a Unix machine
git clone https://github.com/jbool24/laravel6-demo.git
note: laravel container will auto install js and php dependencies on first run if they are not present.
cd laravel && npm install && composer install
-or-
cd laravel && yarn install && composer install
npm run start:dev
-or-
yarn start:dev
note: laravel container will auto install js and php dependencies on first run if they are not present.
cd laravel && npm run prod
-or-
cd laravel && yarn prod
npm run db:migrate && npm run app:genKey
-or-
yarn db:migrate && yarn app:genKey
note if broadcast updates not working try running yarn app:reset-servers
to restart nginx and socket server.
The containers may have started out of order causing a failure to connect. (future improvement to startup script)
npm run stop
-or-
yarn stop