# Reflex — Full-Stack Web Apps in Pure Python > Build reactive web apps without JavaScript. Frontend and backend in one Python codebase. Deploys anywhere. 28K+ GitHub stars. ## Install Save as a script file and run: # Reflex — Full-Stack Web Apps in Pure Python ## Quick Use ```bash pip install reflex ``` ```bash reflex init my_app cd my_app reflex run ``` Open `http://localhost:3000` — your app is running. ```python # my_app/my_app.py import reflex as rx class State(rx.State): count: int = 0 def increment(self): self.count += 1 def index() -> rx.Component: return rx.box( rx.heading(f"Count: {State.count}"), rx.button("Click me", on_click=State.increment), ) app = rx.App() app.add_page(index) ``` --- ## Intro Reflex is a full-stack Python web framework with 28,200+ GitHub stars that eliminates the need for JavaScript entirely. Define your UI, state management, and backend logic all in Python — Reflex compiles the frontend to an optimized React app and handles the backend with FastAPI. With 60+ built-in UI components, real-time state sync, database integration, and one-command deployment, Reflex lets Python developers build production web apps at the speed they build scripts. Used by thousands of teams for AI dashboards, internal tools, and customer-facing products. Works with: Python, any Python library (Pandas, scikit-learn, OpenAI, etc.), PostgreSQL, SQLite. Best for Python developers who want to build web apps without learning React/Vue/JavaScript. Setup time: under 2 minutes. --- ## Reflex Architecture ### How It Works ``` You write: Pure Python | +-- Frontend (auto-compiled to React/Next.js) | 60+ UI components | Real-time state sync via WebSocket | +-- Backend (FastAPI under the hood) State management Database ORM API endpoints ``` ### 60+ Built-in Components ```python import reflex as rx def dashboard(): return rx.vstack( rx.heading("AI Dashboard"), rx.input(placeholder="Search...", on_change=State.set_query), rx.data_table(data=State.results, columns=["Name", "Score"]), rx.recharts.line_chart( rx.recharts.line(data_key="score"), data=State.chart_data, ), rx.button("Export CSV", on_click=State.export), ) ``` Components include: tables, charts, forms, modals, tabs, accordions, menus, drawers, tooltips, progress bars, and more. ### State Management ```python class ChatState(rx.State): messages: list[dict] = [] input_text: str = "" loading: bool = False async def send_message(self): self.loading = True yield # Update UI immediately response = await call_openai(self.input_text) self.messages.append({"role": "assistant", "content": response}) self.input_text = "" self.loading = False ``` ### Database Integration ```python class User(rx.Model, table=True): name: str email: str created_at: datetime = datetime.now() # CRUD operations with rx.session() as session: session.add(User(name="Alice", email="alice@example.com")) session.commit() users = session.exec(select(User)).all() ``` ### One-Command Deploy ```bash reflex deploy # Deploys to Reflex Cloud (or export for self-hosting) # Self-host export reflex export # Generates a Docker-ready production build ``` --- ## FAQ **Q: What is Reflex?** A: Reflex is a full-stack Python web framework with 28,200+ GitHub stars. Write frontend and backend in pure Python — it compiles to React/Next.js automatically. 60+ UI components, real-time state sync, and one-command deployment. **Q: How is Reflex different from Streamlit or Gradio?** A: Streamlit/Gradio are for quick demos. Reflex is for production web apps — it compiles to real React, supports custom components, database ORM, authentication, multi-page routing, and production deployment. Think "Next.js but in Python." **Q: Is Reflex free?** A: Yes, open-source under Apache-2.0. Self-hosting is free. Reflex Cloud (managed hosting) has a free tier. --- ## Source & Thanks > Created by [Reflex](https://github.com/reflex-dev). Licensed under Apache-2.0. > > [reflex](https://github.com/reflex-dev/reflex) — ⭐ 28,200+ --- ## 快速使用 ```bash pip install reflex reflex init my_app && cd my_app && reflex run ``` --- ## 简介 Reflex 是一个拥有 28,200+ GitHub stars 的全栈 Python Web 框架。用纯 Python 写前端和后端,自动编译为 React/Next.js。60+ UI 组件、实时状态同步、数据库集成、一键部署。 --- ## 来源与感谢 > Created by [Reflex](https://github.com/reflex-dev). Licensed under Apache-2.0. > > [reflex](https://github.com/reflex-dev/reflex) — ⭐ 28,200+ --- Source: https://tokrepo.com/en/workflows/2cbe9a3d-1cfc-4037-95d0-d90711bb9cbc Author: Script Depot