# CLAUDE.md

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

## Project Overview

This is a Laravel 8 conference management system (OPC) that handles event registrations, abstract submissions, program scheduling, speaker management, and diploma generation. The application is multilingual and modular, with custom packages for different event types.

## Development Commands

### Laravel/PHP Commands
- `php artisan serve` - Start development server
- `php artisan migrate` - Run database migrations  
- `php artisan db:seed` - Seed database with test data
- `php artisan test` or `vendor/bin/phpunit` - Run tests
- `php artisan queue:work` - Process background jobs
- `php artisan view:clear` - Clear view cache
- `php artisan config:cache` - Cache configuration

### Frontend Build Commands
- `npm run dev` - Build assets for development
- `npm run watch` - Watch for file changes and rebuild
- `npm run prod` - Build optimized assets for production
- `npm run hot` - Hot module reloading for development

### Testing
- Tests are located in `tests/Feature/` and `tests/Unit/`
- Run with `php artisan test` or `vendor/bin/phpunit`
- Laravel Telescope available for debugging (when enabled)

## Architecture Overview

### Modular System
The application uses a modular architecture with custom packages:
- **Abstract module**: Handles paper/abstract submissions (`TrabajoLibre` model)
- **Programa module**: Event scheduling and program display
- **Inscripcion module**: Event registration system
- **Evaluadores module**: Paper evaluation system
- **Invoice module**: Payment processing
- **Diplomas module**: Certificate generation

Modules are symlinked from `../opc_modules/` and loaded via composer repositories.

### Key Models
- `TrabajoLibre`: Research papers/abstracts
- `Account`: User accounts for participants
- `Event`: Conference events/sessions
- `Conferencista`: Speakers/presenters
- `Inscripcion`: Event registrations
- `Diploma`: Certificate templates

### Settings System
Uses `spatie/laravel-settings` for configuration:
- `GeneralSetting`: Global application settings
- `AbstractSetting`: Paper submission settings
- `ProgramaSetting`: Program display settings
- `InscripcionSetting`: Registration settings

### Multilingual Support
- Uses `mcamara/laravel-localization` for routing
- `astrotomic/laravel-translatable` for model translations
- Translation models follow `*Translation` naming pattern

### File Management
- Uses `spatie/laravel-medialibrary` for file handling
- Custom uploader system for participant files
- LaTeX support for document generation via `laratex` package

### Frontend Stack
- Laravel Mix for asset compilation
- Bootstrap 5 UI framework
- jQuery with DataTables for data display
- CKEditor for rich text editing
- DHTMLX Scheduler for calendar/program views
- Konva.js for diploma design

### Database
- MySQL database with extensive migration system
- Uses factories and seeders for testing data
- Eloquent relationships with deep relationships via `staudenmeir/eloquent-has-many-deep`

## Key Directories
- `app/Models/`: Eloquent models
- `app/Http/Controllers/`: Request handlers
- `app/Settings/`: Application settings classes
- `app/Services/`: Business logic services
- `resources/views/`: Blade templates
- `resources/js/`: Frontend JavaScript
- `resources/assets/`: SCSS and asset files
- `database/migrations/`: Database schema changes
- `routes/`: Application routing (web.php, admin.php)

## Development Notes
- The application serves conferences in multiple languages (ES, EN, PT)
- Uses encrypted IDs for public-facing URLs
- Implements role-based access control
- Background job processing for email sending and file generation
- Integration with payment processors (PayPal, Bamboo Payments)
- PDF generation using DOMPDF and LaTeX