Skip to content

Commit 0c87f68

Browse files
authored
Merge branch 'main' into pr-1266
2 parents 6da51d8 + 7ff23e3 commit 0c87f68

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2693
-1052
lines changed

.github/workflows/repository_dispatch.yml

Lines changed: 0 additions & 16 deletions
This file was deleted.

case-studies/autodesk.md

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,186 @@
1+
---
2+
company: Autodesk
3+
description: "Streamlining Complex Workflows: Why Autodesk Chose Reflex Over Streamlit for Scalable, Python-Based Solutions"
4+
domain: "https://autodesk.com"
5+
founded: "San Francisco, 1982"
6+
investors: "NASDAQ"
7+
stats: [
8+
{
9+
"metric": "Company projects completed with Reflex",
10+
"value": "4"
11+
},
12+
{
13+
"metric": "Time saved on each project with Reflex",
14+
"value": "25%"
15+
},
16+
{
17+
"metric": "Cost saved as 1 person can do the job of 2 with Reflex",
18+
"value": "50%"
19+
}
20+
]
21+
meta: [
22+
{
23+
"name": "keywords",
24+
"content": "
25+
autodesk web app,
26+
python web app for construction,
27+
reflex vs streamlit,
28+
python react for data management,
29+
reflex autodesk case study,
30+
python data visibility,
31+
python workflow automation,
32+
python and react components,
33+
autodesk consulting tools,
34+
python web apps for enterprise,
35+
scalable python web apps,
36+
self-hosted python web apps,
37+
python web apps,
38+
react with python,
39+
web app framework python,
40+
web app python,
41+
"
42+
}
43+
]
44+
---
45+
46+
```python exec
47+
import reflex as rx
48+
from reflex_image_zoom import image_zoom
49+
from pcweb.pages.docs import library
50+
```
51+
52+
<!-- ```python eval
53+
rx.vstack(
54+
image_zoom(rx.image(src="/case_studies/bayesline_app.png", border_radius="10px", alt="Bayesline App")),
55+
rx.text("Bayesline App built with Reflex"),
56+
width="100%",
57+
)
58+
``` -->
59+
60+
61+
Meet Autodesk a globally recognized leader in design and engineering software, known for its innovative solutions that empower professionals across industries to bring their creative visions to life. Autodesk has established itself as a trusted partner for millions of users worldwide, helping them achieve greater efficiency, precision, and creativity in their projects.
62+
63+
In addition to its flagship offerings like AutoCAD, Revit, Maya, and Fusion 360, Autodesk serves a wide range of industries, including architecture, manufacturing, construction, and media.
64+
65+
66+
67+
## Struggling with Data Visibility and Manual Workflows
68+
69+
Autodesk Consulting provides support to customers to enable data-centric workflows, and integrating systems with custom app development leveraging Autodesk Platform Services.
70+
71+
Autodesk consults for a wide variety of companies that need a better way to move data and manage their digital project delivery in a way that is easily visible for all stakeholders to see the progress. Up until now, many relied on legacy, disconnected workflows using spreadsheets or other 3rd party systems, disjoint from where the live project data is stored.
72+
73+
These companies hired Autodesk Consulting to help them move their data more efficiently and visibly to create insights. The main parts that they needed help with were:
74+
75+
- **Document Management**: This feature helps construction teams organize, store, and share important documents (e.g., blueprints, contracts, plans, [3D designs and 2D drawings data](https://tutorials.autodesk.io/tutorials/simple-viewer/)) efficiently in a Common Data Environment.
76+
- **RFI (Request for Information)**: RFIs are formal requests used during construction to clarify aspects of a project. Autodesk Build allows users to manage and track these RFIs within the platform.
77+
78+
Autodesk was looking to build an app for its clients to exchange information between design and construction. These companies wanted automated workflows to migrate RFI submissions and handle the repetitive, time-consuming and error prone actions like document uploads, data entry, attachments and comment logs for collaboration.
79+
80+
Paolo Serra, a Principal Implementation Consultant at Autodesk, was tasked with this project. Paolo is a Python developer and was looking for a web based solution. He didn’t want to use React and Javascript, but still wanted to build a production grade web app.
81+
82+
```md quote
83+
- name: Paolo
84+
- role: Principal Implementation Consultant
85+
It normally requires multiple people to get an app up and there was a lack of resources available in the time frame we needed.
86+
```
87+
88+
The solution had to be cloud based, to connect to existing systems and they only had 60 days to deliver it all.
89+
90+
Failure to deliver the value and results, due to contract obligations, could lead to court litigations, financial losses, damaged reputation and losing the customer. And as Consulting services are available for high-end customers in the context of Enterprise Business Agreements, there was a lot at stake.
91+
92+
93+
94+
## Why Existing Solutions Fell Short for Autodesk’s Needs
95+
96+
Paolo explored other Python web app frameworks like Mesop and FastUI, but neither supported React—a requirement for all Autodesk products to ensure consistent styling with Autodesk certified React components. Company policy mandates building on Weave, a local company fork of the Material UI React library.
97+
98+
He explored Streamlit, Taipy and Dash, but didn’t like the way they looked and again did not have an easy way to use the required React components. He wanted to focus on business logic not low level implementation details.
99+
100+
```md quote
101+
- name: Paolo
102+
- role: Principal Implementation Consultant
103+
Reflex gave us the freedom to create a product that could meet our business needs compared to streamlit to name one.
104+
```
105+
106+
## Enabling Rapid Development with Reflex and Custom Components
107+
108+
Reflex’s React wrapping feature allowed Paolo to integrate the Weave React component library—a company requirement—directly into his app.
109+
110+
```md quote
111+
- name: Paolo
112+
- role: Principal Implementation Consultant
113+
Wrapping the React component in Reflex allowed us to catch and prevent common issues, enforce standardization and raise more descriptive errors. The result is that instead of days it takes hours to be productive with the same design system.
114+
```
115+
116+
Their team was able to leverage reusable high level components to build out UI with clean code including:
117+
118+
- A custom wrapped Treeview component to show the file directory
119+
- A wrapped ModelViewer React component to view and collaborate on 2D drawings and 3D models via Autodesks Platform Services Viewer
120+
- A table component to show and filter the data
121+
122+
The team was able to:
123+
124+
- Connect to different data sources using Python code they already had available
125+
- Hook the app up with Autodesk auth
126+
- Self-host their reflex app with their internal infrastructure, deploying to Azure
127+
128+
129+
```md quote
130+
- name: Paolo
131+
- role: Principal Implementation Consultant
132+
I am able to wear all the caps at once: Solution Architecture, UI/UX, front-end and back-end.
133+
```
134+
135+
136+
137+
138+
## Why Autodesk chose Reflex
139+
140+
141+
Paolo and his team chose Reflex to develop a production-ready web app fully in Python. Reflex offered several key advantages, including:
142+
143+
* Allowing Autodesk to achieve more with fewer resources, significantly reducing overall costs
144+
145+
```md quote
146+
- name: Paolo
147+
- role: Principal Implementation Consultant
148+
One person the can do the job of two with Reflex, so it cut our cost in half.
149+
```
150+
151+
* Rapid prototyping, ensuring faster, more collaborative development
152+
153+
```md quote
154+
- name: Paolo
155+
- role: Principal Implementation Consultant
156+
The time from ideation to prototype is shorter than traditional web dev, which is a massive win when you need to get to shared understanding of the product you are building.
157+
```
158+
159+
* Saving Autodesk 25% on project timelines, delivering results faster and impressing clients.
160+
161+
```md quote
162+
- name: Paolo
163+
- role: Principal Implementation Consultant
164+
A couple of weeks of work can be skimmed off the estimate for an average 60 day project by using Reflex meaning we were able to focus on exceeding customer expectations.
165+
```
166+
167+
* The ability to wrap their local react library, which was a company requirement, and create reusable high-level components
168+
169+
* Future proofing their code by writing it in Python
170+
171+
172+
173+
### From One Project to Four
174+
175+
Paolo and his team have now worked on three other projects for different customers with Reflex:
176+
177+
1. A content management service to entirely redesign the way in which their consulting is delivered, from an in person experience to an online digital platform for consulting
178+
2. An information registry project with digital delivery of artifacts
179+
3. An analysis component dashboard which understands insights into what is happening in a companies local data, draws conclusions, and link to all the relevant Autodesk services
180+
181+
182+
```md quote
183+
- name: Paolo
184+
- role: Principal Implementation Consultant
185+
Everything I was able to accomplish was because of the framework and unparalleled support and promptness of the Reflex team.
186+
```

docs/api-reference/browser_storage.md

Lines changed: 98 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,70 @@ rx.button(
142142
)
143143
```
144144

145+
## rx.SessionStorage
146+
147+
Represents a state Var that is stored in sessionStorage in the browser. Similar to localStorage, but the data is cleared when the page session ends (when the browser/tab is closed). Currently only supports string values.
148+
149+
Parameters
150+
151+
- `name`: The name of the storage key on the client side.
152+
153+
```python
154+
class SessionStorageState(rx.State):
155+
# session storage with default settings
156+
s1: str = rx.SessionStorage()
157+
158+
# session storage with custom settings
159+
s2: str = rx.SessionStorage("s2 default")
160+
s3: str = rx.SessionStorage(name="s3")
161+
```
162+
163+
### Session Persistence
164+
165+
SessionStorage data is cleared when the page session ends. A page session lasts as long as the browser is open and survives page refreshes and restores, but is cleared when the tab or browser is closed.
166+
167+
Unlike LocalStorage, SessionStorage is isolated to the tab/window in which it was created, so it's not shared with other tabs/windows of the same origin.
168+
169+
## rx.remove_session_storage
170+
171+
Remove a session storage item from the client's browser.
172+
173+
Parameters
174+
175+
- `key`: The key to remove from session storage.
176+
177+
```python
178+
rx.button(
179+
'Remove Session Storage',
180+
on_click=rx.remove_session_storage('key'),
181+
)
182+
```
183+
184+
This event can also be returned from an event handler:
185+
186+
```python
187+
class SessionStorageState(rx.State):
188+
...
189+
def logout(self):
190+
return rx.remove_session_storage('session_storage_state.s1')
191+
```
192+
193+
## rx.clear_session_storage()
194+
195+
Clear all session storage items from the client's browser. This may affect other
196+
apps running in the same domain or libraries within your app that use session
197+
storage.
198+
199+
```python
200+
rx.button(
201+
'Clear all Session Storage',
202+
on_click=rx.clear_session_storage(),
203+
)
204+
```
205+
145206
# Serialization Strategies
146207

147-
If a non-trivial data structure should be stored in a `Cookie` or `LocalStorage` var it needs to be serialized before and after storing it. It is recommended to use a dataclass for the data which provides simple serialization helpers and works recursively in complex object structures.
208+
If a non-trivial data structure should be stored in a `Cookie`, `LocalStorage`, or `SessionStorage` var it needs to be serialized before and after storing it. It is recommended to use a dataclass for the data which provides simple serialization helpers and works recursively in complex object structures.
148209

149210
```python demo exec
150211
import reflex as rx
@@ -234,3 +295,39 @@ def app_settings_example():
234295
),
235296
)
236297
```
298+
299+
# Comparison of Storage Types
300+
301+
Here's a comparison of the different client-side storage options in Reflex:
302+
303+
| Feature | rx.Cookie | rx.LocalStorage | rx.SessionStorage |
304+
|---------|-----------|----------------|------------------|
305+
| Persistence | Until cookie expires | Until explicitly deleted | Until browser/tab is closed |
306+
| Storage Limit | ~4KB | ~5MB | ~5MB |
307+
| Sent with Requests | Yes | No | No |
308+
| Accessibility | Server & Client | Client Only | Client Only |
309+
| Expiration | Configurable | Never | End of session |
310+
| Scope | Configurable (domain, path) | Origin (domain) | Tab/Window |
311+
| Syncing Across Tabs | No | Yes (with sync=True) | No |
312+
| Use Case | Authentication, Server-side state | User preferences, App state | Temporary session data |
313+
314+
# When to Use Each Storage Type
315+
316+
## Use rx.Cookie When:
317+
- You need the data to be accessible on the server side (cookies are sent with HTTP requests)
318+
- You're handling user authentication
319+
- You need fine-grained control over expiration and scope
320+
- You need to limit the data to specific paths in your app
321+
322+
## Use rx.LocalStorage When:
323+
- You need to store larger amounts of data (up to ~5MB)
324+
- You want the data to persist indefinitely (until explicitly deleted)
325+
- You need to share data between different tabs/windows of your app
326+
- You want to store user preferences that should be remembered across browser sessions
327+
328+
## Use rx.SessionStorage When:
329+
- You need temporary data that should be cleared when the browser/tab is closed
330+
- You want to isolate data to a specific tab/window
331+
- You're storing sensitive information that shouldn't persist after the session ends
332+
- You're implementing per-session features like form data, shopping carts, or multi-step processes
333+
- You want to persist data for a state after Redis expiration (for server-side state that needs to survive longer than Redis TTL)

docs/api-reference/cli.md

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,21 @@ Usage: reflex [OPTIONS] COMMAND [ARGS]...
1212
Reflex CLI to create, run, and deploy apps.
1313

1414
Options:
15-
-v, --version Get the Reflex version.
16-
--help Show this message and exit.
15+
--version Show the version and exit.
16+
--help Show this message and exit.
1717

1818
Commands:
19-
db Subcommands for managing the database schema.
20-
demo Run the demo app.
21-
deploy Deploy the app to the Reflex hosting service.
22-
deployments Subcommands for managing the Deployments.
23-
export Export the app to a zip file.
24-
init Initialize a new Reflex app in the current directory.
25-
login Authenticate with Reflex hosting service.
26-
logout Log out of access to Reflex hosting service.
27-
run Run the app in the current directory.
19+
cloud The Hosting CLI.
20+
component CLI for creating custom components.
21+
db Subcommands for managing the database schema.
22+
deploy Deploy the app to the Reflex hosting service.
23+
export Export the app to a zip file.
24+
init Initialize a new Reflex app in the current directory.
25+
login Authenticate with experimental Reflex hosting service.
26+
logout Log out of access to Reflex hosting service.
27+
rename Rename the app in the current directory.
28+
run Run the app in the current directory.
29+
script Subcommands for running helper scripts.
2830
```
2931

