How vasisouv/painter works
Main Components Identification
The system consists of these key components:
a) API Layer
• Express.js server handling REST endpoints
• Two main routes: /api/paint/email and /api/paint/pdf
b) Template Engine Layer
• Eta template engine for composition
• Template file system structure
• Separate layouts for emails and PDFs
c) Rendering Engines
• MJML for email rendering
• Playwright for PDF rendering
Component Relationships
Client Request → API Router → Template Resolver → Rendering Engine → Response
• ↓
• Template Storage System
Specific Implementation Details
• Blue: API/HTTP components
• Green: Template processing
• Orange: Rendering engines
• Gray: Storage system
Specific elements:
• Express.js REST API endpoints
• Template resolution flow
• MJML email rendering pipeline
• Playwright PDF generation pipeline
• File system template structure
Key Architectural Patterns to Highlight
• REST API architecture
• Template composition pattern
• Pipeline processing pattern
• File-based routing system
Technical Stack Indicators
Clear demarcation of:
• Node.js/TypeScript runtime
• Express.js web framework
• Eta template engine
• MJML email framework
• Playwright browser automation
Important Details
• Template directory structure (/views/email and /views/pdf)
• Layout composition system
• Error handling flow
• Content type transformations