This document will serve as a setup guide for this appilcation.
- Docker
- PHP 8.2
- Laravel 10
- Composer
- Angular
The docker-composer.yml includes the following services
This container runs the backend api laravel application
This container runs the frontend app angular application
This runs the mysql database uses by the backend api for data store
The redis service is used by the backend api for queuing. The idea is to queue very large CSV files and process in batches to avoid over working the server resources
This runs the webs server for serving the frontend and backend pages
- Add these to your
/etc/hosts
127.0.0.1 api.pokemon.test
127.0.0.1 pokemon.test
- From inside the pokemon directory, to build and start the containters
docker compose up -d
If you experience permission issues, please try, which will try to build the api image with your user id and group id
GROUPID=$(id -g ${USER}) USERID=$(id -u ${USER}) docker compose build --no-cache && docker compose up -d
NB: This will try to run the application on the following ports
- 80 : Web server
- 3306 : MySQL server
- 6379 : Redis server
- 4200 : App development server
- Install composer packages in the backend api
docker compose exec -it api composer install
- Run migration and seeders
docker compose exec -it api php artisan migrate:fresh --seed
- Running Laravel tests This application uses the Laravel Pest tests. The test covers the application requirements.
docker compose exec -it api php artisan test
- Build the frontend app
docker compose exec -it app ng build
- Visit frontend app
NB: The backend api provides the following endpoints, which are being called by the frontend
GET|HEAD api/pokemons ............................. pokemons.index › PokemonController@index
POST api/pokemons/import ...................... pokemons.import › PokemonController@import
NB: Frontend development enviroment is accessible on http://localhost:4200/