How digitalfabrik/integreat-cms works
Project Type & Purpose
• This is a full‐stack, monolithic Django CMS (“Integreat CMS”) that exposes both a backend CMS (Django admin-style UI + templates + JS/TS frontend) and a JSON REST API for mobile/web clients.
• It integrates with multiple external services for translations, push notifications, maps, sitemaps, etc., and uses Celery for background tasks.
High-Level Architecture & Components
A. Clients
– Web Browser / CMS UI
– Mobile/Web App (consuming the JSON API)
– CLI Tool (“integreat-cms-cli”)
B. Edge & Ingress
– Nginx/Apache or direct Gunicorn/uWSGI WSGI server
– SSL/TLS termination, static‐asset caching
C. Django Monolith
– Core Django project (“core” app) with settings, middleware, URL router
– “cms” app: models, forms, views, templates (HTML + React/TS components served via webpack)
– “api” app: DRF or similar JSON views
– Connector apps: firebase_api, deepl_api, google_translate_api, summ_ai_api, textlab_api, gvz_api, nominatim_api, sitemap, xliff
– “integreat_celery” app: Celery configuration & tasks module
D. Asynchronous Layer
– Message broker (Redis or RabbitMQ)
– Celery workers running background jobs (translations, push notifications, PDF exports, sitemap generation)
E. Persistence & Cache
– Primary relational database (PostgreSQL)
– Optional cache store (Redis/Memcached) for sessions, rate limiting
F. Static Build & Assets
– Node.js, webpack, TypeScript, SCSS pipeline produces JS/CSS bundles
– Served via Django staticfiles or a CDN
G. CI / CD / DevOps
– CircleCI pipelines, pre-commit, Flake8/Ruff, Docker/devcontainer & Nix flake for dev environment
– Migration scripts & management commands under “tools/”
Component Interactions & Data Flows
1) Synchronous HTTP flow:
Browser/Client → HTTPS → Nginx → Gunicorn/uWSGI → Django URL router → appropriate app (cms, api, sitemap) → ORM → PostgreSQL → HTTP response → browser
2) Asynchronous tasks:
Django code (e.g. view or signal) → Celery task submitted → broker (Redis/RabbitMQ) → Celery worker → external API or DB → task result persisted or triggers follow-up
3) External API integrations:
Connector modules call DeepL, Google Translate, SUMM.AI, TextLab for translations; Firebase for push; Nominatim/GVZ for geodata; Matomo for analytics.
4) Static asset pipeline:
Developers → webpack → generated bundles → served to browser via Django staticfiles
Key Architectural Patterns & Principles
• Layered monolith: clear separation of “apps” under one Django project
• MVC (Model → View → Template) for CMS UI
• API layer (REST) for headless clients
• Asynchronous task queue for heavy or external-dependent work (Celery)
• Configuration-as-code: environment variables, ini files, devcontainer.json, nix flake
• Extensibility: each integration (translation, push, map) as pluggable Django app