How yasblha/proquote works
Project type and purpose
• This is a full-stack, monolithic web application built on Symfony 6.4.
• Purpose: manage quotes (“devis”), invoices, clients, payments, reminders, exports and dashboard statistics—all in one system.
File structure
• Top-level directories:
– src/: Symfony PHP code (Controllers, Entities, Repositories, Services, Forms, Validators, Commands)
– templates/: Twig views for all UI screens (dashboard, quotes, invoices, clients, emails, etc.)
– public/: compiled assets (CSS/JS), index.php bootstrap
– assets/: source JS (Alpine.js, vanilla JS controllers), CSS (Tailwind)
– config/, migrations/, docker/: framework config, database migrations, Docker setup
• Key patterns:
– MVC (Controller → Service → Repository → Entity → Twig)
– Service layer for business logic (PdfGenerator, DashboardStatsService, DevisWorkflowService, ReminderService)
– Doctrine ORM with custom repositories, migrations, data fixtures
– Event-driven reminders via Messenger + Mercure
– JWT API endpoints for headless access
README for additional insights
• Backend: Symfony MVC, Doctrine, custom services, JWT, security, validation
• Frontend: Twig, TailwindCSS, Chart.js, Alpine.js, vanilla JS
• Infrastructure: Docker Compose (PHP-FPM, Caddy web server, PostgreSQL, Mercure, Mailer), SMTP service
• External integrations: email/SMS reminders, Mercure hub for real-time, optional payment gateway
Main components and their interactions
a. User Agents (Browsers, REST clients)
b. Ingress / Web Server (Caddy container)
c. PHP-FPM / Symfony App
– HTTP Kernel → Controllers → Services → Repositories → Database
– Services emit Events → Messenger bus → Worker processes
– Mercure hub publishes real-time updates
d. Asset pipeline
– Webpack Encore / importmap → compiles TailwindCSS & JS → serves via public/
e. Database (PostgreSQL)
f. Cache & Session (Redis or filesystem – configured in cache.yaml)
g. Message broker (default Doctrine transport or Redis/RabbitMQ if configured)
h. Mercure Hub (real‐time push)
i. Mailer (SMTP or third‐party) for notifications & reminders
j. External services (e.g., SMS gateway if enabled)
Architectural patterns & design principles
• MVC separation: Controllers (HTTP) vs Twig (View) vs Services/Entities (Model)
• Service layer encapsulates business rules (PDF generation, workflow, reminders)
• Repository pattern for data access
• Event-driven processing via Messenger (asynchronous tasks)
• Real-time updates via Mercure
• Configuration-as-Code (YAML in config/) and containerization (Docker)