Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ designed with **Domain-Driven Design (DDD)** principles and a strict layered arc

## Architecture

```
src/Chess/
├── Domain/ # Pure PHP business logic — zero framework dependency
├── Application/ # Command/Query handlers (CQRS via Symfony Messenger)
└── Infrastructure/ # Doctrine, Symfony controllers, API serialization
```

**Dependency rule:** dependencies always point inward toward the Domain.

Expand All @@ -33,9 +31,35 @@ src/Chess/

---

## API Endpoints

| Method | Endpoint | Description |
|---|---|---|
| `POST` | `/api/games` | Start a new game |
| `GET` | `/api/games/{id}` | Get current game state |
| `POST` | `/api/games/{id}/moves` | Play a move |

### Example

```bash
# Start a game
curl -X POST http://localhost:8000/api/games

# Get game state
curl http://localhost:8000/api/games/{gameId}

# Play a move
curl -X POST http://localhost:8000/api/games/{gameId}/moves \
-H "Content-Type: application/json" \
-d '{"from": "e2", "to": "e4"}'
```

---

## Stack

- PHP 8.4 / Symfony 8.1
- Doctrine ORM / PostgreSQL
- PHPUnit 13 / PHPStan 2.2
- Docker / GitHub Actions

Expand All @@ -47,7 +71,9 @@ src/Chess/
git clone https://github.com/florentdevk/chess-api.git
cd chess-api
composer install
php bin/phpunit
docker compose up -d
php bin/console doctrine:migrations:migrate
symfony server:start
```

---
Expand All @@ -57,5 +83,5 @@ php bin/phpunit
- [x] Phase 0 — Project setup (Symfony skeleton, CI, PHPStan, CS Fixer)
- [x] Phase 1 — Domain modeling (Value Objects, Entities, Aggregate Root)
- [x] Phase 2 — Application layer (CQRS, Symfony Messenger)
- [ ] Phase 3 — Infrastructure (Doctrine, REST API)
- [x] Phase 3 — Infrastructure (Doctrine, REST API, Docker)
- [ ] Phase 4 — PHPStan level 8, OpenAPI docs
Loading