Setup

This guide is specific for Linux SO.

  1. Clone this repository
git clone git@github.com:giornn0/challenge-7freight.git

Now choose between continuing the setup with docker or with native tools.

Docker/Podman

Follow the list.

  1. Copy the .env.example
cp .env.example .env

Don't change anything inside this file

  1. Build app image and setup the necessary containers:
podman-compose up -d
  1. Get inside the app container:
podman exec -it challenge-app bash
  1. Run database migrations and seeders:
php artisan migrate --seed
  1. Exit the app container:
exit

If you have docker, replace podman with docker, and podman-compose with docker-compose.

Native

  1. Make sure you have the next tools installed:
Name Version
php > 8.2
composer > 2.7
mysql 8.0
  1. Copy the .env.example.local-sql:
cp .env.example.local-sql .env

Inside this file, you need to put some credentials for your mysql access. Change DB_USERNAME and DB_PASSWORD accordingly

  1. Install dependencies:
composer install
  1. Run database migrations and seeders:
php artisan migrate --seed
  1. Run application:
php artisan serve

Explore

Check the next requests with their corresponding method:

  • Response: { data: Array<{ nameClass: { start: Time, end: Time, classBlockId: int } }>}
  • Body: { sudentId: int, classBlockId: int}

DELETE Booked Class.

  • QUeryParameters: { sudentId: int, classBlockId: int}

We also provide an Insomnia json (challenge-insomnia-collection.json) for testing the endpoint.

Possible Errors

  • In case of error with laravel.log file, regarding access to write file (mostly happens with docker) run:
chmod -R 777 storage

License

The Laravel framework is open-sourced software licensed under the MIT license.