This project is a sample about jobs & queues to import a huge amount of products using CSV files.
Queues can be configured in environment file. Possible queue drivers are DB and Redis (used DB by default).
-
Create
.env
file: copy or rename.env.example
located in project root folder. Runphp artisan key:generate
to generate a new application key. -
Install dependencies: to install all app dependencies, run
composer install
. If you will modify styles or JS, you'll need also npm modules installed. Runnpm i
to install al packages dependencies. -
Setup database: create the database on your system and set corresponding connection parameters in the
.env
file. -
migrate & seed: to generate migrations run command
php artisan migrate
. Then run seeds withphp artisan db:seed
. -
start queue workers:
If application runs under Windows system:
Run
START /b php artisan queue:work --timeout=0
to start processing queue in background.If application runs under Unix system:
Run
nohup php artisan queue:work --timeout=0 &
to start processing queue in background.
To serve the app on to a virtual dev server, run php artisan serve
and app will start.
You can find the url address in the response if this command.
You can simply generate a random products file with whe generation button of the index card header.
Before uploading a CSV make sure queue is running. If not Job will be generated but bot imported. (Laravel queues).
- Testing imports
- List of products
- Queue random product generation to file.
- Dockerize this
If you discover a security vulnerability, please send an e-mail to Sergio Martín via [email protected]. All security vulnerabilities will be promptly addressed.
This software is open-sourced software licensed under the MIT license.