How geopnr/postparc works
Project Type and Purpose
• This is a monolithic Symfony (v3-style) web application (“postparcV2”) with both:
• A server‐rendered UI (Twig templates under app/Resources/views and PostparcBundle)
• A REST API (PostparcApiBundle under src/PostparcApiBundle)
• It is packaged with Docker (Dockerfile, docker-compose.yml) for containerized deployment, includes Symfony console commands for batch jobs, and integrates with external email (SendInBlue), analytics (Piwik), and DKIM signing.
Main Architectural Components
• Clients
• Web browser – HTTP(S) requests for the UI
• API consumers – mobile apps or third‐party systems calling the REST endpoints
• Web Tier (Docker containers)
• Reverse proxy / web server (Nginx or Apache, configured in docker/000-default.conf)
• PHP-FPM (the Symfony application code under app/, src/, vendor/)
• Application Tier
• Symfony HTTP kernel (AppKernel, bundles, controllers, services)
• Twig view layer for HTML generation
• Symfony Console for batch/cron tasks (cleanups, imports, alerts)
• Data Tier
• Relational database (MySQL or PostgreSQL via Doctrine ORM)
• File system storage (web/files for PDFs, web/importModels)
• (Optional) Cache store – Redis or Memcached for sessions or metadata
• External Services
• SendInBlue API (mailing)
• DKIM library for email signing (src/PostparcBundle/Lib/DKIM)
• Piwik/Matomo analytics service
Relationships & Interactions
• Browser → (HTTPS) → Nginx → PHP-FPM → Symfony Controllers → Doctrine → DB → back to Controller → Twig → HTML → Browser
• API client → Nginx → PHP-FPM → PostparcApiBundle REST Controllers → Doctrine → DB → JSON → API client
• Cron/CLI → Symfony Console Commands → Doctrine → DB / file storage
• Symfony Services (UserConfigService, QrCodeService, PiwikStatsService) call external HTTP APIs (SendInBlue, Piwik)
• File uploads/downloads via web/files path, managed by VichUploaderBundle if configured
Architectural Patterns and Principles
• MVC pattern: Controllers (src/.../Controller), Models/Entities (src/.../Entity), Views (Twig templates)
• Bundle structure: logical separation of UI (PostparcBundle) vs API (PostparcApiBundle)
• Modular Composer-based dependencies (vendor/, Composer scripts)
• Containerization: one container for web, one for PHP, one for DB, orchestrated via docker-compose