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
.envfile: copy or rename.env.examplelocated in project root folder. Runphp artisan key:generateto 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 ito install al packages dependencies. -
Setup database: create the database on your system and set corresponding connection parameters in the
.envfile. -
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=0to 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 sergyzen@gmail.com. All security vulnerabilities will be promptly addressed.
This software is open-sourced software licensed under the MIT license.