A full-featured e-commerce shopping cart application built with Laravel 12, Livewire 3, and Tailwind CSS. This project demonstrates modern Laravel development practices with real-time interactions, queue jobs, scheduled tasks, and comprehensive admin management.
Customer Login: http://trustfactory_assessment.test/login
Admin Login: http://trustfactory_assessment.test/admin/login
Home Page: http://trustfactory_assessment.test
- Email:
admin@test.com - Password:
password - Access: Admin panel for managing products and orders
- Email:
customer@test.com - Password:
password - Access: Full shopping experience (browse, cart, orders)
- Browse products with images, descriptions, and pricing
- Search products by name
- Filter products by category
- Real-time pagination without page refresh
- Stock availability indicators
- Product images with fallback placeholders
- Add products to cart with stock validation
- Update item quantities with real-time stock checks
- Remove items from cart
- View cart total and item subtotals
- Automatic stock management (decrements on add, increments on remove)
- Loading states on all cart actions
- View order history with pagination
- Detailed order receipts in modal popup
- Order status tracking
- Customer information preservation
- Overview statistics (Total Products, My Orders, Cart Items, Low Stock)
- Recent orders list
- Quick action links
- Real-time data updates
- Create, edit, and delete products
- Upload product images
- Manage product details (name, description, price, stock)
- Category assignment
- View all products in table format
- Low stock indicators
- View all customer orders
- Filter orders by status (pending, processing, shipped, delivered)
- Update order status with automatic email notifications
- View detailed order information
- Customer information display
- Low stock email alerts (triggered when stock β€ 10)
- Order confirmation emails
- Order status update emails
- All emails sent via queue system
- Daily sales report (runs every evening at 8:00 PM)
- Email report with total orders, revenue, and product sales breakdown
- users - Customer accounts
- admins - Admin accounts (for future multi-admin support)
- categories - Product categories
- products - Product catalog with images and stock tracking
- carts - User shopping carts
- cart_items - Individual cart items
- orders - Customer orders with status tracking
- order_items - Order line items with product snapshots
- customer_infos - Preserved customer information
- Order Items: Store product name, SKU, and description to preserve order history even if products are deleted
- Customer Info: Store customer details separately to maintain order records if user account is deleted
- Product Images: Stored in
storage/app/public/productswith symbolic link to public access
- Stock is decremented when items are added to cart
- Stock is incremented when items are removed from cart
- Stock validation occurs at checkout to prevent overselling
- Low stock threshold: 10 units or less
- Pending - Order created
- Processing - Order confirmed, stock deducted
- Shipped - Order shipped to customer
- Delivered - Order completed
- Handles order status updates
- Manages status timestamps
- Sends email notifications on status changes
- Manages product image uploads
- Handles image deletion
- Provides image update functionality
- LowStockNotification - Sends email when product stock is low
- DailySalesReport - Generates and emails daily sales summary
- Default driver:
database - Jobs are queued for background processing
- Run queue worker:
php artisan queue:work
Daily sales report runs automatically via Laravel scheduler:
- Schedule: Every day at 8:00 PM
- Location:
routes/console.php - Command:
Schedule::job(new DailySalesReport)->dailyAt('20:00')
- Framework: Laravel 12
- Frontend: Livewire 3, Tailwind CSS, Flux UI Components
- Authentication: Laravel Fortify
- Database: SQLite (default), supports MySQL/PostgreSQL
- Queue: Database queue driver
- File Storage: Local filesystem with public disk
app/
βββ Jobs/
β βββ LowStockNotification.php
β βββ DailySalesReport.php
βββ Livewire/
β βββ Products.php (Customer product browsing)
β βββ Cart.php (Shopping cart management)
β βββ Orders.php (Customer order history)
β βββ Admin/
β βββ Products.php (Admin product management)
β βββ Orders.php (Admin order management)
βββ Models/
β βββ User.php
β βββ Admin.php
β βββ Product.php
β βββ Category.php
β βββ Cart.php
β βββ CartItem.php
β βββ Order.php
β βββ OrderItem.php
β βββ CustomerInfo.php
βββ Notifications/
β βββ OrderConfirmation.php
β βββ OrderStatusUpdate.php
βββ Services/
βββ OrderService.php
βββ ProductService.php
-
Browse Products
- Customer visits products page
- Searches or filters products
- Views product details and stock availability
-
Add to Cart
- Customer clicks "Add to Cart"
- System validates stock availability
- Creates or updates cart item
- Decrements product stock
- Shows loading state during process
-
Manage Cart
- Customer can update quantities
- System validates against available stock
- Stock adjusts in real-time
- Cart total updates automatically
-
Checkout
- System validates all items are still available
- Creates order with customer information snapshot
- Creates order items with product snapshots
- Deducts stock from products
- Checks for low stock and dispatches notifications
- Sends order confirmation email
- Clears cart
-
Order Tracking
- Customer views order history
- Admin updates order status
- Customer receives email notifications on status changes
-
Product Management
- Admin logs in and accesses "Manage Products"
- Can create new products with images
- Can edit existing products
- Can delete products (order history preserved)
-
Order Management
- Admin views all orders
- Filters by status if needed
- Updates order status (processing β shipped β delivered)
- System automatically sends email notifications
-
Low Stock Notifications
- Triggered when product stock drops to 10 or below
- Job dispatched to queue
- Email sent to admin@test.com
- Includes product name and current stock level
-
Daily Sales Report
- Scheduled to run daily at 8:00 PM
- Queries all orders from current day
- Calculates total revenue, orders, and items sold
- Groups by product for detailed breakdown
- Emails comprehensive report to admin
- Password hashing using bcrypt
- CSRF protection on all forms
- Authentication middleware on protected routes
- Input validation on all user inputs
- SQL injection protection via Eloquent ORM
- XSS protection via Blade templating
- Responsive design (mobile, tablet, desktop)
- Dark mode support
- Loading states on all interactive buttons
- Real-time updates without page refresh
- Modal dialogs for detailed views
- Toast notifications for user feedback
- Smooth transitions and animations
The seeder creates:
- 1 admin user (admin@test.com)
- 1 customer user (customer@test.com)
- 10 additional dummy customers
- 5 categories
- 25-75 products (5-15 per category)
Run seeder:
php artisan db:seed-
Install Dependencies
composer install npm install
-
Environment Setup
cp .env.example .env php artisan key:generate
-
Database Setup
php artisan migrate php artisan db:seed php artisan storage:link
-
Start Development Server
php artisan serve npm run dev
-
Start Queue Worker (for background jobs)
php artisan queue:work
- All prices are stored as decimals with 2 decimal places
- Stock quantities are integers
- Product images are optional (placeholder shown if missing)
- Order items preserve product information even if product is deleted
- Customer information is preserved in orders even if user is deleted
- Admin panel is accessible only to admin@test.com email
- Queue must be running for email notifications to work
- Scheduler must be running for daily sales reports
This project demonstrates:
- Laravel best practices and conventions
- Livewire component architecture
- Queue and job processing
- Scheduled tasks (cron jobs)
- Service layer pattern
- Database relationships and migrations
- File upload handling
- Email notifications
- Real-time UI updates
- Responsive design with Tailwind CSS
- Authentication and authorization
- Data persistence strategies