How to start with development
-
Requirements:
- bash
- Docker with Docker Compose (v2) command
-
Run:
develop.sh
- Enjoy your coffee ;-)
- Laravel will serve the web at [http://localhost:8000] (which redirects to API documentation).
-
To try the API:
- Use tools like Swagger ([http://localhost:8000/api/documentation]).
Tests
Run the following command to execute the tests:
docker compose exec php-fpm vendor/bin/phpunit
PHPStan & CS
- Run PHP CodeSniffer:
docker compose exec php-fpm vendor/bin/phpcs
- Run PHPStan with increased memory limit:
docker compose exec php-fpm vendor/bin/phpstan --memory-limit=2G
Swagger
To regenerate Swagger documentation, use:
docker compose exec php-fpm /var/www/html/artisan l5-swagger:generate
Containers
php-fpm
- FPM and additional toolingnginx
- Serves static content, proxies requests to FPMmysql
- Database
TODO
- Add more filtering options
- Different DB for testing (and revert changes)
- The current tests are very basic. Write additional testing scenarios (feature tests).
- Write unit tests!
- Extend Swagger documentation; currently, only one controller is documented.
- Add a monitoring stack (Prometheus, Otel, Loki, Grafana, etc.).
- Integrate Sentry.
- Establish deployment pipelines for dev/test and production environments. Configure production settings and Docker images.
- Integrate CI/CD.
Notes
Rate-limiting is managed at the NGINX layer (per IP). Therefore, there is no need to send "banned" traffic to php-fpm
and occupy workers.
Description
Languages
PHP
78.2%
Blade
20.8%
Shell
0.5%
JavaScript
0.5%