A Laravel 12 application that allows users to upload CSV files containing product data, process them asynchronously, and import products to Shopify with real-time status tracking.
This system provides a complete solution for importing product data from CSV files to Shopify stores. It features asynchronous processing, comprehensive logging, status tracking, and a user-friendly dashboard interface.
https://www.loom.com/share/138a486df36c49c98624011e3740a705?sid=2911ec61-06fd-48b7-80a3-7937311cbcf5
- CSV File Upload: Clean, responsive interface for uploading product CSV files
- Asynchronous Processing: Background job processing for large CSV files
- Shopify Integration: Direct API integration with Shopify stores
- Real-time Status Tracking: Monitor import progress and status
- Error Handling: Comprehensive error logging and user feedback
- Dashboard: Complete overview of all imports and their statuses
- Scheduled Imports: Automated cron-based import processing
- PHP 8.1 or higher
- Composer
- XAMPP (for local development)
- Shopify store with API access
git clone <your-repository-url>
cd shopify-csv-app# Install PHP dependencies
composer install
- Install XAMPP from https://www.apachefriends.org/
- Start Apache and MySQL services from XAMPP Control Panel
- Create a new database named
shopify_csv_appin phpMyAdmin
Copy the example environment file and configure it:
cp .env.example .env
php artisan key:generateUpdate your .env file with the following configurations:
# Database Configuration
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=shopify_csv_app
DB_USERNAME=root
DB_PASSWORD=
# Shopify Configuration
SHOPIFY_SHOP_URL=https://testing-vijay-store.myshopify.com
SHOPIFY_API_KEY=shpat_xxxxxxxxxxxxxxxx
SHOPIFY_COLLECTION_ID=xxxxxxxxxxx
# Queue Configuration
QUEUE_CONNECTION=databaseRun the database migrations:
php artisan migrateGenerate the necessary Laravel components:
# Create the Shopify import job
php artisan make:job ProcessShopifyImport
# Create the import cron command
php artisan make:command ImportCron --command=Import:croncrontab -eAdd this line to run the Laravel scheduler every minute:
* * * * * cd /mnt/c/Users/shopify-csv-app && php artisan schedule:run >> /dev/null 2>&1Use Task Scheduler to create a task that runs every minute with this command:
cd /path/to/your/project && php artisan schedule:run Add the following to your routes/console.php file:
<?php
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Schedule;
// Add this line for the import cron job
Schedule::command('Import:cron')->everyMinute();Create a dummy user for testing:
php artisan tinkerThen run:
User::create([
'name' => 'Test User',
'email' => '[email protected]',
'password' => bcrypt('password123')
]);
exit- Go to your Shopify admin panel:
https://testing-vijay-store.myshopify.com/admin - Navigate to Settings → Apps and sales channels
- Click Develop apps → Create an app
- Configure the app with necessary scopes:
read_productswrite_productsread_inventorywrite_inventory
- Install the app and copy the API key to your
.envfile
# Start the Laravel development server
composer run dev
- Login: Access the application at
http://localhost:8000and login with your test user credentials - Upload CSV: Navigate to the upload section and select your product CSV file
- Monitor Progress: Use the dashboard to track import status and view any errors
- Shopify Integration: Products will be automatically imported to your Shopify store
Your CSV file should include the following columns: check sample from this path Shopify-Import-Product-Automation\storage\app\private\imports
├── app/
│ ├── Jobs/
│ │ └── ProcessShopifyImport.php
│ ├── Console/
│ │ └── Commands/
│ │ └── ImportCron.php
│ ├── Models/
│ └── Http/
│ └── Controllers/
├── database/
│ └── migrations/
├── resources/
│ ├── views/
│ └── js/
├── routes/
│ ├── web.php
│ └── console.php
└── storage/
└── logs/
The system uses Laravel's queue system to process CSV files asynchronously, preventing timeouts for large files.
Comprehensive error logging captures import failures with detailed messages for debugging.
Direct API integration using Shopify's REST API/Graphql API for product creation and updates.
Real-time status updates for each product import (pending, processing, successful, failed).
- Queue not processing: Ensure scheduler is running
- Shopify API errors: Verify API credentials and app permissions
- Database connection: Check XAMPP MySQL service is running
- File upload issues: Check file permissions and PHP upload limits
Check the following log files for debugging:
storage/logs/laravel.log- General application logs- Laravel telescope (if installed) - Request/job monitoring
- Prepare a test CSV file with sample product data
- Login to the application
- Upload the CSV file
- Monitor the dashboard for import progress
- Verify products appear in your Shopify store
- Asynchronous Processing: Chose queue-based processing to handle large CSV files without timeouts
- Database Tracking: Implemented comprehensive status tracking for better user experience
- Modular Architecture: Separated concerns with dedicated jobs, commands, and controllers
- Error Resilience: Built-in retry mechanisms and detailed error logging
- Real-time WebSocket updates for dashboard
- Advanced CSV validation and mapping
- Bulk product updates and inventory sync
- Multi-store support
For issues or questions, please check the logs first, then create an issue in the GitHub repository with detailed error information and steps to reproduce.# Shopify-Import-Product-Automation



