brilo-example/README.md
2024-08-04 15:15:56 +02:00

2.6 KiB

How to start with development

  • Run:
bin/develop.sh
  • Enjoy your coffee ;-)
  • Symfony will serve web at [http://localhost:8000]
  • Requirements: Docker, Docker Compose v2, Bash

How to import posts:

docker compose exec -it php-fpm bin/console brilo:refresh-database

How to develop static content:

docker compose run -it php-fpm /var/www/html/node_modules/.bin/encore dev

Tests

docker compose exec --env OTEL_PHP_DISABLED_INSTRUMENTATIONS=all php-fpm 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

Logs:

Traces:

Containers:

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

TODO:

  • Add some validations, parsing of remote entities & use better db types than text (but there is no documentation of API...)
  • Custom error pages
  • Better traces in Tempo (currently very basic)
  • Monitor the result of refresh-database via Prometheus
  • Monitor 500/200 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