Skip to content

julian-margara/canoe

Repository files navigation

Canoe Tech Assessment for Remotely

Components

Setup

Requirements

  1. Docker
  2. Docker-compose - Follow instructions here: https://docs.docker.com/compose/install/

Steps

  1. Clone the repository
  2. Copy .env-example to .env.
  3. Build execute docker-compose build
  4. Start the environment docker-compose up -d
  5. Install PHP composer packages:
docker exec -it laravel php /usr/local/bin/composer install -d /var/www/html
  1. Run database migrations:
docker exec -it laravel php artisan migrate
  1. (Optional) Run database seeders (to insert dummy data on the DB):
docker exec -it laravel php artisan db:seed

Notes

  1. To destroy the whole environment, except for database data, docker-compose down
  2. To wipe database just remove the contents of docker/mysql_data directory
  3. If you need to apply any change of the configuration in docker/config directory just docker-compose stop && docker-compose up -d

Networking

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

Database data will be preserved and stored inside docker/mysql_data directory, this way rotating containers shouldn't have any impact.

How to use the MySQL container

  • 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

Apache configuration

Any apache configuration change can be edited inside docker/config/laravel.conf file

Database diagram

Database Diagram

Features:

API endpoints available over the prefix: /api/

  • List Funds:

    • 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
  • Update a Fund:

    • 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": [...],
        }
        

TO-DO:

  • Tests: Complete tests

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages