# 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 9 web application for Omitech, a technology services company. The application is a corporate website with service information pages and a contact form system that integrates with Telegram for notifications.

## Tech Stack

- **Backend**: Laravel 9 (PHP ^8.0.2)
- **Frontend**: React 18, Vite 3, Bootstrap 5, Sass
- **Database**: MySQL
- **Notifications**: Telegram Bot SDK (multiple packages for integration)
- **Auth**: Laravel UI with Laravel Sanctum

## Development Commands

### PHP/Laravel Commands

```bash
# Install PHP dependencies
composer install

# Run database migrations
php artisan migrate

# Seed the database
php artisan db:seed

# Clear application cache
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear

# Run tests (Unit and Feature)
php artisan test
# Or using PHPUnit directly:
vendor/bin/phpunit

# Run specific test suite
vendor/bin/phpunit --testsuite=Unit
vendor/bin/phpunit --testsuite=Feature

# Code formatting with Laravel Pint
vendor/bin/pint

# Start development server
php artisan serve
```

### Frontend Commands

```bash
# Install Node dependencies
npm install

# Run development server (Vite)
npm run dev

# Build for production
npm run build
```

## Application Architecture

### Telegram Integration

The application uses Telegram notifications as a core feature:
- Contact form submissions are automatically sent to a Telegram channel
- Configured via `TELEGRAM_CHANNEL_ID` and `TELEGRAM_BOT_TOKEN` in `.env`
- Integration managed through `MessageController::store()` method
- Uses Mexico City timezone (`America/Mexico_City`) for timestamps
- Multiple Telegram packages are available: `irazasyed/telegram-bot-sdk`, `laravel-notification-channels/telegram`, `longman/telegram-bot`

### Routing Structure

The application uses a simple, view-based routing pattern in `routes/web.php`:
- **Main sections**: `/`, `/nosotros`, `/servicios`, `/paquetes`, `/contacto`
- **Service pages**: `/geolocalizacion`, `/telecomunicaciones`, `/cloud`, `/software`, `/redes`, `/iot`
- **Landing pages**: `/aviso`
- **Contact services**: `/contactServices`
- **Message resource**: Handled by `MessageController`
- **Auth routes**: Provided by `Auth::routes()`
- **Telegram activity**: `/activity` route for testing Telegram updates

### View Organization

Views are organized in `resources/views/`:
- `home.blade.php` - Main homepage
- `secciones/` - Main website sections (nosotros, servicios, paquetes, contacto)
- `services/` - Individual service detail pages
- `landing/` - Landing pages (e.g., privacy policy)
- `layouts/` and `layouts_web/` - Layout templates
- `elementos_web/` - Reusable web components
- `auth/` - Authentication views

### Models and Database

Key models:
- `User` - Standard Laravel user authentication
- `Message` - Contact form messages (nombres, email, telefono, text)

Database migrations include:
- Standard Laravel auth tables (users, password_resets, personal_access_tokens)
- `messages` table for contact form submissions
- `failed_jobs` for queue management

### Frontend Assets

- **React components**: Located in `resources/js/components/`
- **Sass styles**: Source files in `resources/sass/`, compiled via Vite
- **Vite configuration**: Builds `resources/sass/app.scss` and `resources/js/app.js`
- Bootstrap 5 and Popper.js are included as dependencies

## Environment Configuration

Required environment variables (see `.env.example`):
- Standard Laravel configuration (APP_*, DB_*, etc.)
- **Telegram**: `TELEGRAM_CHANNEL_ID` and `TELEGRAM_BOT_TOKEN` (not in .env.example but required for message notifications)
- Database: MySQL connection details
- Mail: SMTP configuration for email (currently using Mailhog for local dev)

## Important Notes

- The application uses Laravel 9 conventions and structure
- Timezone is set to `America/Mexico_City` for message timestamps
- Contact form submissions trigger both database storage and Telegram notifications
- The `updatedActivity()` method in MessageController appears to be for Telegram webhook testing (currently has debug code)
- Authentication is provided via Laravel UI
