Skip to content

Commit 0f19226

Browse files
committed
Data for mercure
1 parent 742f0ca commit 0f19226

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

CLAUDE.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2727
## Architecture
2828

2929
### Tech Stack
30-
- **Backend**: Symfony 7 with PHP 8.3+
30+
- **Backend**: Symfony 8 with PHP 8.5
31+
- **Runtime**: FrankenPHP in Worker mode (long-running PHP processes)
32+
- **Realtime**: Mercure for server-sent events (realtime updates)
3133
- **Database**: PostgreSQL with Doctrine ORM
3234
- **Frontend**: Symfony UX (Stimulus, Turbo, Live Components), Bootstrap 5, Chart.js
3335
- **Assets**: Webpack Encore with Sass/SCSS
@@ -36,6 +38,25 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
3638
- **Payments**: Stripe integration
3739
- **Containerization**: Docker with custom base image
3840

41+
### FrankenPHP Worker Mode
42+
Since we use FrankenPHP in worker mode, PHP processes persist between requests. Services that cache data in instance properties **must implement `ResetInterface`** to clear state between requests:
43+
44+
```php
45+
use Symfony\Contracts\Service\ResetInterface;
46+
47+
final class MyService implements ResetInterface
48+
{
49+
private array $cache = [];
50+
51+
public function reset(): void
52+
{
53+
$this->cache = [];
54+
}
55+
}
56+
```
57+
58+
Symfony automatically calls `reset()` between requests. Without this, cached data from one user's request could leak to another user's request.
59+
3960
### Application Structure
4061

4162
This is a speed puzzling community website built using **Domain-Driven Design** principles with **CQRS** (Command Query Responsibility Segregation) pattern.

compose.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,8 @@ services:
106106
- .:/app
107107
- .docker/on-startup.sh:/docker-entrypoint.d/on-startup.sh
108108
depends_on:
109-
- postgres
110-
- redis
111-
- minio
109+
- web
110+
- chrome
112111
ports:
113112
- "8081:8080"
114113
environment:

0 commit comments

Comments
 (0)