π Demo: https://e-comm.mk
- π Quick Start
- β¨ Features Overview
- πΈ Screenshots
- π Documentation
- β‘ Blaze Template Engine
- π€ Contributing
- π License
# 1. Clone and start
git clone https://github.com/KalimeroMK/LaravelEcomm.git
cd LaravelEcomm
docker-compose up -d
# 2. Install dependencies
docker exec e_comm_app composer install
# 3. Setup environment
cp .env.example .env
docker exec e_comm_app php artisan key:generate
# 4. Configure database in .env
DB_HOST=db
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret
# 5. Run migrations and seeders
docker exec e_comm_app php artisan migrate:fresh --seed
# 6. Create storage link
docker exec e_comm_app php artisan storage:link
# 7. Access the application
# Frontend: http://localhost:90
# Admin: http://localhost:90/admin
# API: http://localhost:90/api/v1# 1. Clone and install
git clone https://github.com/KalimeroMK/LaravelEcomm.git
cd LaravelEcomm
composer install
cp .env.example .env
# 2. Configure environment
php artisan key:generate
# Edit .env with your database credentials
# 3. Setup database
php artisan migrate:fresh --seed
# 4. Install frontend assets
npm install && npm run build
# 5. Create storage link
php artisan storage:link
# 6. Start server
php artisan serve
# Visit: http://localhost:8000| Role | URL | Password | |
|---|---|---|---|
| Admin | /admin |
superadmin@mail.com |
password |
| Client | /login |
client@mail.com |
password |
- Two Complete Themes: Default theme (classic e-commerce) & Modern theme (contemporary design)
- Easy Theme Switching: Change active theme via admin settings (no code changes)
- Theme Assets: Organized CSS, JS, images per theme (
public/frontend/themes/{theme}/) - View Fallback: Automatic fallback to default theme if view missing in active theme
- 32+ Theme Views: Complete page coverage (homepage, products, cart, checkout, user pages)
- URL Prefix Strategy:
/en/,/mk/,/de/,/sq/for language switching - Auto Locale Detection: Detects browser language and redirects automatically
- Database-Driven Languages: Add/remove languages via admin without code changes
- Translation Management: Admin UI for managing translations
- Model Translations: Product, Category, Page, Post models support translations via
HasTranslationstrait - Automatic Fallback: Falls back to default language if translation missing
- RTL Support: Right-to-left language support built-in
- GeoIP Detection: Auto-detect user country from IP address
- Automatic Currency: Detects and sets currency based on country
- Real-Time Exchange Rates: 20+ currencies with live rates
- Currency Conversion API: Convert prices between currencies on-the-fly
- EU Detection: GDPR compliance helpers for EU countries
- Timezone Detection: Auto-set timezone based on location
- Product Types: Simple, Configurable, Bundle, Downloadable products
- Advanced Attributes: Bagisto-style attribute system (color, size, material swatches)
- Visual Swatches: Color swatches, button swatches, image swatches
- Configurable Products: Auto-generate variants from attribute combinations (e.g., T-Shirt: Red Γ S, M, L)
- Layered Navigation: AJAX-powered filtering with real-time product counts
- Product Variants: Manage stock, price, images per variant
- Product Reviews: Star ratings, review text, helpfulness voting
- Wishlist: Save products for later, share wishlist
- Recently Viewed: Track and display browsing history
- Product Comparison: Compare up to 4 products side-by-side
- Stock Management: Track inventory, low stock alerts, out-of-stock handling
- Digital Downloads: Support for downloadable products with secure links
- Shopping Cart: AJAX add/remove, quantity updates, mini-cart dropdown
- Saved Carts: Save cart for later, restore cart
- Guest Checkout: Checkout without registration
- Multiple Addresses: Save multiple shipping/billing addresses
- Address Book: Default addresses, address management
- Order Tracking: Track order status, shipping information
- Order History: View all orders, reorder previous orders
- Coupon System: Apply coupons in cart, see discount breakdown
- Shipping Estimation: Calculate shipping costs before checkout
- Elasticsearch Integration: Full-text search, fuzzy matching, suggestions
- Advanced Filters: Filter by price, brand, attributes, ratings
- Auto-Complete: Search suggestions as you type
- Search Analytics: Track popular searches, no-results queries
- Category Navigation: Multi-level categories, category tree
- Breadcrumbs: Navigation trail for easy back-tracking
- Related Products: AI-powered or manual related products
- Up-Sells & Cross-Sells: Product recommendations
- Blog System: Categories, tags, featured images, SEO meta
- CMS Pages: Create custom pages (About, Contact, FAQ) via admin
- Banners: Homepage banners, promotional banners with click tracking
- Menus: Dynamic menu management, nested menus
- Newsletter: Subscribe form, double opt-in confirmation
- User Dashboard: Overview of orders, addresses, account info
- Profile Management: Update name, email, password, avatar
- Order Management: View orders, download invoices, track shipments
- Address Book: Multiple addresses, default shipping/billing
- Wishlist Management: Add/remove, move to cart
- Review Management: Edit/delete own reviews
- Comment Management: Manage blog comments
- Social Login: Login with Facebook, Google, Twitter, GitHub
- Payment Gateways:
- Stripe: Credit card payments (tested with Stripe Elements)
- PayPal: Express checkout, sandbox support
- Cash on Delivery (COD): Pay on delivery option
- Secure Checkout: SSL support, PCI compliance helpers
- Multi-Step Checkout: Shipping, payment, review steps
- Order Confirmation: Email confirmation, PDF invoice
- Failed Payment Handling: Retry payment, cancel order
- Product Sharing: Share on social media (Facebook, Twitter, Pinterest)
- Social Login: One-click registration/login
- Newsletter Subscription: Footer signup, popup option
- Abandoned Cart Recovery: Automated email reminders
- Product Recommendations: AI-powered suggestions based on behavior
- Promotional Banners: Targeted banners based on user segment
- Dynamic Meta Tags: Auto-generated title, description per page
- Open Graph: Facebook sharing optimization
- Twitter Cards: Twitter sharing optimization
- Structured Data: Schema.org markup (Product, Organization, BreadcrumbList)
- XML Sitemaps: Auto-generated for products, categories, posts
- SEO-Friendly URLs: Slug-based URLs (
/product/nike-air-max) - Canonical URLs: Prevent duplicate content issues
- Robots.txt: Auto-generated with sitemap reference
- Alt Tags: Image SEO with automatic alt text
- Overview Dashboard: Sales today, orders, users, revenue charts
- Interactive Charts: Chart.js integration (line, bar, pie charts)
- Sales Reports: Daily, weekly, monthly, yearly sales data
- Revenue Tracking: Total revenue, average order value
- User Analytics: New users, active users, user growth
- Product Analytics: Best sellers, low stock, views/clicks
- Order Analytics: Order statuses, payment methods, shipping methods
- Export Reports: Download reports as CSV, Excel, PDF
- Real-time Updates: Live data refresh for key metrics
- Product Grid: Advanced filtering, sorting, bulk actions
- Product Creation: Wizard for creating products step-by-step
- Attribute Management: Create attributes, options, families
- Variant Management: Manage product variants (stock, price, images)
- Media Manager: Upload images, videos, documents (Unisharp File Manager)
- Category Assignment: Multi-category products, primary category
- SEO Management: Meta title, description, keywords per product
- Stock Management: Quantity, low stock threshold, backorders
- Pricing: Base price, sale price, cost price, tier pricing
- Product Reviews: Approve/reject reviews, reply to reviews
- Product Import/Export: Bulk import via CSV
- Order Grid: Filter by status, date, customer, payment
- Order Lifecycle:
- Statuses: Pending, Processing, On Hold, Shipped, Delivered, Cancelled, Refunded, Failed
- Payment Statuses: Pending, Paid, Failed, Refunded
- Order Details: Products, customer info, shipping, payment
- Invoice Generation: PDF invoices with customizable template
- Shipment Tracking: Add tracking numbers, shipping carriers
- Refund Processing: Partial/full refunds, store credit
- Order Notes: Internal notes, customer-visible notes
- Print Order: Print-friendly order page
- Resend Email: Resend order confirmation, invoice
- Customer Grid: Search, filter, export customers
- Customer Profile: Orders, addresses, activity history
- Customer Groups: Create groups (VIP, Wholesale, etc.)
- Customer Segmentation: Based on purchase history, location
- Impersonation: Login as customer to help troubleshoot
- Address Management: View/edit customer addresses
- Blog Posts: Create, edit, schedule posts
- Categories: Hierarchical categories, SEO settings
- Tags: Tag management, tag cloud
- Pages: CMS pages (About, Contact, Terms, etc.)
- Banners: Homepage sliders, promotional banners
- Click tracking
- Impression tracking
- Start/end dates
- Target URLs
- Media Library: Central file management, image optimization
- Menu Builder: Drag-drop menu creation
- Email Campaigns: Create and send newsletter campaigns
- Email Templates: Customizable templates for all emails
- Newsletter Management: Subscribers, segments, send history
- Abandoned Cart Emails: 3-email sequence automation
- Email 1: 1 hour after abandonment
- Email 2: 24 hours after abandonment
- Email 3: 72 hours after abandonment
- Coupon Management:
- Types: Percentage, Fixed amount, Free shipping
- Restrictions: Minimum purchase, category restrictions, user restrictions
- Usage limits: Per coupon, per user
- Expiry dates
- Promotions: Catalog price rules, cart price rules
- Campaign Analytics: Open rates, click rates, bounce rates, unsubscribes
- Email Templates: HTML templates with dynamic variables
- Automated Emails: Welcome series, birthday emails, re-engagement
- Email Scheduling: Schedule campaigns for future dates
- A/B Testing: Test different subject lines, content
- Segmentation: Target specific customer groups
- Admin Users: Create/edit admin accounts
- Roles: Define roles (Super Admin, Admin, Editor, etc.)
- Permissions: Granular permissions per role
- Permission Matrix: Visual permission assignment
- Activity Log: Track admin actions, login history
- General Settings: Store name, logo, address, contact info
- Currency Settings: Default currency, exchange rates, formatting
- Language Settings: Active languages, default language
- Email Settings: SMTP configuration, email templates
- Payment Settings: Enable/disable gateways, sandbox mode
- Shipping Settings: Methods, zones, rates
- Tax Settings: Tax rates, tax classes, display options
- SEO Settings: Default meta tags, sitemap settings
- Social Settings: Social media links, API keys
- Maintenance Mode: Enable/disable with custom message
- 8 Report Types: Sales, Products, Customers, Inventory, Orders, Coupons, Revenue, Tax
- Scheduled Reports: Auto-generate and email reports
- Custom Date Ranges: Flexible reporting periods
- Export Formats: CSV, Excel, PDF
- Report History: Track generated reports
- Visual Charts: Graphical representation of data
- Two-Factor Authentication (2FA): Google Authenticator integration
- Role-Based Access Control (RBAC): Granular permissions
- IP Blocking: Block specific IP addresses or ranges
- Login Attempt Limiting: Prevent brute force attacks
- Secure Password Policies: Enforce strong passwords
- Activity Logging: Track all admin actions
- Audit Trails: Complete history of data changes
- CSRF Protection: Built-in Laravel CSRF tokens
- XSS Protection: Output escaping, Content Security Policy
- SQL Injection Protection: Parameterized queries
- Redis Caching: Application caching, session storage
- Query Optimization: Eager loading, query caching
- Image Optimization: Automatic image compression, WebP support
- Lazy Loading: Images load as user scrolls
- CDN Support: Serve static assets from CDN
- Gzip Compression: Compress responses
- Browser Caching: Cache headers for static assets
- Database Indexing: Optimized indexes for fast queries
- Full-Page Caching: Cache rendered pages for guests
- Tenant Cache Isolation: Per-tenant cache prefix prevents cross-tenant cache pollution
- Search Generation Counter: Instant search cache invalidation on product changes (no stale results)
- Helper Caching: Shipping methods, post tags, post categories cached at 1 h TTL
This project uses a custom fork of the Blaze template engine optimization package with enhanced features for Laravel Blade:
- View Component Support: Full support for Laravel View Components with proper rendering
- View::share() Support: Auto-injects shared view variables with zero performance overhead
- View Composer Support: Trigger composers via
@blaze(name: 'view.name')directive - Theme-Aware Optimization: Per-theme optimization strategies (compile, memo, fold)
- Multi-Theme Support: Different optimization settings per theme (default vs modern)
- Debug Overlay: Built-in performance profiler showing render times per view
- Cache Warming: Pre-compiles views on deployment for faster first load
'themes' => [
'enabled' => true,
'paths' => [
'default' => base_path('Modules/Front/Resources/views/themes/default'),
'modern' => base_path('Modules/Front/Resources/views/themes/modern'),
],
'strategies' => [
'default' => ['compile' => true, 'memo' => true, 'fold' => false],
'modern' => ['compile' => true, 'memo' => true, 'fold' => false],
],
],BLAZE_ENABLED=true # Enable/disable Blaze optimization
BLAZE_DEBUG=true # Show debug overlay with render times
BLAZE_CACHE_WARM=true # Pre-compile views on cache warmNote: This project uses a fork at
KalimeroMK/blaze(dev-main) which includes:
- View::share() auto-injection (upstream: not supported)
- View::composer() support via
@blaze(name: ...)directive- @extends template support
- All upstream Blaze features and performance optimizations
- Product Description Generator: AI-generated product descriptions
- Content Creation: Blog post ideas, content suggestions
- SEO Optimization: Meta description generation
- Translation Assistance: AI-powered translation suggestions
- Abandoned Cart Recovery: 3-email sequence
- Welcome Series: Onboarding emails for new users
- Post-Purchase Follow-up: Request reviews, cross-sell
- Re-engagement Campaigns: Win back inactive customers
- Birthday Emails: Automated birthday wishes with coupon
- AI-Powered Suggestions: Product recommendations based on behavior
- Related Products: Smart matching of related items
- Frequently Bought Together: Amazon-style recommendations
- Recently Viewed: Personalized browsing history
- Trending Products: Popular items in user's category
The project has comprehensive test coverage with 220+ unit test files covering all Action classes.
| Module | Action Classes | Test Files |
|---|---|---|
| User | 14 | 9 |
| Product | 23 | 16 |
| Order | 11 | 7 |
| Cart | 6 | 4 |
| Category | 7 | 7 |
| Brand | 6 | 5 |
| Banner | 5 | 5 |
| Message | 8 | 7 |
| Newsletter | 5 | 5 |
| Coupon | 6 | 6 |
| Shipping | 6 | 6 |
| Page | 5 | 5 |
| Post | 10 | 10 |
| Role | 6 | 6 |
| Settings | 8 | 8 |
| Billing | 9 | 9 |
| Attribute | 10 | 10 |
| Core | 3 | 3 |
| Google2FA | 10 | 10 |
| Bundle | 7 | 7 |
| ProductStats | 5 | 5 |
| Permission | 5 | 5 |
| Language | 3 | 3 |
| Reporting | 5 | 5 |
| OpenAI | 3 | 3 |
| Front | 23 | 23 |
| Tenant | 5 | 5 |
| Complaint | 5 | 5 |
| Other | 4 | 4 |
| TOTAL | 220 | 220 |
# Run all tests
./vendor/bin/phpunit
# Run unit tests only
./vendor/bin/phpunit tests/Unit
# Run tests for specific module
./vendor/bin/phpunit tests/Unit/Actions/Product
./vendor/bin/phpunit tests/Unit/Actions/User
./vendor/bin/phpunit tests/Unit/Actions/Order
# Run with coverage report
./vendor/bin/phpunit --coverage-html coverageTests are organized following the Action pattern:
tests/Unit/Actions/
βββ ActionTestCase.php # Base test class with RefreshDatabase
βββ User/
β βββ LoginUserActionTest.php
β βββ RegisterUserActionTest.php
β βββ UpdateUserActionTest.php
β βββ ...
βββ Product/
β βββ CreateProductActionTest.php
β βββ UpdateProductActionTest.php
β βββ DeleteProductActionTest.php
β βββ ...
βββ [Module]/
βββ [Action]Test.php
All Action tests should:
- Extend
ActionTestCase(providesRefreshDatabaseand language seeding) - Use factories for model creation
- Test happy paths and edge cases
- Verify database state changes
- Mock external services (OpenAI, Payment gateways)
Example:
<?php
declare(strict_types=1);
namespace Tests\Unit\Actions\Product;
use Modules\Product\Actions\StoreProductAction;
use Modules\Product\DTOs\ProductDTO;
use Modules\Product\Models\Product;
use Tests\Unit\Actions\ActionTestCase;
class CreateProductActionTest extends ActionTestCase
{
public function testExecuteCreatesProductSuccessfully(): void
{
$dto = new ProductDTO(
id: null,
title: 'Test Product',
// ... other fields
);
$action = app(StoreProductAction::class);
$result = $action->execute($dto);
$this->assertInstanceOf(Product::class, $result);
$this->assertDatabaseHas('products', ['title' => 'Test Product']);
}
}- Installation Guides
- API Documentation
- Module Documentation
- Command Reference
- Testing
- Recent Enhancements
Prerequisites: Docker & Docker Compose
Step-by-step:
# Start all containers
docker-compose up -d
# Container access
docker exec -it e_comm_app sh # App container
docker exec -it e_comm_mysql mysql -u homestead -p # Database
docker exec -it e_comm_redis redis-cli # Redis
# Useful commands
docker exec e_comm_app php artisan cache:clear
docker exec e_comm_app php artisan view:clear
docker exec e_comm_app php artisan migrate
# Container ports:
# - Web (FrankenPHP): 90 β 80
# - MySQL: 3311 β 3306
# - Redis: 6381 β 6379
# - Elasticsearch: 9200 β 9200# Configure in .env
MAIL_MAILER=smtp
MAIL_HOST=your-smtp-host
MAIL_PORT=587
MAIL_USERNAME=your-email
MAIL_PASSWORD=your-password
MAIL_ENCRYPTION=tls
# Process abandoned cart emails
php artisan cart:process-abandoned-emails# Index products
docker-compose exec app php artisan product:index
# Rebuild from scratch
docker-compose exec app php artisan product:index --freshPostman Collection: LaravelEcomm.postman_collection.json
Base URL: http://localhost:90/api/v1
# Login
POST /api/v1/auth/login
{
"email": "client@mail.com",
"password": "password"
}# List languages
GET /api/languages
# Get current locale
GET /api/languages/current
X-Locale: mk# List report types
GET /api/admin/report-types
# Create report
POST /api/admin/reports
{
"name": "Monthly Sales",
"type": "sales",
"format": "excel",
"filters": {
"date_from": "2026-01-01",
"date_to": "2026-01-31"
}
}
# Generate & Export
POST /api/admin/reports/{id}/generate
POST /api/admin/reports/{id}/export
{ "format": "csv" }# Get location from IP
GET /api/geolocation
# Convert currency
POST /api/currency/convert
{
"amount": 100,
"from": "USD",
"to": "EUR"
}// Create attribute with options
$color = Attribute::factory()->create([
'code' => 'color',
'type' => 'select',
'display' => 'color',
'is_filterable' => true,
]);
$color->options()->create([
'value' => 'red',
'label' => 'Red',
'color_hex' => '#FF0000',
]);
// Create configurable product
$product = Product::factory()->create([
'type' => Product::TYPE_CONFIGURABLE,
]);
$product->configurableAttributes()->attach($color);
// Generate variants
app(ConfigurableProductService::class)->generateVariants($product);# Generate sitemaps
php artisan seo:generate-sitemap
# Configuration in config/seo.phpphp artisan cache:clear # Clear application cache
php artisan config:clear # Clear config cache
php artisan view:clear # Clear compiled views
php artisan route:clear # Clear route cachephp artisan migrate:fresh --seed # Fresh database with seeders
php artisan db:seed --class=DatabaseSeeder # Run specific seederphp artisan product:index # Index products in Elasticsearch
php artisan product:index --fresh # Rebuild indexphp artisan cart:process-abandoned-emails # Process abandoned carts
php artisan newsletter:send-campaigns # Send newsletter campaignsphp artisan analytics:aggregate # Aggregate analytics data
php artisan reports:generate # Generate scheduled reports# Run all tests
php artisan test
# Run specific test suite
php artisan test --filter=OrderTest
# Run with coverage
php artisan test --coverage
# Run E2E tests (requires Playwright)
npx playwright testAdmin: superadmin@mail.com / password
Client: client@mail.com / password
Multi-tenancy is disabled by default β the application runs as a standard single-store e-commerce platform with no extra config needed.
To enable database-per-tenant mode, set in .env:
MULTI_TENANT_ENABLED=true
TENANT_MAIN_DOMAIN=yourdomain.comWhen enabled, each tenant is identified by subdomain and gets its own isolated MySQL database. Cache is automatically prefixed per-tenant (laravel_t1_, laravel_t2_, ...) so tenants never share cached data.
| Setting | Default | Description |
|---|---|---|
MULTI_TENANT_ENABLED |
false |
Enable database-per-tenant isolation |
TENANT_MAIN_DOMAIN |
localhost |
Root domain for subdomain detection |
TENANT_DB_PREFIX |
tenant_ |
Database name prefix for tenant DBs |
TENANT_ISOLATE_USERS |
true |
Keep user accounts per-tenant |
Click to expand recent updates
- β
Tenant cache isolation via per-tenant prefix (no more
Cache::flush()on switch) - β Search cache invalidation via generation counter (instant, not 24 h stale)
- β Multi-tenancy off by default β works as normal ecom, opt-in to multi-tenant
- β
Theme resolution via
Cache::remember()β safe for FrankenPHP/Octane workers - β
Replaced all
Artisan::call()in web requests with direct filesystem ops - β
Helper::shipping(),postTagList(),postCategoryList()now cached at 1 h TTL
- β Modern theme views for cart, checkout, my-orders
- β Fixed payment workflows (Stripe, PayPal, COD)
- β Client orders access fixed
- β E2E tests with Playwright
- Action-based architecture for all controllers
- Complete API coverage for all modules
- 540+ tests passing
- PHPStan compliance
- URL prefix strategy (
/en/,/mk/,/de/) - 8 Report types with scheduling
- GeoIP detection with currency conversion
- Real-time exchange rates
- 32+ view files for modern theme
- Responsive design with comprehensive coverage
- Easy theme switching via settings
- Polymorphic attributes for Products, Bundles, Categories
- Visual swatches (color, image, button)
- Configurable products with auto-variant generation
- Layered navigation with AJAX filtering
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License.
| Resource | URL |
|---|---|
| Demo | https://e-comm.mk |
| Admin | http://localhost:90/admin |
| API Docs | LaravelEcomm.postman_collection.json |
| Frontend | http://localhost:90 |
Built with β€οΈ using Laravel 12






