Skip to content

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

ComponentTechnologyPurpose
EspoCRMPHP/MySQLPrimary CRM interface
Bridge APINode.js/ExpressOrchestration layer
PostgreSQLPostgreSQL 16Analytics database
GrafanaGrafana 11Visual dashboards
X ServerNode.js/Playwright/FFmpegPlatform automation & video processing
Automation ThemeWordPress/PHPPodcast 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

ServiceInternal PortExternal Port
EspoCRM808080
MySQL3306
Bridge API31003100
PostgreSQL54325432
Grafana30003200
Mobile PWA803300

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

MediaMagic CRM Documentation