Loading repository data…
Loading repository data…
alexeyPalshin / repository
A small, framework‑free PHP library that demonstrates how to interact with a REST API using clean architecture, token‑based authentication, and testable HTTP abstraction.
A minimal, framework‑free PHP client library for interacting with the fictional Great Food Ltd REST API. This project demonstrates:
I used AI (M365 Copilot) only to help draft this README and to quickly scaffold the initial project structure (folders, boilerplate files). All application logic, adaptations to real API responses, Docker/Swarm setup, tests, and examples were written and validated by me.
src/
Api/
Auth/
Exceptions/
Http/
examples/
scenario1.php
scenario2.php
tests/
fixtures/
Dockerfile
docker-compose.dev.yml
stack.yml
README.md
Rename env.example to .env and fill with your values For real api provide BASE_API_URL otherwise keep it blank to use mocked
docker compose up -d --build
docker stack deploy -c ./stack.yml greatfood
docker exec -it greatfood-php composer install
Run examples:
docker exec -it greatfood-php php examples/scenario1.php
docker exec -it greatfood-php php examples/scenario2.php
Run tests:
docker exec -it greatfood-php ./vendor/bin/phpunit
If I had more time, I would:
Response handling & validation
DTOs for entities
Menu, Product) for safer, self‑documenting data flowLogging
Distribute as a Composer package
Support alternative HTTP transports