MCPcopy
hub / github.com/reflex-dev/reflex

github.com/reflex-dev/reflex @v0.9.6.post1 sqlite

repository ↗ · DeepWiki ↗ · release v0.9.6.post1 ↗
9,151 symbols 36,504 edges 822 files 6,702 documented · 73%
README

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:

  • Pure Python - Write your app's frontend and backend all in Python, no need to learn Javascript.
  • Full Flexibility - Reflex is easy to get started with, but can also scale to complex apps.

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:

Extension points exported contracts — how you extend this code

GradientButtonProps (Interface)
(no doc)
docs/app/assets/components/GradientButton.tsx

Core symbols most depended-on inside this repo

field
called by 1787
packages/reflex-base/src/reflex_base/components/component.py
get
called by 473
tests/integration/utils.py
join
called by 305
packages/reflex-base/src/reflex_base/vars/sequence.py
get
called by 279
packages/reflex-base/src/reflex_base/environment.py
items
called by 257
tests/integration/utils.py
get_full_name
called by 235
reflex/state.py
startswith
called by 206
packages/reflex-base/src/reflex_base/vars/sequence.py
exists
called by 195
packages/reflex-hosting-cli/src/reflex_cli/core/config.py

Shape

Function 4,575
Method 2,602
Class 1,841
Route 132
Interface 1

Languages

Python100%
TypeScript1%

Modules by API surface

tests/units/test_state.py352 symbols
tests/units/test_app.py209 symbols
packages/reflex-base/src/reflex_base/vars/base.py159 symbols
tests/units/components/test_memo.py154 symbols
tests/units/components/test_component.py143 symbols
tests/units/test_var.py134 symbols
packages/reflex-base/src/reflex_base/event/__init__.py114 symbols
packages/reflex-base/src/reflex_base/components/component.py113 symbols
reflex/state.py112 symbols
tests/units/compiler/test_plugins.py105 symbols
packages/reflex-base/src/reflex_base/vars/sequence.py102 symbols
tests/units/compiler/test_memoize_plugin.py100 symbols

Dependencies from manifests, versioned

@base-ui/react1.6.0 · 1×
@emotion/react11.14.0 · 1×
@hugeicons/core-free-icons4.2.0 · 1×
@hugeicons/react1.1.6 · 1×
@inkeep/cxkit-react0.5.115 · 1×
@mantine/core8.3.9 · 1×
@masenf/hello-reactgithub:masenf/hello- · 1×
@radix-ui/react-accordion1.2.12 · 1×
@radix-ui/react-dialog1.1.15 · 1×
@radix-ui/react-form0.1.8 · 1×
@radix-ui/themes3.3.0 · 1×

Datastores touched

dbDatabase · 1 repos
(mysql)Database · 1 repos
database_nameDatabase · 1 repos
database_nameDatabase · 1 repos
my_dbDatabase · 1 repos
mydbDatabase · 1 repos

For agents

$ claude mcp add reflex \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact