ogsoft-example/README.md
2024-08-07 14:54:08 +02:00

2.1 KiB

How to start with development

  • Run:
develop.sh
  • Enjoy your coffee ;-)
  • Laravel will serve web at [http://localhost:8000] (which redirect to API documentation)
  • Requirements: Docker, Docker Compose v2, Bash

How to try API

How to create Czech public holidays:

docker compose exec -it php-fpm /var/www/html/artisan app:create-holidays CZ 2024

Tests

docker compose exec --env OTEL_PHP_DISABLED_INSTRUMENTATIONS=all php-fpm vendor/bin/phpunit

phpstan & cs

docker compose exec --env OTEL_PHP_DISABLED_INSTRUMENTATIONS=all php-fpm vendor/bin/phpcs
docker compose exec --env OTEL_PHP_DISABLED_INSTRUMENTATIONS=all php-fpm vendor/bin/phpstan --memory-limit=2G

Swagger:

regenerate swagger:

docker compose exec -it php-fpm /var/www/html/artisan l5-swagger:generate

Logs:

  • Logs in storage/logs/laravel.log file

Traces:

Containers:

  • php-fpm -> FPM and tooling
  • nginx -> Serving static content, proxy to FPM
  • mysql -> Database
  • grafana, tempo, loki, promtail, prometheus -> Monitoring stack

TODO:

  • Logs into loki
  • Better traces in Tempo (currently very basic)
  • Monitor the result of refresh-database via Prometheus
  • Monitor status codes via Prometheus
  • Sentry integration
  • Deployment to dev/test and prod, production settings, production Docker images
  • CI/CD

Notes

In real "production" code, the monitoring stack will be available from the dev/test environment. It doesn't make sense to have it on the local dev stack, but for this example, I thought it was good