3032
## Init
@@ -88,3 +90,39 @@ You can export your app's frontend and backend to zip files using the `reflex ex
8890
The frontend is a compiled NextJS app, which can be deployed to a static hosting service like Github Pages or Vercel.
8991
However this is just a static build, so you will need to deploy the backend separately.
9092
See the self-hosting guide for more information.
93+
94+
## Rename
95+
96+
The `reflex rename` command allows you to rename your Reflex app. This updates the app name in the configuration files.
97+
98+
```bash
99+
$ reflex rename --help
100+
Usage: reflex rename [OPTIONS] NEW_NAME
101+
102+
Rename the app in the current directory.
103+
104+
Options:
105+
--loglevel [debug|default|info|warning|error|critical]
106+
The log level to use.
107+
--help Show this message and exit.
108+
```
109+
110+
## Cloud
111+
112+
The `reflex cloud` command provides access to the Reflex Cloud hosting service. It includes subcommands for managing apps, projects, secrets, and more.
113+
114+
For detailed documentation on Reflex Cloud and deployment, see the [Cloud Quick Start Guide](https://reflex.dev/docs/hosting/deploy-quick-start/).
115+
116+
## Script
117+
118+
The `reflex script` command provides access to helper scripts for Reflex development.
119+
120+
```bash
121+
$ reflex script --help
122+
Usage: reflex script [OPTIONS] COMMAND [ARGS]...
123+
124+
Subcommands for running helper scripts.
125+
126+
Options:
127+
--help Show this message and exit.
128+
```

0 commit comments

Comments
 (0)