Update Readme (#1463)
* update readme * update readme --------- Co-authored-by: Alek Petuskey <alekpetuskey@Aleks-MacBook-Pro.local>
74
README.md
@ -3,62 +3,47 @@
|
||||
```
|
||||
|
||||
<div align="center">
|
||||
<img src="docs/images/reflex_dark.svg#gh-light-mode-only" alt="Reflex Logo" width="300px">
|
||||
<img src="docs/images/reflex_light.svg#gh-dark-mode-only" alt="Reflex Logo" width="300px">
|
||||
|
||||
<img src="docs/images/reflex.png">
|
||||
<hr>
|
||||
|
||||
# **Reflex**
|
||||
**✨ Performant, customizable web apps in pure Python. Deploy in seconds.**
|
||||
|
||||
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) 📱 [Component Library](https://reflex.dev/docs/library) 🖼️ [Gallery](https://reflex.dev/docs/gallery) 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy)
|
||||
|
||||
### **✨ Performant, customizable web apps in pure Python. Deploy in seconds. ✨**
|
||||
[](https://badge.fury.io/py/reflex)
|
||||

|
||||

|
||||
[](https://reflex.dev/docs/getting-started/introduction)
|
||||
[](https://discord.gg/T5WSbC2YtQ)
|
||||
|
||||
</div>
|
||||
|
||||
### README in different language
|
||||
|
||||
---
|
||||
|
||||
[English](https://github.com/reflex-dev/reflex/blob/main/README.md) | [简体中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_cn/README.md) | [繁體中文](https://github.com/reflex-dev/reflex/blob/main/docs/zh/zh_tw/README.md)
|
||||
|
||||
---
|
||||
## ⚙️ Installation
|
||||
|
||||
## 📦 1. Install
|
||||
Open a terminal and run (Requires Python 3.7+):
|
||||
|
||||
Reflex requires the following to get started:
|
||||
|
||||
- Python 3.7+
|
||||
- [Node.js 16.8.0+](https://nodejs.org/en/) (Don't worry, you won’t have to write any JavaScript!)
|
||||
|
||||
```
|
||||
```bash
|
||||
pip install reflex
|
||||
```
|
||||
|
||||
## 🥳 2. Create your first app
|
||||
## 🥳 Create your first app
|
||||
|
||||
Installing `reflex` also installs the `reflex` command line tool. Test that the install was successful by creating a new project.
|
||||
Installing `reflex` also installs the `reflex` command line tool.
|
||||
|
||||
Replace my_app_name with your project name:
|
||||
Test that the install was successful by creating a new project. (Replace `my_app_name` with your project name):
|
||||
|
||||
```
|
||||
```bash
|
||||
mkdir my_app_name
|
||||
cd my_app_name
|
||||
reflex init
|
||||
```
|
||||
|
||||
When you run this command for the first time, we will download and install [bun](https://bun.sh/) automatically.
|
||||
|
||||
This command initializes a template app in your new directory.
|
||||
|
||||
## 🏃 3. Run your app
|
||||
This command initializes a template app in your new directory.
|
||||
|
||||
You can run this app in development mode:
|
||||
|
||||
```
|
||||
```bash
|
||||
reflex run
|
||||
```
|
||||
|
||||
@ -66,7 +51,8 @@ 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
|
||||
|
||||
## 🫧 Example App
|
||||
|
||||
Let's go over an example: creating an image generation UI around DALL·E. For simplicity, we just call the OpenAI API, but you could replace this with an ML model run locally.
|
||||
|
||||
@ -133,14 +119,14 @@ def index():
|
||||
)
|
||||
|
||||
# Add state and page to the app.
|
||||
app = rx.App(state=State)
|
||||
app = rx.App()
|
||||
app.add_page(index, title="reflex:DALL·E")
|
||||
app.compile()
|
||||
```
|
||||
|
||||
Let's break this down.
|
||||
## Let's break this down.
|
||||
|
||||
### **UI In Reflex**
|
||||
### **Reflex UI**
|
||||
|
||||
Let's start with the UI.
|
||||
|
||||
@ -196,26 +182,38 @@ Our DALL·E. app has an event handler, `get_image` to which get this image from
|
||||
|
||||
### **Routing**
|
||||
|
||||
Finally, we define our app and pass it our state.
|
||||
Finally, we define our app.
|
||||
|
||||
```python
|
||||
app = rx.App(state=State)
|
||||
app = rx.App()
|
||||
```
|
||||
|
||||
We add a route from the root of the app to the index component. We also add a title that will show up in the page preview/browser tab.
|
||||
We add a page from the root of the app to the index component. We also add a title that will show up in the page preview/browser tab.
|
||||
|
||||
```python
|
||||
app.add_page(index, title="DALL-E")
|
||||
app.compile()
|
||||
```
|
||||
|
||||
You can create a multi-page app by adding more routes.
|
||||
You can create a multi-page app by adding more pages.
|
||||
|
||||
## Status
|
||||
## 📑 Resources
|
||||
|
||||
<div align="center">
|
||||
|
||||
📑 [Docs](https://reflex.dev/docs/getting-started/introduction) | 🗞️ [Blog](https://reflex.dev/blog) | 📱 [Component Library](https://reflex.dev/docs/library) | 🖼️ [Gallery](https://reflex.dev/docs/gallery) | 🛸 [Deployment](https://reflex.dev/docs/hosting/deploy)
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## ✅ Status
|
||||
|
||||
Reflex launched in December 2022 with the name Pynecone.
|
||||
|
||||
As of June 2023, we are in the **Public Beta** stage.
|
||||
As of July 2023, we are in the **Public Beta** stage.
|
||||
|
||||
- :white_check_mark: **Public Alpha**: Anyone can install and use Reflex. There may be issues, but we are working to resolve them actively.
|
||||
- :large_orange_diamond: **Public Beta**: Stable enough for non-enterprise use-cases.
|
||||
|
Before Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 658 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 280 KiB After Width: | Height: | Size: 751 KiB |
8
docs/images/reflex_dark.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg width="56" height="12" viewBox="0 0 56 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 11.6V0.400024H8.96V4.88002H6.72V2.64002H2.24V4.88002H6.72V7.12002H2.24V11.6H0ZM6.72 11.6V7.12002H8.96V11.6H6.72Z" fill="#110F1F"/>
|
||||
<path d="M11.2 11.6V0.400024H17.92V2.64002H13.44V4.88002H17.92V7.12002H13.44V9.36002H17.92V11.6H11.2Z" fill="#110F1F"/>
|
||||
<path d="M20.16 11.6V0.400024H26.88V2.64002H22.4V4.88002H26.88V7.12002H22.4V11.6H20.16Z" fill="#110F1F"/>
|
||||
<path d="M29.12 11.6V0.400024H31.36V9.36002H35.84V11.6H29.12Z" fill="#110F1F"/>
|
||||
<path d="M38.08 11.6V0.400024H44.8V2.64002H40.32V4.88002H44.8V7.12002H40.32V9.36002H44.8V11.6H38.08Z" fill="#110F1F"/>
|
||||
<path d="M47.04 4.88002V0.400024H49.28V4.88002H47.04ZM53.76 4.88002V0.400024H56V4.88002H53.76ZM49.28 7.12002V4.88002H53.76V7.12002H49.28ZM47.04 11.6V7.12002H49.28V11.6H47.04ZM53.76 11.6V7.12002H56V11.6H53.76Z" fill="#110F1F"/>
|
||||
</svg>
|
After Width: | Height: | Size: 898 B |
8
docs/images/reflex_light.svg
Normal file
@ -0,0 +1,8 @@
|
||||
<svg width="56" height="12" viewBox="0 0 56 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 11.5999V0.399902H8.96V4.8799H6.72V2.6399H2.24V4.8799H6.72V7.1199H2.24V11.5999H0ZM6.72 11.5999V7.1199H8.96V11.5999H6.72Z" fill="white"/>
|
||||
<path d="M11.2 11.5999V0.399902H17.92V2.6399H13.44V4.8799H17.92V7.1199H13.44V9.3599H17.92V11.5999H11.2Z" fill="white"/>
|
||||
<path d="M20.16 11.5999V0.399902H26.88V2.6399H22.4V4.8799H26.88V7.1199H22.4V11.5999H20.16Z" fill="white"/>
|
||||
<path d="M29.12 11.5999V0.399902H31.36V9.3599H35.84V11.5999H29.12Z" fill="white"/>
|
||||
<path d="M38.08 11.5999V0.399902H44.8V2.6399H40.32V4.8799H44.8V7.1199H40.32V9.3599H44.8V11.5999H38.08Z" fill="white"/>
|
||||
<path d="M47.04 4.8799V0.399902H49.28V4.8799H47.04ZM53.76 4.8799V0.399902H56V4.8799H53.76ZM49.28 7.1199V4.8799H53.76V7.1199H49.28ZM47.04 11.5999V7.1199H49.28V11.5999H47.04ZM53.76 11.5999V7.1199H56V11.5999H53.76Z" fill="white"/>
|
||||
</svg>
|
After Width: | Height: | Size: 908 B |