A modern e-commerce platform built with Laravel and Vue.js, featuring a shopping cart system, product categories, and admin management.
- PHP 8.1 or higher
- Composer
- Node.js (v16+) and npm
- SQLite
- Git
git clone <repository-url>
cd <project-directory># Install PHP dependencies
composer install
# Install JavaScript dependencies
npm install# Copy the environment file
cp .env.example .env
# Generate application key
php artisan key:generateFor SQLite:
# Create SQLite database
touch database/database.sqlite
### 5. Run Migrations and Seeders
```bash
php artisan migrate:fresh --seednpm run dev # for development
# or
npm run build # for productionphp artisan serveVisit http://localhost:8000 to view the application.
DiscountService: Handles product discount calculations and promotions- Implements business logic separation for better maintainability
Product: Product entity with relationships to categories and cart items- Implements cart functionality and product management
CategoryController: Handles product categorization- Admin-specific controllers in the Admin namespace for backend management
HandleInertiaRequests: Manages Inertia.js requests and shared data
Welcome.vue: Main landing pageProducts/Show.vue: Product detail page with cart integration
- Uses Pinia store (
useCartStore.js) for cart state management - Implements persistent cart functionality
MergeGuestCart: Handles cart merging when guest users authenticate
-
Cart Implementation
- Separate guest and authenticated user carts
- Cart merging on user authentication
- Persistent storage using local storage and database
-
State Management
- Pinia chosen over Vuex for better TypeScript support and composition API compatibility
- Centralized cart state management for consistent shopping experience
-
Admin Interface
- Separate admin namespace for better organization
- Dedicated controllers and views for admin functionality
-
Service Layer
- Business logic abstraction in services
- Improved maintainability and testability
-
Performance Optimization
- Implement caching for product catalog
- Add image optimization and lazy loading
- Consider Redis for session storage
-
Feature Additions
- User wishlist functionality
- Advanced search with filters
- Product reviews and ratings
- Order tracking system
-
Technical Improvements
- Add comprehensive test coverage
- Implement API documentation
- Set up CI/CD pipeline
- Docker containerization
-
Security Enhancements
- Two-factor authentication
- Rate limiting for API endpoints
- Enhanced admin access controls
-
User Experience
- Real-time stock updates
- Enhanced mobile responsiveness
- Email notification system
- Social media integration