This project aims to develop a platform to help Santa Claus and his elves manage the toy factory and organize the gift list for children during the Christmas season.
The application includes an intuitive and functional interface as well as an API that allows the elves to perform various essential tasks, such as managing toys.
With this system, Santa Claus will be able to ensure that each child receives the perfect gift, thus ensuring a magical Christmas.
❄️⛄ Home View ⛄❄️:
- It is the main welcome page which includes two tables with the counts of children and toys available.
- There are 3 buttons that allow us to move to any view without any problem.
- It has an effect of snow moving up and down the page and a congratulatory text that moves from right to left in the footer.
-
The ‘Santa’ view includes a table listing all children who will receive gifts.
-
Depending on the status of the child (good or bad) they will receive toys or coal.
-
It includes a ‘show’ button to see all the information about the child and their gift.
❄️⛄ Elves View ⛄❄️:
-
The ‘Elves’ view includes a table with a list of the gifts that the elves made.
-
Each toy has a description and a recommended age range, which can be modified from the view.
-
Each toy has a ‘show’ button to see more information about the toy.
In order to run this project locally, you need:
-
XAMPP (or any other local server that supports PHP and MySQL)
-
A modern web browser
-
VSC Terminal
-
Composer
-
Node.js (install npm)
-
xdebug (for tests coverage)
-
Postman (or any other platform to use for API)
- Install project with git clone
git clone https://github.com/issamchlf/Santa-claus-factory.git
- Install composer:
composer install
- Install NPM:
npm install
- Create an ".env" by taking the example ".env.example" file and modify:
- DB_CONNECTION=mysql
- DB_DATABASE=chrismas_toy_factory
Important
You can create the database name as you wish, just remember to include that name in the ‘database’ in the ‘.env’ file and uncomment the paragraph.
- Create a database in MySQL
- In the database manager “phpMyAdmin” of MySQL create only the database without tables.
- Generate the tables from the terminal and then run migrate to upload the changes to the database.
- Migrate the tables:
php artisan migrate:fresh --seed
- Run Locally:
- Run NPM in one terminal.
npm run dev
- Run Laravel in another terminal.
php artisan serve
To run test you should uncomment the following lines on the phpunit.xml file.
To run the project tests, use the following command:
php artisan test --coverage
- This project has a 99,4% of test coverage.
You can also see the coverage in a web browser using:
php artisan test --coverage-html=coverage-report
- A folder called coverage-report will also have been generated with 99.44% coverage.
Below is a diagram of the database, showing different relationships between tables:
- kids: One to many relationship. One child can receive many toys.
- toys One to many relationship. One toy can receive several children.
- toy - minimum_age: One to many relationship. A minimum age can have many toys, but each toy belongs to only one minimum age.
- kid_toy (pivot): many to many relationship. The pivot table can receive as many children as toys.
We have two tables: Kids and Toys you can create, edit, delete or read a toy or kid from Postman.
Santa is in charge of the list of children who receive presents and the elves are in charge of making the toys.
GET (read all kids):
http://127.0.0.1:8000/api/santa
GET (read one kid):
http://127.0.0.1:8000/api/santa/{id}
POST (create a new kid):
http://127.0.0.1:8000/api/santa
PUT (edit one kid):
http://127.0.0.1:8000/api/santa/{id}
DELETE (delete an kid):
http://127.0.0.1:8000/api/santa/{id}
GET (read all toys):
http://127.0.0.1:8000/api/elve
GET (read one toy):
http://127.0.0.1:8000/api/elve/{id}
POST (create a new toy):
http://127.0.0.1:8000/api/jobs/{id}/elve
PUT (edit one toy):
http://127.0.0.1:8000/api/elve{id}
DELETE (delete a toy):
http://127.0.0.1:8000/api/elve/{id}
Note
"{id}" is the id number of a object.
The project follows the structure of the MVC design pattern, which allows a better separation of responsibilities and facilitates the maintenance of the code. We also use a laravel 11 framework to help us develop in PHP.
Sprint 2
| Issam Chellaf | Jonathan Torreblanca | Matias Stadler | Jenifer Moyano | Fran Muñoz | René Barco
Sprint 1
| Álvaro Cervera | Miguel Ángel García | Manuel Espinosa | Antonio Guillén | Santino Vigna