This guide is specific for Linux SO.
- Clone this repository
git clone git@github.com:giornn0/challenge-7freight.git
Now choose between continuing the setup with docker or with native tools.
Follow the list.
- Copy the .env.example
cp .env.example .env
Don't change anything inside this file
- Build app image and setup the necessary containers:
podman-compose up -d
- Get inside the app container:
podman exec -it challenge-app bash
- Run database migrations and seeders:
php artisan migrate --seed
- Exit the app container:
exit
If you have docker, replace podman with docker, and podman-compose with docker-compose.
- Make sure you have the next tools installed:
Name | Version |
---|---|
php | > 8.2 |
composer | > 2.7 |
mysql | 8.0 |
- 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
- Install dependencies:
composer install
- Run database migrations and seeders:
php artisan migrate --seed
- Run application:
php artisan serve
Check the next requests with their corresponding method:
GET Available Classes.
- Response: { data: Array<{ nameClass: { start: Time, end: Time, classBlockId: int } }>}
POST Book Class Block.
- 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.
- In case of error with laravel.log file, regarding access to write file (mostly happens with docker) run:
chmod -R 777 storage
The Laravel framework is open-sourced software licensed under the MIT license.