Architecture Overview
MediaMagic CRM is built as a microservices architecture running in Docker containers, with clear separation of concerns between services.
High-Level Architecture
Component Overview
| Component | Technology | Purpose |
|---|---|---|
| EspoCRM | PHP/MySQL | Primary CRM interface |
| Bridge API | Node.js/Express | Orchestration layer |
| PostgreSQL | PostgreSQL 16 | Analytics database |
| Grafana | Grafana 11 | Visual dashboards |
| X Server | Node.js/Playwright/FFmpeg | Platform automation & video processing |
| Automation Theme | WordPress/PHP | Podcast management & publishing UI |
Communication Patterns
1. Webhook-Driven Events
EspoCRM triggers webhooks on entity changes, which the Bridge API handles:
2. Scheduled Analytics Collection
Every 6 hours, the Bridge collects analytics from external services:
Docker Network
All services communicate via the mediamagic bridge network:
Port Mapping
| Service | Internal Port | External Port |
|---|---|---|
| EspoCRM | 80 | 8080 |
| MySQL | 3306 | — |
| Bridge API | 3100 | 3100 |
| PostgreSQL | 5432 | 5432 |
| Grafana | 3000 | 3200 |
| Mobile PWA | 80 | 3300 |
Data Storage
Persistent Volumes
Backup Important
Always backup volumes before destructive operations. Use ./backup.sh to create snapshots.
Security Considerations
- All inter-service communication stays within Docker network
- External access only through mapped ports
- API keys stored in environment variables
- EspoCRM handles authentication for CRM access
- Bridge API is internal-only (not exposed to internet in production)
Next Steps
- Learn about each component:
- Understand Data Flow
- See Docker configuration