reflex README

The project's README from github.com/reflex-dev/reflex. As one markdown file: README.md.

Reflex Logo

✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨

PyPI version versions Documentation PyPI Downloads Discord Twitter


[!NOTE] Build faster with Reflex:


Introduction

Reflex is a library to build full-stack web apps in pure Python.

Key features:

See our architecture page to learn how Reflex works under the hood.

⚙️ Installation

Important: We strongly recommend using a virtual environment to ensure the reflex command is available in your PATH.

🥳 Create your first app

Create a project, add Reflex, and start the development server with uv:

mkdir my_app_name
cd my_app_name
uv init

uv add reflex
uv run reflex init
uv run reflex run

You should see your app running at http://localhost:3000.

Now you can modify the source code in my_app_name/my_app_name.py. Reflex has fast refreshes so you can see your changes instantly when you save your code.

🫧 Example App

Build an image generation app in Python with Reflex: define the UI, manage state in a class, and call an image model from an event handler.

Preview of an image generation app built with Reflex
import reflex as rx
import openai

client = openai.AsyncOpenAI()


class State(rx.State):
    prompt: str = ""
    image_url: str = ""
    processing: bool = False

    @rx.event
    def set_prompt(self, value: str):
        self.prompt = value

    @rx.event
    async def generate(self):
        self.processing = True
        yield
        response = await client.images.generate(
            model="gpt-image-1.5",
            prompt=self.prompt,
        )
        self.image_url = f"data:image/png;base64,{response.data[0].b64_json}"
        self.processing = False


def index():
    return rx.vstack(
        rx.heading("Image Generator"),
        rx.input(placeholder="Enter a prompt...", on_change=State.set_prompt),
        rx.button("Generate", on_click=State.generate, loading=State.processing),
        rx.image(src=State.image_url),
    )


app = rx.App()
app.add_page(index, title="Reflex:Image Generation")

All Thanks To Our Contributors:

reflex (reflex-dev/reflex)

data-analysis
Searching Database…

29K ·GitHub
What is this?Reflex is a library for building full-stack web apps in pure Python: you write the frontend and the backend in Python, with no need to learn Javascript.
Even the frontend? Do I have to write any JavaScript at all?No — pure Python is the headline feature: your app's frontend and backend are both written in Python.
How do I get my first app running?Install the reflex package in a virtual environment, then create a project, add Reflex and start the dev server with uv — edit myappname/myappname.py and fast refreshes show changes instantly.
What do I need installed before starting?Python, plus the reflex package; the README strongly recommends a virtual environment so the reflex command is available in your PATH, and the quickstart uses uv.
Is it meant for quick prototypes or for complex, serious apps?Both: Reflex is easy to get started with but also scales to complex apps, and there is an architecture page explaining how it works under the hood.
What does a real app built with Reflex look like?The README's example is an image generation app: you define the UI, manage state in a Python class, and call an image model from an event handler.
What is the AI Builder?A Reflex offering that generates full-stack Reflex apps in seconds, listed alongside the Agent Toolkit and App Management as tools to build faster.
What is the Agent Toolkit?It connects MCP and Skills to your coding assistant so AI agents can work with Reflex, while App Management handles deploying and managing your Reflex apps.
How do I put a finished app online?The README advertises deploying in seconds, and its App Management service deploys and manages your Reflex apps.
What are similar projects?wasp, nuxt, router, django, elpis, datapages, streamlit, gin-vue-admin
Creator
reflex-dev
Size
196.4 MB
Stars
29K
Age
3y
Commits · 90 Days