# Project: bfbg (Board Game Evening Organizer)

A Symfony app for organizing board game evenings within small groups or associations. Features:
- Sync user collections with BoardGameGeek
- Create groups and invite other users
- Create events where members vote on date and games

Stack: Symfony, Twig templates, standard controllers, business logic in Services, data access in Repositories.

---

## Working rules

**Always communicate with the user in Spanish**, even if they write in English. Write all code in English.

Use **context7** to look up Symfony docs and best practices when working on this repo.

When choosing between "more idiomatic Symfony" vs. "simpler/more readable code", **prefer simpler**. The person maintaining this has less Symfony expertise.

---

## Code style

- Follow PSR-12.
- Use modern PHP with type hints and return types.
- Descriptive names for classes, methods, variables, and files.
- Keep functions small. Avoid duplicating logic.
- No global variables.

---

## Architecture

- Business logic → Services
- Data access → Repositories
- Presentation → Twig
- Do not mix SQL with HTML or controllers.
- Do not put complex validation in views.

---

## Database

- Always use prepared statements / Doctrine query builder.
- Never concatenate variables into SQL strings.
- Validate and sanitize input before use.
- No DB access from the presentation layer.

---

## Security

- Account for CSRF, XSS, SQL injection, and safe session handling.
- Never expose credentials or secrets in code — use `.env`.
- Do not suggest insecure shortcuts.

---

## Making changes

- Make minimal, targeted changes. Do not rewrite entire files unnecessarily.
- If you spot a bad pattern, suggest the improvement before touching it.
- Delete dead code — if you refactor a function into another, remove the original.
- If something depends on files not shown, ask for them before proceeding.

---

## Priorities

1. Correctness
2. Security
3. Readability
4. Maintainability
5. Performance (only when actually needed)
