How mcambal/http-smoke-test-crawler-sf works
Project type and purpose
• This is a full-stack PHP web application based on the Symfony “website-skeleton,” extended with a Dockerfile and docker-compose.yaml to containerize the web server, PHP runtime, and supporting services (database, mailer, etc.).
• It follows the classic MVC pattern with Doctrine ORM for data persistence, Twig for templating, Monolog for logging, and Symfony’s Service Container for dependency injection.
File structure
• Top-level Docker artifacts:
• Dockerfile (builds the PHP/Symfony container)
• docker-compose.yml (defines multi-container setup: app, database, maybe cache)
• config/: Symfony configuration (bundles, packages, routes, services)
• public/: web-root entry point (index.php, assets)
• src/: application code
• Controller/ (HTTP-entrypoint → actions)
• Entity/ (Doctrine entities)
• Repository/ (data access layer)
• Kernel.php (Symfony app bootstrap)
• templates/: Twig view layer
• migrations/: database migrations
• tests/: PHPUnit tests
• .env files: environment variables for each environment
Key technical stack (from composer.json & config files)
• PHP 8+, Symfony Framework
• Doctrine ORM & Migrations
• Twig templating
• Symfony Mailer & Notifier
• Monolog for logging
• (Optional) Caching adapters (filesystem, Redis)
• Docker + Docker-Compose orchestration
Main components
a. External actor: Browser or API client
b. Reverse Proxy / HTTP Server container (Apache or Nginx)
c. PHP-FPM container running the Symfony Application
– Symfony Kernel & front controller (public/index.php)
– Service Container (config/services.yaml)
– Controllers → Services → Repositories → Doctrine → Database
– Twig rendering layer
– Logger (Monolog)
– Mailer/Notifier service calls (SMTP or an external API)
d. Database container (MySQL, PostgreSQL)
e. (Optional) Cache container (Redis/Memcached)
f. Volumes & shared mounts (code volume, logs, cache)
g. Environment variables (.env, .env.test)
h. CI/Test runner (bin/phpunit)
Relationships and interactions
• HTTP Server → PHP-FPM (FastCGI)
• PHP-FPM → Symfony Kernel → Router → Controller
• Controller ↔ Service Layer ↔ Repository → Doctrine DBAL → Database
• Controller → returns Response → Twig templates (view) → HTTP Server → Browser
• Symfony services dispatch events (Notifier → external SMTP/API)
• Doctrine Migrations update Database schema
• PHPUnit tests load Kernel → run functional/unit tests against controllers/entities
Architectural patterns & design principles
• MVC separation: Controllers (input), Entities/Repositories (model), Twig (view)
• Dependency Injection via the Service Container
• Layered architecture: HTTP layer, Application logic layer, Persistence layer
• Configuration‐as‐code: all bundles, services, routes in YAML/PHP