# CLAUDE.md

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

## Project Overview

AZH (azh.de) is a TYPO3 CMS 12.4 LTS website for a German health insurance provider. It's a PHP monorepo with custom TYPO3 extensions, Twig templating, and Grunt-based frontend build.

## Build & Development Commands

```bash
# PHP dependencies
composer install

# Frontend assets (SCSS → CSS)
npm install
grunt              # Compile SCSS + PostCSS
grunt watch        # Watch and recompile on changes

# Local development server
TYPO3_CONTEXT=Development php -S localhost:8000 -t public

# TYPO3 CLI
composer exec typo3 setup
vendor/bin/typo3 <command>
```

## Architecture

### Package Structure (packages/)

| Package | Purpose |
|---------|---------|
| **bgm_theme_azh** | Main theme with Twig components, SCSS, data processors |
| **azh_orders** | Order management, hardware/software purchasing |
| **azh_salesforce** | Salesforce CRM integration |
| **azh_services** | Pricing calculator (JSON-driven) |
| **bgm_blog** | Blog functionality (extends T3G Blog) |
| **bgm_solr** | Apache Solr search integration |
| **solrfal** | Solr file abstraction layer indexing |

### Template Hierarchy (bgm_theme_azh)

Component-based design system using Twig:
- **Atoms (a-*)**: Basic UI elements (buttons, icons, links)
- **Bricks (b-*)**: Content elements (cards, teaser, content blocks)
- **Components (c-*)**: Complex UI (header, footer, navigation, slider)
- **Pages (p-*)**: Page-level templates

Templates location: `packages/bgm_theme_azh/Resources/Private/Templates/`

### Data Flow

```
TYPO3 Backend → DataProcessors → Twig Templates → Frontend
                     ↓
              packages/bgm_theme_azh/Classes/DataProcessing/
```

### Key Directories

- `config/sites/` - Site configuration per environment
- `config/system/` - TYPO3 system settings (additional.php, settings.php)
- `build/deployer/` - Deployment configuration (Deployer)
- `build/patches/` - Composer patches for vendor packages
- `public/` - Web root

## Deployment

Docker-based deployment via GitLab CI:
- Environments: review, review-bgmdev, production
- Config: `build/deployer/deploy.php`
- CI: `.gitlab-ci.yml`

## Tech Stack

- **PHP 8.2** with TYPO3 12.4
- **Twig** templating (via cvc/typo3-twig)
- **Stimulus** for JS components
- **SCSS** compiled via Grunt
- **Apache Solr** for search
- **Salesforce** CRM integration
