← langgenius/dify
CodeVetter · Repo Unpack · System map

langgenius/dify

Scanned commit 3a017e8ccc dated 2026-09-22 — last upstream commit. Generated by codevetter codevetter 1.12.0 on 2026-09-22. Deep analysis by swe-2 via the devin CLI on 2026-09-22 (runtime not recorded).

The system is a modular monolith API (Flask + flask-restx + SQLAlchemy + Celery) plus a Next.js console, with execution-heavy work pushed to Celery workers and sidecar services (plugin daemon, sandbox, agent runtime, SSRF proxy). `api/app.py` is the process entrypoint; `app_factory.create_app()` builds a `DifyApp`, runs an ordered list of ~30 `extensions/ext_*` initializers, and wraps the result in `socketio.WSGIApp`. HTTP ingress is split across eight Flask blueprints registered in `ext_blueprints.py`, each with its own CORS/auth surface. State lives in Postgres (Alembic, 219 migration files), Redis (broker, cache, rate limits, pub/sub for SSE), pluggable object storage, and pluggable vector DBs loaded via Python entry points.