Introducing a new way to review your PRs.

Read the announcement

reflex-dev / reflex

πŸ•ΈοΈ Web apps in pure Python 🐍

View on GitHub

30 documents Β· Updated Nov 23, 2026

overview

Knowledge Base updated: 2026-11-22

Reflex knowledge base

Orientation

Reflex is a Python-first web application framework that turns application, state, and component declarations into a backend service plus a generated React frontend.

Its primary implementation areas are the Python runtime under reflex/, shared primitives in packages/reflex-base/, the maintained frontend runtime in packages/reflex-frontend/, and specialized packages for releases, build-platform services, benchmarks, and durable workflows.

Critical application state is represented by state trees and reactive Vars; route and page registrations live on the application runtime, while generated frontend artifacts are derived from application and component definitions rather than maintained as the source of truth.

System map

flowchart TD
  Dev[Developer application] --> App[reflex.app.App]
  App --> Routes[Page and route registry]
  App --> State[State and event runtime]
  App --> Middleware[Uploads and middleware]
  App --> Telemetry[OpenTelemetry hooks]
  App --> Compiler[Frontend compiler]
  Compiler --> Generated[Generated frontend project]
  Generated --> Frontend[reflex-frontend package]
  Frontend --> Browser[Browser React runtime]
  State <--> Browser
  CLI[CLI and project workflows] --> App
  CLI --> Compiler
  Models[Models and persistence] <--> State
  Release[Release tooling and CI] --> Packages[Published packages]
  Packages --> Dev

Glossary

  • App β€” the reflex.app.App application object that owns configuration, pages, runtime services, and server setup.
  • Var β€” a typed reactive expression that can represent state-backed values and frontend-side operations.
  • Hydration β€” synchronization that establishes browser-visible state for an application session.
  • Frontend runtime β€” the maintained JavaScript package included by generated Reflex applications for React, routing, client state, and utilities.
  • Workflow engine β€” the durable scheduling and execution subsystem for event-driven or cron-triggered work.

Codebase-wide invariants

  • Application page registration and route handling are coordinated by the application runtime; changes to reflex/app.py must preserve that relationship.
  • Reactive expressions remain typed and serializable across backend/frontend boundaries; see packages/…/base.py.
  • Generated frontend projects consume the maintained runtime package rather than duplicating its implementation; see packages/reflex-frontend/**.
  • Compiler output is derived from Python application and component declarations; changes under reflex/compiler/** must preserve generated-project compatibility.
  • Release validation is automated in repository workflows, including .github/…/integration_tests.yml.

Routing table