<!-- Parent: ../AGENTS.md -->
<!-- Generated: 2026-07-02 | Updated: 2026-07-02 -->

# src

## Purpose
All application PHP source under the `App\` namespace (PSR-4, autoloaded from `src/` per `config/services.yaml`). Follows a classic Symfony layout: attribute-routed controllers, Doctrine entities + repositories, backed enums, a PayPal service, a visit-tracking event listener, and a Twig extension.

## Key Files
| File | Description |
|------|-------------|
| `Kernel.php` | Symfony kernel (uses `MicroKernelTrait`) |

## Subdirectories
| Directory | Purpose |
|-----------|---------|
| `Controller/` | HTTP controllers, attribute-routed, incl. JSON API endpoints (see `Controller/AGENTS.md`) |
| `Entity/` | Doctrine ORM entities (see `Entity/AGENTS.md`) |
| `Enum/` | Backed PHP enums for statuses/types (see `Enum/AGENTS.md`) |
| `Repository/` | Doctrine repositories, one per entity (see `Repository/AGENTS.md`) |
| `Service/` | Application services — currently PayPal integration (see `Service/AGENTS.md`) |
| `EventListener/` | Kernel event listeners — visit statistics (see `EventListener/AGENTS.md`) |
| `Twig/` | Twig extensions (see `Twig/AGENTS.md`) |
| `DataFixtures/` | Doctrine fixtures for seeding dev data (see `DataFixtures/AGENTS.md`) |

## For AI Agents

### Working In This Directory
- Classes here are auto-registered as services (`autowire` + `autoconfigure`); `Entity/` and `Kernel.php` are excluded from service registration.
- Business/authorization logic lives largely **inside controllers** (fat controllers). There is no service layer beyond `PayPalService`.
- Auth checks are manual session lookups — see root `AGENTS.md`. When adding a protected route, replicate the existing session-check pattern from a nearby controller rather than reaching for the security firewall.

### Testing Requirements
- No meaningful automated tests. Verify by running the app and exercising the route.

### Common Patterns
- Controllers extend `AbstractController` and use `#[Route(...)]` attributes.
- Constructor injection for `EntityManagerInterface`, repositories, mailer, `PayPalService`.
- Enums are string-backed and expose a `label()` method for French display text.

## Dependencies

### Internal
- `Controller/` depends on `Entity/`, `Repository/`, `Service/`, `Enum/`, and `templates/`.

### External
- Doctrine ORM, Symfony HttpFoundation/Form/Mailer/Security, Twig.

<!-- MANUAL: -->
