From Earth to You - Connecting authentic, farm-fresh products from trusted producers directly to consumers.
- Overview
- Features
- System Requirements
- Quick Start Installation
- Detailed Configuration
- Project Structure
- Database Schema
- API Documentation
- User Roles & Permissions
- Payment Integration
- Deployment Guide
- Testing
- Troubleshooting
- Contributing
- License
EthniCart is a modern, full-featured e-commerce platform built with Laravel that connects local producers with consumers. The platform emphasizes authenticity, quality, and direct-from-source products including organic foods, traditional crafts, beauty products, and more.
- πͺ Multi-vendor marketplace for producers/sellers
- π³ Secure payment processing with SSL Commerce
- π Google OAuth integration for seamless authentication
- π± Fully responsive design optimized for all devices
- π Real-time search with autocomplete suggestions
- π Comprehensive analytics for sellers and admins
- π Advanced cart management with session persistence
- β Product reviews and rating system
- Backend: Laravel 10.x (PHP 8.1+)
- Frontend: Blade Templates, Tailwind CSS, Alpine.js
- Database: MySQL 8.0+ / MariaDB
- Authentication: Laravel Sanctum + Google OAuth (Socialite)
- Payment Gateway: SSL Commerce (Bangladesh)
- Storage: Local / S3 Compatible
- Build Tools: Vite
- Image Processing: Intervention Image
- β User registration and login (Email/Google OAuth)
- β Browse products by 12+ categories
- β Advanced search with live autocomplete
- β Shopping cart with real-time updates
- β Secure checkout with multiple payment methods
- β Order tracking and history
- β User profile management
- β Wishlist functionality
- β Product reviews and ratings
- β Email notifications
- β Seller registration and verification
- β Shop profile customization
- β Product management (CRUD)
- β Inventory tracking
- β Order management dashboard
- β Sales analytics and reports
- β Order fulfillment workflow
- β Revenue tracking
- β Customer management
- β Complete platform oversight
- β User and seller approval/management
- β Product moderation
- β Category management
- β Order monitoring
- β Analytics dashboard
- β System configuration
- β Content management
- π Farm Fresh Fruits & Vegetables
- π Fish & Meat
- πΆοΈ Homemade Masala & Spices
- π₯ Pickles & Condiments
- πΏ Organic Roots
- π Beauty & Personal Care
- π Traditional Clothing & Apparels
- π¨ Handcrafted Goods
- π Home & Kitchen Items
- π Flowers & Gifts
- π§Ό Eco-Friendly Cleaning Products
β PHP >= 8.1
β MySQL >= 8.0 or MariaDB >= 10.3
β Composer >= 2.0
β Node.js >= 16.x
β NPM >= 8.x
β 2GB RAM
β 10GB Storage
β OpenSSL, PDO, Mbstring, Tokenizer, XML
β Ctype, JSON, BCMath, Fileinfo
β GD (for image processing)
# 1. Clone the repository
git clone https://github.com/mehedi-hridoy/EthniCart.git
cd EthniCart
# 2. Install PHP dependencies
composer install
# 3. Install Node.js dependencies
npm install
# 4. Create environment file
cp .env.example .env
# 5. Generate application key
php artisan key:generate
# 6. Configure database (Edit .env file)
DB_DATABASE=ethnicart_db
DB_USERNAME=root
DB_PASSWORD=your_password
# 7. Run migrations
php artisan migrate
# 8. Seed database (optional)
php artisan db:seed
# 9. Create storage symlink
php artisan storage:link
# 10. Build frontend assets
npm run dev
# 11. Start development server
php artisan serveVisit: http://127.0.0.1:8000
# 1. Clone and navigate
git clone https://github.com/mehedi-hridoy/EthniCart.git
cd EthniCart
# 2. Start XAMPP (Apache + MySQL)
# 3. Install dependencies
composer update
npm install
# 4. Setup environment
cp .env.example .env
php artisan key:generate
# 5. Configure database in .env
# DB_DATABASE=ethnicart_db
# DB_USERNAME=root
# DB_PASSWORD=
# 6. Run migrations
php artisan migrate
php artisan storage:link
# 7. Build assets
npm run dev
# 8. Start server
php artisan serveCreate your database first:
CREATE DATABASE ethnicart_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;Update .env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=ethnicart_db
DB_USERNAME=root
DB_PASSWORD=Add to .env:
ADMIN_EMAIL=admin@ethnicart.com
ADMIN_PASSWORD=SecurePassword123!Create admin user:
# Method 1: Using Seeder
php artisan db:seed --class=AdminUserSeeder
# Method 2: Using Tinker
php artisan tinker
>>> use App\Models\User; use Illuminate\Support\Facades\Hash;
>>> User::create(['name' => 'Admin', 'email' => 'admin@ethnicart.com', 'password' => Hash::make('SecurePassword123!'), 'email_verified_at' => now(), 'role' => 'admin']);
>>> exit- Create project at Google Cloud Console
- Enable Google+ API
- Create OAuth 2.0 credentials
- Add redirect URI:
http://localhost:8000/auth/google/callback - Update
.env:
GOOGLE_CLIENT_ID=your-client-id.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-client-secret
GOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callbackπ Detailed OAuth Guide: See GOOGLE_AUTH_SETUP.md
SSLCOMMERZ_STORE_ID=your_store_id
SSLCOMMERZ_STORE_PASSWORD=your_password
SSLCOMMERZ_SANDBOX=trueMAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=your-email@gmail.com
MAIL_PASSWORD=your-app-password
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=noreply@ethnicart.com
MAIL_FROM_NAME="EthniCart"EthniCart/
βββ app/
β βββ Console/Commands/ # Custom Artisan commands
β βββ Exceptions/ # Exception handling
β βββ Helpers/ # Helper functions
β βββ Http/
β β βββ Controllers/ # Application controllers
β β β βββ Admin/ # Admin panel controllers
β β β βββ Auth/ # Authentication
β β β βββ Seller/ # Seller dashboard
β β β βββ ... # Customer controllers
β β βββ Middleware/ # Custom middleware
β βββ Library/SslCommerz/ # Payment integration
β βββ Models/ # Eloquent models
β βββ Services/ # Business logic services
β
βββ database/
β βββ migrations/ # Database migrations
β βββ seeders/ # Data seeders
β
βββ public/
β βββ assets/ # Compiled assets
β βββ images/ # Static images
β βββ storage/ # Uploaded files (symlink)
β
βββ resources/
β βββ views/ # Blade templates
β β βββ admin/ # Admin views
β β βββ seller/ # Seller views
β β βββ auth/ # Auth pages
β β βββ ... # Customer views
β βββ lang/ # Language files
β
βββ routes/
β βββ web.php # Web routes
β βββ api.php # API routes
β βββ console.php # Console commands
β
βββ storage/
β βββ app/public/ # User uploads
β βββ logs/ # Application logs
β
βββ tests/ # Automated tests
βββ .env.example # Environment template
βββ composer.json # PHP dependencies
βββ package.json # Node dependencies
βββ README.md # This file
User βββ¬ββ (1:n) Orders
βββ (1:1) Seller Profile
βββ (1:n) Cart Items
Seller βββ¬ββ (1:n) Products
βββ (1:n) Orders
Product βββ¬ββ (n:1) Category
βββ (n:1) Seller
βββ (1:n) Product Images
βββ (n:n) Order Items
Order βββ¬ββ (n:1) User
βββ (n:1) Seller
βββ (1:n) Order Items
Category ββββ (1:n) Sub-Categories (self-referencing)
users: User accounts (customers, sellers, admins)
sellers: Seller profiles and shop information
products: Product catalog
categories: Product categories hierarchy
ethni_orders: Order records
order_items: Order line items
product_images: Product image gallery
seller_order_stats: Seller statistics
Login
POST /api/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "password"
}
Response: 200 OK
{
"token": "1|abc123...",
"user": { ... }
}Register
POST /api/register
Content-Type: application/json
{
"name": "John Doe",
"email": "user@example.com",
"password": "password",
"password_confirmation": "password"
}Get Products
GET /api/products?page=1&category=foods&sort=price_asc
Response: 200 OK
{
"data": [ ... ],
"meta": {
"current_page": 1,
"total": 150
}
}Search Products
GET /api/search-suggestions?query=tomato
Response: 200 OK
{
"products": [ ... ]
}Product Details
GET /api/products/{id}
Response: 200 OK
{
"id": 1,
"name": "Organic Tomatoes",
"price": 50.00,
"stock": 100,
...
}Add to Cart
POST /api/cart/add/{product_id}
Authorization: Bearer {token}
Response: 200 OK
{
"success": true,
"cart_count": 3
}Get Cart
GET /api/cart
Authorization: Bearer {token}
Response: 200 OK
{
"items": [ ... ],
"total": 550.00
}- Browse and search products
- Manage cart and place orders
- Track order status
- Write product reviews
- Manage profile and wishlist
- All customer permissions
- Create and manage products
- Process orders
- View sales analytics
- Manage shop profile
- Handle inventory
- All seller permissions
- Manage users and sellers
- Approve/reject registrations
- Moderate products
- System configuration
- Platform analytics
// Customer routes
Route::middleware(['auth'])->group(function () {
// Customer-only routes
});
// Seller routes
Route::middleware(['auth', 'seller'])->prefix('seller')->group(function () {
// Seller dashboard and management
});
// Admin routes
Route::middleware(['auth', 'admin'])->prefix('admin')->group(function () {
// Admin panel
});- Register at SSL Commerce
- Get Store ID and Password
- Configure in
.env:
SSLCOMMERZ_STORE_ID=test123
SSLCOMMERZ_STORE_PASSWORD=test123
SSLCOMMERZ_SANDBOX=true # false for production- Customer places order β Order created (status: pending)
- Redirect to SSL Commerce payment page
- Customer completes payment
- Callback to
/payment/successor/payment/fail - Order status updated
- Confirmation email sent
- Credit/Debit Cards (Visa, MasterCard, Amex)
- Mobile Banking (bKash, Nagad, Rocket)
- Internet Banking
- Digital Wallets
# 1. Environment
APP_ENV=production
APP_DEBUG=false
APP_URL=https://yourdomain.com
# 2. Database backup strategy
# 3. SSL certificate (HTTPS)
# 4. File permissions
chmod -R 775 storage bootstrap/cache
# 5. Optimize
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan optimize
# 6. Queue workers (optional)
php artisan queue:work --daemon
# 7. Monitoring & loggingApache (.htaccess)
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>Nginx
location / {
try_files $uri $uri/ /index.php?$query_string;
}- Connect your server
- Configure environment variables
- Set deployment script
- Auto-deploy on push
# Run all tests
php artisan test
# With coverage
php artisan test --coverage
# Specific suite
php artisan test --testsuite=Feature
# Specific test
php artisan test tests/Feature/ProductTest.php// tests/Feature/ProductTest.php
public function test_user_can_view_products()
{
$response = $this->get('/products');
$response->assertStatus(200)
->assertViewIs('products.index')
->assertSee('Products');
}1. Blank Page / 500 Error
# Check logs
tail -f storage/logs/laravel.log
# Clear all caches
php artisan optimize:clear2. Permission Errors
chmod -R 775 storage bootstrap/cache
chown -R www-data:www-data storage bootstrap/cache3. Database Connection Failed
# Test connection
php artisan tinker
>>> DB::connection()->getPdo();
# Verify .env database credentials4. Assets Not Loading
# Rebuild assets
npm run build
# Check public directory permissions5. Google OAuth Not Working
- Verify redirect URI matches exactly
- Check Google Console credentials
- Clear config:
php artisan config:clear
6. Images Not Uploading
# Recreate storage link
php artisan storage:link
# Check storage permissions
chmod -R 775 storage/app/public# Development only!
APP_DEBUG=true
LOG_LEVEL=debugWe welcome contributions! Please follow these steps:
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
- Follow PSR-12
- Write meaningful commits
- Add tests for new features
- Update documentation
Reporting Vulnerabilities: Email mehedi.hridoy101@gmail.com
Best Practices:
- Keep dependencies updated
- Use HTTPS in production
- Implement rate limiting
- Sanitize all inputs
- Regular security audits
- Enable caching (Redis recommended for production)
- Optimize images (WebP format)
- Use CDN for static assets
- Implement lazy loading
- Add database indexes
- Use eager loading to prevent N+1 queries
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: mehedi.hridoy101@gmail.com
This project is licensed under the MIT License - see LICENSE file for details.
- Laravel Framework Team
- Tailwind CSS Team
- Open Source Community
- All Contributors
- β¨ Initial release
- πͺ Multi-vendor marketplace
- π Google OAuth integration
- π³ SSL Commerce payment
- π± Responsive design
- π Analytics dashboard
- π Cart system
- β Review system
Made with β€οΈ for local producers and authentic products
Last Updated: November 2, 2025