This repository contains the code for the proposed challenge. Which is capable of importing the data from .json and .xml files into the database.
This project is based on the following technologies:
Laravel 8 + PHP 8 + REDIS + MySQL
1.1 In the root of the thiago-gabriel-valente project create the .env file:
cp .env.example .env
Note: In the .env file enter your REDIS and DATABASE credentials.
1.2 Install the project packages:
composer install
1.3 Generate the project APP_KEY:
php artisan key:generate
1.4 Run the migrations:
php artisan migrate
1. Start the queue and the worker
php artisan queue:work
Or you can use the horizon
php artisan horizon
2. Execute the import command:
php artisan import:users [filePath]
Note 1: The filePath argument is optional. If you don't pass the filePath argument, the default file path is /challenge.json.
Note 2: The filePath argument is the absolute path to the file that will be imported.
Note 3: You can import .json or .xml files with the same content.
The entire project was developed following TDD. Then you can run the project tests
php artisan test