From 12c4f836dce5e46233f200218110b61b22017a97 Mon Sep 17 00:00:00 2001 From: florentdevk Date: Fri, 3 Jul 2026 21:03:18 +0200 Subject: [PATCH] docs: update README to reflect Phase 3 completion --- README.md | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 61d7147..b5d4197 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 @@ -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 ``` --- @@ -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 \ No newline at end of file