- Framework: Laravel 10.x
- Docker
- Docker-compose - Follow instructions here: https://docs.docker.com/compose/install/
- Clone the repository
- Copy
.env-example
to.env
. - Build execute
docker-compose build
- Start the environment
docker-compose up -d
- Install PHP composer packages:
docker exec -it laravel php /usr/local/bin/composer install -d /var/www/html
- Run database migrations:
docker exec -it laravel php artisan migrate
- (Optional) Run database seeders (to insert dummy data on the DB):
docker exec -it laravel php artisan db:seed
- To destroy the whole environment, except for database data,
docker-compose down
- To wipe database just remove the contents of
docker/mysql_data
directory - If you need to apply any change of the configuration in
docker/config
directory justdocker-compose stop && docker-compose up -d
All containers (laravel, mysql, mailpit) share a virtual network on which they communicate.
Docker provides DNS resolution based on container name for its networking layer.
If you need to reach one container from another container (eg: "laravel" needs to communicate with "mysql") you can do that by using their names instead of IP in any configuration file.
Database data will be preserved and stored inside docker/mysql_data
directory, this way rotating containers shouldn't have any impact.
- MySQL user: root
- MySQL pass: test
- MySQL host: mysql (See Networking section)
- MySQL port: 3306
Note: from developer's local you can reach mysql via localhost to port 3306
Any apache configuration change can be edited inside docker/config/laravel.conf
file
API endpoints available over the prefix: /api/
-
- Method: GET
- Endpoint: /funds
- Parameters:
- name (optional): string => Filter by Fund name
- year (optional): int => Filter by Fund start year
- fund_manager_id (optional): int => Filter by Found Manager ID
-
- Method: PUT
- Endpoint: /fund/[fund_id]
- Parameters:
- fund_id (required): int => ID of a Found
- Body: (JSON)
- name (optional): string => Name
- aliases (optional): []string => Array of aliases
- start_year (optional): int => Start year
- fund_manager_id (optional): int => Found Manager ID
- companies (optional): []int => Array of Companies IDs
{ "name": ..., "aliases": [...], "start_year": ..., "fund_manager_id": ..., "companies": [...], }
- Tests: Complete tests