Skip to content

Reflex

Reflex lets you write a browser interface and the Python actions that respond to it in one project. It can show a dashboard or let a visitor change a record.

Visit Reflex

What happens when someone clicks in a Reflex app?

The browser shows the controls defined in Python. When a visitor clicks one, Reflex sends the event to the Python server and returns changes to the screen.

Reflex calls the values that change while a visitor uses the app state. For example, state can remember which repair time the visitor selected. Other visitors have their own state, so your Python code needs a shared store for the actual reservation.

Can you tell a selected time from a saved booking?

Use a paper sketch with two visitors and one fictional time. A selection should change only the first visitor’s view. A successful save should change the record both visitors read.

  1. Select a time on the first screen
    Mark 2:00 as selected. Leave the shared paper booking table untouched until the visitor confirms.
  2. Handle the save in Python
    Trace a Python function receiving the selection, checking it, and saving it once. Show a confirmation after the save.
  3. Open the second screen
    Read the shared table again. The time should be taken even though this visitor has separate screen state. If the database fails, show that there is no confirmed booking.

What do you need to start a project?

The current Reflex package requires Python 3.11 or newer. Start in a fresh project with its own Python environment so its packages stay separate from other apps.

If your setup uses the npm frontend build path, current Reflex also needs Node 22.22 or newer. That build creates the browser files. The Python server still handles clicks and changes.

What does a live Reflex app need?

You can use the documented managed deployment or run the app yourself. A self-hosted setup can serve the interface and Python backend together, or serve the browser files separately with a reachable Python backend.

The browser uses an ongoing connection called a WebSocket to send events and receive updates. If you put a gateway in front of the backend, confirm that it passes this connection through.

The open-source package uses the Apache 2.0 license. Hosting, persistent data and services you connect are separate costs. Confirm managed terms for your own deployment.

What should you take if you move the app?

Keep the Python source and dependency files. Reflex can export the built browser files and Python backend separately. A code export does not include the records in your database.

Restore the saved records through the database’s own tools. Set the new browser build to reach the intended backend. Verify that an isolated copy loads a restored sample and handles a test event before moving real traffic.