Starter kit for the Kobe coding challenge, using Lumen and Vue.
# Build docker containers
cd kobe-coding-challenge
docker-compose build
# Run all
docker-compose up
# Run commands inside containers
docker-compose exec <container> <command>
# e.g. docker-compose exec lumen-api php artisan migrate
Lumen backend: http://localhost:8000/ Vue frontend: http://localhost:3000/
This section will be constantly updated / appended throughout the project until completion.
The following are personal notes taken, during the development of this project:
- Modified Dockerfile to resolve installation of
mysql-client
, resolved tomariadb-client
. docker-compose.yml
config forvue-spa
port is open to8080
.phpmyadmin
is an additional image, built together among the otherdocker
images.
- Perform the following steps, to build and run docker images:
If there is an issue with rebuilding, perform the tasks below then rinse-and-repeat:
# Proceed to project folder. cd kobe-coding-challenge-starter # Builds, recreates, starts, and attaches to containers for a service (along with building the images, before starting the containers). docker-compose up -d --build # Run migrations, seeding is optional. docker-compose exec lumen-api php artisan migrate --seed # Run migrations with refresh, seeding is optional. docker-compose exec lumen-api php artisan migrate:refresh --seed
# Stop all found processes docker stop $(docker ps -a -q) # Remove all found processes docker rm -f $(docker ps -a -q) # Spin them up again. docker-compose up -d --build # Run cache:clear once in a while, if required. docker-compose exec lumen-api php artisan cache:clear
- Import and prepare your POSTMAN collection of example API requests (optional):
It is located at the project root folder, where you'll be able to run example API requests. This file is constantly updated when there's continued development on the
./KOBE-Coding-Challenge-Starter.postman_collection.json
lumen-api
application. Also, a useful collection to perform internal tests with thelumen-api
application. - Connect to your
docker
containers:- lumen-api (lumen) - http://localhost:8000
- vue-spa (vue) - http://localhost:8080
- db (mysql) - hostname:db, port:3306, database:lumen auth:root/root
- phpmyadmin - http://localhost:8082
- Proceed to define and update
Dockerfile
build configurations (and fixes), along withcomposer
andyarn
requirements. - Start building with
lumen
andvue
.
- Define the
Dockerfile
build configurations forphp
andnginx
, along withcomposer.json
requirements. - Enable
eloquent
andfacades
. - Define
user
MVC (with migration files), and overrideAuthenticate.php
middleware to use api token authentication. - Added
phpmyadmin
todocker-compose.yml
image build. - Proceeded to turn on middleware for user authentication.
- Proceeded further to add
LoginController
functions, for user login and validation.