A full-stack, modern e-commerce platform built with Laravel 12, React 19, TypeScript, and Inertia.js
Featuring a beautiful liquid glass design, PWA support, and AI-powered MCP tools
- Features
- Tech Stack
- Architecture
- Getting Started
- Project Structure
- MCP Tools
- User Roles
- API Routes
- Testing
- PWA Support
- Contributing
- License
- Product Browsing - Browse products by categories with advanced filtering
- Shopping Cart - Add, update, and remove items from cart
- Secure Checkout - Complete checkout process with order confirmation
- Order Tracking - View order history and track order status
- User Authentication - Register, login, and manage profile
- Two-Factor Authentication - Enhanced security with 2FA support
- Dashboard Analytics - Real-time metrics, sales trends, and KPIs
- Product Management - CRUD operations for products with image uploads
- Category Management - Organize products into hierarchical categories
- Inventory Management - Track stock levels and low stock alerts
- Order Management - View, update, and manage customer orders
- Liquid Glass Design - Modern glassmorphism aesthetic with gradients
- GSAP Animations - Smooth micro-interactions and transitions
- Responsive Design - Mobile-first, works on all devices
- Dark/Light Theme - Appearance customization with green color palette
- PWA Support - Install as a native app on mobile and desktop
- 29 MCP Tools - For AI agents to interact with the e-commerce platform
- Admin Tools - Product, category, inventory, and order management
- Customer Tools - Shopping, cart, and order operations
- Public Tools - Product browsing and search
| Technology | Version | Purpose |
|---|---|---|
| PHP | 8.2+ | Server-side language |
| Laravel | 12.x | PHP framework |
| Laravel Fortify | 1.x | Authentication backend |
| Laravel MCP | 0.5.x | Model Context Protocol for AI agents |
| Inertia.js | 2.x | SPA bridge between Laravel & React |
| Technology | Version | Purpose |
|---|---|---|
| React | 19.x | Frontend library |
| TypeScript | 5.x | Type-safe JavaScript |
| TailwindCSS | 4.x | Utility-first CSS framework |
| GSAP | 3.x | Animation library |
| Radix UI | Latest | Accessible UI components |
| Lucide React | Latest | Icon library |
| Recharts | 3.x | Charts and data visualization |
| Tool | Purpose |
|---|---|
| Vite | Build tool and dev server |
| ESLint | JavaScript/TypeScript linting |
| Prettier | Code formatting |
| Pint | PHP code style fixer |
| PHPUnit | PHP testing framework |
The application follows Domain-Driven Design (DDD) principles with clear separation of concerns:
app/
βββ Domain/ # Business logic organized by domain
β βββ Catalog/ # Products, Categories
β βββ Dashboard/ # Admin analytics
β βββ Identity/ # Users, Authentication
β βββ Inventory/ # Stock management
β βββ Order/ # Orders, Order Items
β βββ Shared/ # Shared utilities
β βββ Shopping/ # Cart, Checkout
βββ Http/ # HTTP layer (Controllers, Middleware)
βββ Mcp/ # MCP Tools for AI agents
β βββ Servers/ # MCP Server configurations
β βββ Tools/ # 29 MCP tool implementations
β βββ Admin/ # Admin-only tools
β βββ Customer/ # Customer tools
β βββ Public/ # Public tools
βββ Models/ # Eloquent models
Ensure you have the following installed:
- PHP >= 8.2
- Composer >= 2.x
- Node.js >= 20.x
- npm >= 10.x
- SQLite (or MySQL/PostgreSQL)
-
Clone the repository
git clone https://github.com/yourusername/AgentCart.git cd AgentCart -
Install dependencies
composer install npm install
-
Run the setup script
composer setup
This command will:
- Install PHP dependencies
- Copy
.env.exampleto.env - Generate application key
- Run database migrations
- Install npm dependencies
- Build frontend assets
Copy the example environment file and configure it:
cp .env.example .envKey environment variables:
# Application
APP_NAME=AgentCart
APP_URL=https://store.heygeeks.in
# Database (SQLite by default)
DB_CONNECTION=sqlite
# For MySQL, uncomment and configure:
# DB_CONNECTION=mysql
# DB_HOST=127.0.0.1
# DB_PORT=3306
# DB_DATABASE=AgentCart
# DB_USERNAME=root
# DB_PASSWORD=
# Dashboard Configuration
DASHBOARD_LOW_STOCK_THRESHOLD=10
DASHBOARD_RECENT_ORDERS_LIMIT=10
DASHBOARD_SALES_TRENDS_DAYS=30-
Run migrations
php artisan migrate
-
Seed the database with sample data
php artisan db:seed
This creates:
- Admin user:
admin@example.com(password:password) - 5 sample customer users
- Sample categories
- Sample products with images
- Sample inventory data
- Sample orders
- Admin user:
Development mode (recommended):
composer run devThis starts concurrently:
- Laravel development server on
https://store.heygeeks.in - Queue worker for background jobs
- Vite dev server for hot module replacement
Or run services individually:
# Terminal 1 - Laravel server
php artisan serve
# Terminal 2 - Vite dev server
npm run dev
# Terminal 3 - Queue worker
php artisan queue:listenProduction build:
npm run buildAgentCart/
βββ app/
β βββ Actions/ # Action classes
β βββ Concerns/ # Shared traits
β βββ Domain/ # Domain logic (DDD)
β βββ Http/ # Controllers, Middleware
β βββ Mcp/ # MCP Tools & Servers
β βββ Models/ # Eloquent models
β βββ Providers/ # Service providers
βββ config/ # Configuration files
βββ database/
β βββ factories/ # Model factories
β βββ migrations/ # Database migrations
β βββ seeders/ # Database seeders
βββ public/ # Public assets, manifest.json
βββ resources/
β βββ css/ # Stylesheets
β βββ js/
β β βββ components/ # React components (64 components)
β β βββ hooks/ # Custom React hooks
β β βββ layouts/ # Page layouts
β β βββ pages/ # Inertia pages
β β β βββ Admin/ # Admin pages
β β β βββ Customer/ # Customer pages
β β β βββ auth/ # Authentication pages
β β β βββ settings/ # Settings pages
β β βββ types/ # TypeScript types
β β βββ lib/ # Utilities
β βββ views/ # Blade templates
βββ routes/ # Route definitions
βββ storage/ # File storage
βββ tests/ # Test files (74 test files)
AgentCart includes 29 MCP (Model Context Protocol) tools that allow AI agents to interact with the e-commerce platform:
| Tool | Description |
|---|---|
GetDashboardMetrics |
Retrieve dashboard analytics and KPIs |
GetLowStockAlerts |
Get products with low stock levels |
CreateProduct |
Create a new product |
UpdateProduct |
Update product details |
DeleteProduct |
Delete a product |
ListProducts |
List all products with pagination |
CreateCategory |
Create a new category |
UpdateCategory |
Update category details |
DeleteCategory |
Delete a category |
ListCategories |
List all categories |
ListOrders |
List all orders |
ViewOrderDetails |
View order details |
UpdateOrderStatus |
Update order status |
AdjustInventory |
Adjust inventory levels |
ViewStockLevels |
View current stock levels |
| Tool | Description |
|---|---|
ListProducts |
Browse available products |
SearchProducts |
Search products by keyword |
ViewProductDetails |
View product details |
ViewCart |
View shopping cart contents |
AddToCart |
Add item to cart |
UpdateCartItem |
Update cart item quantity |
RemoveCartItem |
Remove item from cart |
Checkout |
Complete checkout |
ListMyOrders |
List customer's orders |
ViewMyOrderDetails |
View order details |
| Tool | Description |
|---|---|
ListProducts |
Browse public product catalog |
ListCategories |
Browse categories |
SearchProducts |
Search products |
ViewProductDetails |
View product details |
To connect to the MCP server from an AI client (like Claude Desktop), use the following configuration:
{
"mcpServers": {
"remote-example": {
"command": "npx",
"args": [
"mcp-remote",
"https://store.heygeeks.in/mcp/admin"
]
}
}
}The MCP server uses OAuth 2.0 authentication via Laravel Passport. Follow these steps to authenticate:
- OAuth Flow: When connecting to the MCP server, you'll be redirected to authenticate via the OAuth flow
- Authorization: After logging in, authorize the MCP client to access your account
- Token Exchange: The MCP client will receive an access token for subsequent requests
Available MCP Endpoints:
| Endpoint | Description | Authentication |
|---|---|---|
/mcp/admin |
Admin MCP tools | Requires admin role |
/mcp/customer |
Customer MCP tools | Requires authenticated user |
/mcp/public |
Public MCP tools | No authentication required |
Note
The mcp-remote package handles the OAuth flow automatically. When you first connect, a browser window will open for authentication.
π For detailed setup instructions with Claude Desktop, ChatGPT, LM Studio, Ollama, and Moltbot, see
public/mcp-guide.md.
| Role | Description | Access |
|---|---|---|
| Admin | Platform administrator | Full access to admin dashboard, product management, orders, inventory |
| Customer | Registered shopper | Browse products, manage cart, place orders, view order history |
| Guest | Unregistered visitor | Browse products, view product details |
| Method | URI | Description |
|---|---|---|
| GET | / |
Home page |
| GET | /products |
Product listing |
| GET | /products/{product} |
Product details |
| Method | URI | Description |
|---|---|---|
| GET | /cart |
View cart |
| POST | /cart |
Add to cart |
| PUT | /cart/{cartItem} |
Update cart item |
| DELETE | /cart/{cartItem} |
Remove from cart |
| GET | /checkout |
Checkout page |
| POST | /checkout |
Process checkout |
| GET | /orders |
Order history |
| GET | /orders/{order} |
Order details |
| Method | URI | Description |
|---|---|---|
| GET | /admin/dashboard |
Admin dashboard |
| CRUD | /admin/products |
Product management |
| CRUD | /admin/categories |
Category management |
| GET/PUT | /admin/inventory |
Inventory management |
| GET/PUT | /admin/orders |
Order management |
The project includes 74 test files covering all major functionality.
Run all tests:
php artisan testRun with code coverage:
php artisan test --coverageRun specific test file:
php artisan test tests/Feature/ProductTest.phpLinting:
# PHP linting
composer lint
# JavaScript/TypeScript linting
npm run lint
# Format code
npm run formatAgentCart is a Progressive Web App (PWA) that can be installed on mobile devices and desktops:
- Installable - Add to home screen on iOS, Android, and desktop
- Offline Support - Basic offline functionality with service worker
- App Shortcuts - Quick access to Products, Cart, and Orders
- Native Feel - Standalone display mode without browser UI
- Visit the site on your mobile device or desktop
- Look for the "Install" prompt or browser's install option
- Follow the installation instructions for your platform
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a 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
- Follow PSR-12 coding standards for PHP
- Use TypeScript strictly (no
anytypes) - Write tests for new features
- Run linting before committing
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ using Laravel, React, and modern web technologies