Test assignment implementing a high-load ready REST API using Symfony.
The application accepts user data, processes it asynchronously via a queue, enriches it with GeoIP data, and exposes a paginated API with safe sorting.
- PHP 8.3
- Symfony 7
- PostgreSQL
- Redis (Messenger transport)
- Docker
- PHPUnit
- OpenAPI / Swagger
User creation is handled via Symfony Messenger + Redis, preventing direct database writes during HTTP requests and improving resilience under high load.
The project follows SOLID practices:
- DTO for request/response isolation
- Factory for domain object creation
- Service layer for external API calls
- Thin controllers
- Enum-based sorting whitelist
- Pagination to protect the database
GeoIP lookup is performed using Symfony HttpClient with timeouts and graceful fallback handling.
Includes:
- Unit tests (Factory, Service)
- Functional API tests
Copy the environment file:
cp .env.example .envdocker compose up -d --builddocker compose exec php composer installdocker compose exec php php bin/console doctrine:migrations:migratehttp://localhost:8080/api/docdocker compose exec php php bin/phpunit