Skip to content

Welcome to the Santa Claus Toy Factory! This project helps Santa and his elves manage toys and gifts for kids around the world. From tracking good and bad behavior to assigning the perfect gifts, everything is here to spread holiday cheer!

License

Notifications You must be signed in to change notification settings

issamchlf/Santa-claus-factory

Repository files navigation

🎅 Welcome to our Christmas Toy Factory! 🎄

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 ⛄❄️:

screencapture-127-0-0-1-8000-2025-01-21-12_05_27

  • 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.

❄️⛄ Santa View ⛄❄️: Captura de pantalla 2025-01-21 120701

  • 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.

    Show_Kid

❄️⛄ Elves View ⛄❄️:

Captura de pantalla 2025-01-21 120724

  • 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.

    Show_Toy

🔎📝 Installation Requirements

In order to run this project locally, you need:

  1. XAMPP (or any other local server that supports PHP and MySQL)

  2. A modern web browser

  3. VSC Terminal

  4. Composer

  5. Node.js (install npm)

  6. xdebug (for tests coverage)

  7. Postman (or any other platform to use for API)

🔧⚙️ Installation

  1. Install project with git clone
  git clone https://github.com/issamchlf/Santa-claus-factory.git
  1. Install composer:
composer install
  1. Install NPM:
npm install
  1. 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.

  1. 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.
  1. Migrate the tables:
php artisan migrate:fresh --seed
  1. Run Locally:
  • Run NPM in one terminal.
npm run dev
  • Run Laravel in another terminal.
php artisan serve

🏃‍♂️🧪 Running Tests

To run test you should uncomment the following lines on the phpunit.xml file.

image

To run the project tests, use the following command:

    php artisan test --coverage
  • This project has a 99,4% of test coverage.

Captura de pantalla 2025-01-20 092021

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.

Captura de pantalla 2025-01-20 092202


📊📁 DB Diagram

Below is a diagram of the database, showing different relationships between tables:

image

  • 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.

📡🌐 API Endpoints

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.

🔸 Api Santa 🎅

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}

🔸 Api elve 🧝

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.


▶️💻 Project structure

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.


🛠️🚀 Tech and tools

PHP HTML5 CSS3 MySQL LARAVEL VSC Git GitHub composer postman node.js xampp tailwindcss javascript


✍️🙍 Authors

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


🛡️⚖️ License

MIT License

About

Welcome to the Santa Claus Toy Factory! This project helps Santa and his elves manage toys and gifts for kids around the world. From tracking good and bad behavior to assigning the perfect gifts, everything is here to spread holiday cheer!

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •