# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This is a Bagisto e-commerce platform - a Laravel-based framework with a modular architecture. It includes both core Bagisto packages and custom modules (Glob, RKREZA namespaces) for extended functionality.

## Essential Commands

### Development & Build
- `npm run dev` - Development build with webpack
- `npm run watch` - Watch mode for development
- `npm run prod` - Production build
- `php artisan serve` - Start local development server

### Testing
- `composer run test` - Run full test suite (unit, functional, trigger tests via Codeception)
- `composer run test-win` - Windows-specific test command
- `vendor/bin/codecept run unit` - Run unit tests only
- `vendor/bin/codecept run functional` - Run functional tests only
- `./vendor/bin/phpunit` - Run PHPUnit tests

### Code Quality
- `./vendor/bin/pint` - Laravel Pint for code formatting (configured in composer.json)

### Database & Installation
- `php artisan bagisto:install` - Install Bagisto from scratch
- `php artisan migrate:fresh` - Fresh database migration
- `php artisan package:discover` - Discover packages

## Architecture

### Modular Package Structure
The application follows a modular package-based architecture with packages in `packages/` directory:

#### Core Webkul Packages
- **Core**: `packages/Webkul/Core/` - Foundation classes, configurations, data helpers
- **Admin**: `packages/Webkul/Admin/` - Admin panel functionality
- **Shop**: `packages/Webkul/Shop/` - Storefront functionality
- **User**: `packages/Webkul/User/` - User management
- **Customer**: `packages/Webkul/Customer/` - Customer functionality
- **Product**: `packages/Webkul/Product/` - Product management
- **Category**: `packages/Webkul/Category/` - Category management
- **Sales**: `packages/Webkul/Sales/` - Order and sales management
- **Checkout**: `packages/Webkul/Checkout/` - Checkout process
- **Payment**: `packages/Webkul/Payment/` - Payment gateways
- **Shipping**: `packages/Webkul/Shipping/` - Shipping methods
- **Tax**: `packages/Webkul/Tax/` - Tax calculations
- **Inventory**: `packages/Webkul/Inventory/` - Inventory management
- **API**: `packages/Webkul/API/` - REST API functionality
- **GraphQLAPI**: `packages/Webkul/GraphQLAPI/` - GraphQL API

#### Custom Packages
- **Glob Packages**: `packages/Glob/` - Custom business logic modules
  - `CustomStyle/` - Styling customizations
  - `OtpHelper/` - OTP functionality
  - `Pickup/` - Pickup services
- **RKREZA**: `packages/RKREZA/Contact/` - Contact functionality

#### Extended Features
- **Velocity**: `packages/Webkul/Velocity/` - Theme/template system
- **SocialLogin**: `packages/Webkul/SocialLogin/` - Social authentication
- **Mobikul**: `packages/Webkul/Mobikul/` - Mobile app integration
- **SAASCustomizer**: `packages/Webkul/SAASCustomizer/` - Multi-tenancy support
- **BookingProduct**: `packages/Webkul/BookingProduct/` - Booking functionality

### Package Autoloading
Each package is autoloaded via PSR-4 in `composer.json` with namespace mapping like:
- `Webkul\Core\` → `packages/Webkul/Core/src`
- `Glob\Pickup\` → `packages/Glob/Pickup/src`

### Frontend Assets
- Uses Laravel Mix for asset compilation
- Main entry points: `resources/assets/js/app.js` and `resources/assets/sass/app.scss`
- Individual packages may have their own `package.json` and `webpack.mix.js`

## Development Guidelines

### Code Style
- Uses Laravel Pint for PHP formatting
- Prettier configuration in `.prettierrc` for JS/CSS (4 spaces, single quotes, 120 char width)
- Follow Laravel and Bagisto conventions for package development

### Testing
- Uses Codeception for acceptance, functional, and unit testing
- Test configuration in `codeception.yml`
- PHPUnit available for unit tests (`phpunit.xml`)
- Tests are organized in `tests/` directory with subdirectories for different test types

### Package Development
- When creating new packages, follow the existing namespace structure
- Each package should have its own `composer.json` with proper autoloading
- Use Konekt Concord for package registration and service provider management
- Place custom packages under appropriate vendor namespace (`Glob/`, `RKREZA/`, etc.)

### Database
- Uses Laravel migrations
- Fresh install requires `php artisan bagisto:install`
- Testing uses separate database configuration (see `phpunit.xml`)

## Important Notes
- This is an extended Bagisto installation with custom modules
- Admin access: `/admin/login` (email: admin@example.com, password: admin123)
- Customer registration: `/customer/register`
- Uses modular architecture - changes should be made in appropriate packages, not core Laravel app
- For new features, consider whether they belong in existing packages or need new custom packages