formatting

This commit is contained in:
lila 2026-04-10 20:20:09 +02:00
parent b3b32167c9
commit 2bcf9d7a97
7 changed files with 25 additions and 21 deletions

View file

@ -50,7 +50,7 @@ Turborepo adds parallel task running and build caching on top of pnpm workspaces
## 3. Repository Structure
```
```tree
vocab-trainer/
├── apps/
│ ├── web/ # React SPA (Vite + TanStack Router)
@ -86,7 +86,7 @@ vocab-trainer/
`pnpm-workspace.yaml` declares:
```
```yaml
packages:
- 'apps/*'
- 'packages/*'
@ -107,7 +107,7 @@ For parallel dev, use `concurrently` or just two terminal tabs for MVP.
## 4. Architecture — N-Tier / Layered
```
```text
┌────────────────────────────────────┐
│ Presentation (React SPA) │ apps/web
├────────────────────────────────────┤
@ -148,7 +148,7 @@ Each layer only communicates with the layer directly below it. Business logic li
| `nginx-proxy` | Automatic reverse proxy |
| `acme-companion` | Let's Encrypt certificate automation |
```
```docker
nginx-proxy (:80/:443)
app.domain → web:80
api.domain → api:3000 (HTTP + WS upgrade)
@ -163,7 +163,9 @@ Ephemeral room state is stored in Valkey with TTL (e.g., 1 hour).
PostgreSQL stores durable history only.
Key Format: `room:{code}:{field}`
| Key | Type | TTL | Description |
|------------------------------|---------|-------|-------------|
| `room:{code}:state` | Hash | 1h | Current question index, round status |
| `room:{code}:players` | Set | 1h | List of connected user IDs |
@ -392,7 +394,7 @@ All players see the same question at the same time. Everyone submits independent
### Game flow
```
```text
host creates room (REST) →
players join via room code (REST + WS room:join) →
room:state broadcasts player list →
@ -423,7 +425,7 @@ Active room state (connected players, current question, answers received this ro
## 12. Frontend Structure
```
```tree
apps/web/src/
├── routes/
│ ├── index.tsx # Landing / mode select