Skip to content

Commit a604517

Browse files
authored
ENG-6355: template for highlight pages (#1440)
* template for highlight pages * update navbar too * re-structure page decorator for use-cases & databricks * remove use cases from sidebar
1 parent 35badcc commit a604517

File tree

8 files changed

+248
-36
lines changed

8 files changed

+248
-36
lines changed

pcweb/components/docpage/navbar/navbar.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from pcweb.pages.blog.paths import blog_data
1111
from pcweb.pages.docs import ai_builder, getting_started
1212
from pcweb.pages.faq import faq
13+
from pcweb.pages.use_cases.use_cases import use_cases_page
1314
from pcweb.pages.framework.framework import framework
1415
from pcweb.pages.hosting.hosting import hosting_landing
1516

@@ -274,11 +275,7 @@ def new_resource_section():
274275
},
275276
{"label": "Blog", "url": "/blog", "icon": "library-big"},
276277
{"label": "Affiliates", "url": "/affiliates", "icon": "network"},
277-
{
278-
"label": "Use Cases",
279-
"url": "/use-cases",
280-
"icon": "list-checks",
281-
},
278+
{"label": "Use Cases", "url": use_cases_page.path, "icon": "list-checks"},
282279
]
283280

284281
_open_source_items = [

pcweb/pages/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from pcweb.route import Route
22
from .affiliates import affiliates as affiliates
3-
from .databricks import databricks as databricks
4-
from .use_case import use_cases as use_cases
3+
from .databricks.databricks import databricks_page as databricks_page
4+
from .use_cases.use_cases import use_cases_page as use_cases_page
55
from .blog import blog_routes
66
from .customers.data.customers import customers_routes
77
from .customers.landing import customers as customers

pcweb/pages/customers/views/footer.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
import reflex as rx
44

55
from pcweb.components.button import button
6+
from pcweb.pages.gallery import gallery
7+
from pcweb.pages.docs import getting_started, hosting
8+
from pcweb.pages.docs.library import library
9+
from pcweb.pages.blog import blogs
10+
from pcweb.pages.use_cases.use_cases import use_cases_page
11+
from pcweb.pages.faq import faq
12+
from pcweb.pages.errors import errors
13+
from pcweb.signup import IndexState
614
from pcweb.components.icons import get_icon
715
from pcweb.constants import (
816
DISCORD_URL,
@@ -20,6 +28,7 @@
2028
from pcweb.pages.gallery import gallery
2129
from pcweb.signup import IndexState
2230

31+
from pcweb.pages.framework.views.footer_index import dark_mode_toggle
2332

2433
def footer_link(text: str, href: str) -> rx.Component:
2534
return rx.link(
@@ -152,7 +161,9 @@ def footer_customer() -> rx.Component:
152161
footer_link("Common Errors", errors.path),
153162
footer_link("Roadmap", ROADMAP_URL),
154163
footer_link("Forum", FORUM_URL),
155-
footer_link("Use Cases", "/use-cases"),
164+
footer_link("Use Cases", use_cases_page.path),
165+
rx.box(class_name="grow"),
166+
dark_mode_toggle(),
156167
],
157168
class_name="!row-span-3 !border-t-0",
158169
),
Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,14 @@
1-
2-
import reflex as rx
3-
41
import flexdown
2+
import reflex as rx
53
from pcweb.flexdown import xd2 as xd
6-
from pcweb.components.docpage.navbar import navbar
7-
from pcweb.pages.customers.views.footer import footer_customer
8-
from pcweb.views.bottom_section.bottom_section import bottom_section
9-
from pcweb.pages.framework.index_colors import index_colors
104

5+
from pcweb.templates.highlightpage import highlight_page
116

127
document = flexdown.parse_file("pcweb/pages/databricks/databricks.md")
138

14-
def databricks_content():
9+
def databricks_content() -> rx.Component:
1510
return rx.box(xd.render(document, document.filename))
1611

17-
18-
@rx.page(route="/databricks", title="Databricks - Reflex")
19-
def databricks():
20-
return rx.box(
21-
rx.box(
22-
index_colors(),
23-
navbar(),
24-
rx.el.main(
25-
databricks_content(),
26-
rx.box(class_name="flex-grow"),
27-
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
28-
),
29-
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
30-
bottom_section(),
31-
footer_customer(),
32-
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48",
33-
),
34-
class_name="relative overflow-hidden",
35-
)
12+
@highlight_page(path="/databricks", title="Databricks - Reflex")
13+
def databricks_page():
14+
return databricks_content()

pcweb/pages/use_cases/use_cases.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
## Use Cases by Industry
2+
3+
Organizations across industries use **Reflex** to build internal tools, dashboards, and AI-driven applications—all in pure Python. From finance to healthcare, Reflex helps teams move faster by simplifying full-stack development.
4+
5+
### 1. Financial Services
6+
7+
```python exec
8+
import reflex as rx
9+
from reflex_image_zoom import image_zoom
10+
```
11+
12+
```python eval
13+
rx.el.div(
14+
image_zoom(rx.image(src="/case_studies/bayesline_app.png", border_radius="10px", alt="Bayesline App")),
15+
class_name="py-4"
16+
)
17+
```
18+
19+
From buyside analytics desks to compliance back offices, finance teams choose **Reflex** because a single Python codebase can stream market data, crunch GPU-heavy models, and satisfy audit trails—without juggling separate front-end frameworks or ETL schedulers. With AG Grid built into the product, analysts iterate and hand a production-grade web app to traders or risk officers the same day.
20+
21+
22+
**Examples of apps you can build in Reflex:**
23+
24+
- **Factor-Risk Analytics Dashboard** – GPU-powered analytics dashboard that delivers custom equity-factor risk models in minutes instead of weeks
25+
- **End-of-Day Trade Blotter** – automatically pulls executions from every venue, flags outliers, and emails a compliance-ready PDF to traders each night.
26+
- **Asset-Allocation Simulator** – visualizes portfolio mixes and projected returns over time; users drag weight sliders and instantly see downside and drawdown scenarios.
27+
- **Treasury & Liquidity Monitor** – streams balances, pending settlements, and cash forecasts into a single real-time dashboard with threshold alerts.
28+
- **Loan-Underwriting Workflow** – scores new credit applications against live KYC/AML data, routes edge cases for manual review, and retrains the model on a weekly schedule.
29+
30+
<br>
31+
<br>
32+
33+
### 2. E-commerce & Advertising
34+
35+
```python eval
36+
rx.el.div(
37+
image_zoom(rx.image(src="/case_studies/sellerx_app.png", border_radius="10px", alt="Sellerx App")),
38+
class_name="py-4"
39+
)
40+
```
41+
42+
Modern merchants and growth marketers juggle stock feeds, ad platforms, and customer-service queues that rarely live in the same tool. **Reflex** lets teams wire those APIs together—from Amazon listings to TikTok ads—then ship production dashboards or scheduled automations with nothing but Python. The result: faster decisions on pricing, spend, and fulfillment, plus fewer hops between spreadsheets and BI tools.
43+
44+
**Examples of apps you can stand up in Reflex:**
45+
46+
- **Inventory & Pricing Command Center** – unifies marketplace sales (e.g. Amazon), real-time stock alerts, and supplier lead times in a single view.
47+
- **Campaign Control Plane** – tracks multi-channel ad spend and ROI, enforces budget caps, and auto-generates performance reports.
48+
- **AI-Powered Creative Analyzer** – runs frame-level video ad scoring to predict ROAS before campaigns go live.
49+
- **Refund & Returns Console** – pulls tickets from the help-desk, payment events from Stripe, and warehouse data to approve refunds in seconds.
50+
- **Multichannel Attribution Dashboard** – blends ad-platform metrics, web analytics, and order revenue to surface true customer-acquisition cost in real time.
51+
52+
<br>
53+
<br>
54+
55+
### 3. Engineering & DevOps
56+
57+
```python eval
58+
rx.el.div(
59+
image_zoom(rx.image(src="/case_studies/devops_app.png", border_radius="10px", alt="DevOps App")),
60+
class_name="py-4"
61+
)
62+
```
63+
64+
Site-reliability, platform, and security teams use **Reflex** to surface real-time telemetry, automate routine infra tasks, and replace shell scripts with role-based web UIs—all in pure Python.
65+
66+
**Examples of apps you can stand up in Reflex:**
67+
68+
- **Deployment & Health Dashboard** – combines service metrics, rollout status, and incident timelines in one screen for on-call engineers.
69+
- **VM Lifecycle Manager** – grants ops staff a secure web panel to start, stop, snapshot, or tag virtual machines—no CLI access required.
70+
- **Factory & Machine-Monitoring Portal** – streams sensor data from multiple plants, flags anomalies, and predicts downtime with live charts.
71+
- **Supply-Chain Automation Viewer** – visualizes robot and conveyor status in distribution centres; integrates with third-party control APIs for fast triage.
72+
- **Security-Ops Command Center** – unifies BigQuery logs, ticket data, cloud storage, Firestore, Salesforce CRM records, and PagerDuty alerts so analysts can hunt threats and track user activity in a single interface.
73+
74+
<br>
75+
<br>
76+
77+
### 4. Database Admin & CRUD
78+
79+
```python eval
80+
rx.el.div(
81+
image_zoom(rx.image(src="/case_studies/admin_app.png", border_radius="10px", alt="Admin App")),
82+
class_name="py-4"
83+
)
84+
```
85+
86+
Database admins can spin up Python-native panels that let teams **read, write, and update** their data through polished tables, forms, and charts. With **Reflex**, full-featured database dashboards and CRUD apps come together in minutes—no separate front-end stack, no raw CLI sessions.
87+
88+
**Examples of CRUD-first apps you can stand up in Reflex:**
89+
90+
- **Role-Based Postgres Admin Panel** – browse, edit, or bulk-import customer rows while keeping finance-only fields hidden behind granular permissions.
91+
- **Inventory Catalog Manager** – one screen to adjust stock levels, pricing rules, and supplier SKUs that sync instantly to every sales channel.
92+
- **Content & Data-Exchange Portal** – upload new CAD drawings, attach metadata, and version files for manufacturing projects, all stored in a single database.
93+
- **Team Management Console** – create, disable, or time-limit user accounts and access tokens for internal SaaS tooling, complete with audit logs.
94+
- **Supply-Chain Config Editor** – operations staff tweak warehouse routing rules and robotics parameters through validated forms that write directly to production tables.
95+
96+
<br>
97+
<br>
98+
99+
### 5. Data Science & Analytics
100+
101+
Data scientists and analysts can convert their notebooks into production-grade apps that expose models, metrics, and datasets through live tables, charts, and custom Python components.
102+
103+
**Examples of analytics apps you can stand up in Reflex:**
104+
105+
- **ML-Service Admin Console** – register experiment runs, visualize attention maps or confusion matrices, and promote the best model to production with one click.
106+
- **Behavioural Cohort Explorer** – drag-and-drop filters to segment users by events, demographics, and funnels, then export cohorts or schedule recurring reports.
107+
- **Fleet Metrics Self-Serve Dashboard** – slice and visualize vehicle telemetry (mileage, battery health, utilisation) so operations teams answer questions in seconds—no SQL required.
108+
- **Delivery Operations Dashboard** – monitors driver efficiency and delivery performance in real time, highlighting bottlenecks and automatically flagging late orders.
109+
- **Dataset Versioning & Quality Monitor** – upload new snapshots, run validation tests, and graph distribution shifts or missing-value spikes over time.
110+
111+
<br>
112+
<br>
113+
114+
### 6. AI & Document Workflows
115+
116+
When files, forms, recordings, and chat threads produce more raw information than teams can manually review, **Reflex** converts that unstructured content into structured, actionable insight. OCR, speech-to-text, and large-language-model pipelines plug directly into Python UIs, then push validated results to dashboards, search endpoints, or downstream APIs—no additional middleware or bespoke glue code.
117+
118+
**Examples of AI-driven document apps you can stand up in Reflex:**
119+
120+
- **Training-Session Hub** – records live video classes, transcribes speech in real time, and lets coaches search by keyword to jump to any moment.
121+
- **Smart Document Viewer** – highlights key fields (prices, SKUs, dates) as users scroll and writes the extracted values to a structured database with one click.
122+
- **Image-to-GPS Calibration Tool** – accepts bulk image uploads, matches them to GNSS logs, and visualizes camera extrinsics for quick QA.
123+
- **Enterprise Knowledge Chat** – an LLM interface that answers staff questions using contracts, wikis, and ticket history—kept secure behind SSO.
124+
- **Support & Deal-Flow Console** – shows live agent SLAs while a background workflow ingests tens of thousands of new company profiles each month; vector search and natural-language filters surface the best leads in seconds.

pcweb/pages/use_cases/use_cases.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import flexdown
2+
import reflex as rx
3+
from pcweb.flexdown import xd2 as xd
4+
5+
from pcweb.templates.highlightpage import highlight_page
6+
7+
document = flexdown.parse_file("pcweb/pages/use_cases/use_cases.md")
8+
9+
def use_cases_content() -> rx.Component:
10+
return rx.box(xd.render(document, document.filename))
11+
12+
@highlight_page(path="/use-cases", title="Use Cases - Reflex")
13+
def use_cases_page():
14+
return use_cases_content()

pcweb/templates/highlightpage.py

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
import functools
2+
from typing import Callable
3+
import reflex as rx
4+
from pcweb.route import Route
5+
6+
7+
def highlight_page(
8+
path: str,
9+
title: str = "",
10+
description: str = None,
11+
image: str = None,
12+
meta: list[dict[str, str]] = None,
13+
props=None,
14+
add_as_page=True,
15+
) -> Callable:
16+
"""A template that most pages on the reflex.dev site should use.
17+
18+
This template wraps the webpage with the navbar and footer.
19+
20+
Args:
21+
path: The path of the page.
22+
title: The title of the page.
23+
props: Props to apply to the template.
24+
add_as_page: whether to add the route to the app pages.
25+
26+
Returns:
27+
A wrapper function that returns the full webpage.
28+
"""
29+
props = props or {}
30+
31+
def webpage(contents: Callable[[], Route]) -> Route:
32+
"""Wrapper to create a templated route.
33+
34+
Args:
35+
contents: The function to create the page route.
36+
37+
Returns:
38+
The templated route.
39+
"""
40+
41+
@functools.wraps(contents)
42+
def wrapper(*children, **props) -> rx.Component:
43+
"""The template component.
44+
45+
Args:
46+
children: The children components.
47+
props: The props to apply to the component.
48+
49+
Returns:
50+
The component with the template applied.
51+
"""
52+
# Import here to avoid circular imports.
53+
from pcweb.components.docpage.navbar import navbar
54+
from pcweb.pages.customers.views.footer import footer_customer
55+
from pcweb.views.bottom_section.bottom_section import bottom_section
56+
from pcweb.pages.framework.index_colors import index_colors
57+
58+
# Wrap the component in the template.
59+
return rx.box(
60+
rx.box(
61+
index_colors(),
62+
navbar(),
63+
rx.el.main(
64+
contents(*children, **props),
65+
rx.box(class_name="flex-grow"),
66+
class_name="w-full z-[1] relative flex flex-col justify-center mx-auto max-w-[640px] lg:px-0 px-4 pb-20",
67+
),
68+
rx.box(class_name="h-[1px] bg-slate-3 w-full"),
69+
bottom_section(),
70+
footer_customer(),
71+
class_name="relative flex flex-col justify-start items-center w-full h-full min-h-screen font-instrument-sans gap-4 mx-auto max-w-[64.19rem] lg:border-x border-slate-3 pt-24 lg:pt-48",
72+
),
73+
class_name="relative overflow-hidden",
74+
)
75+
76+
return Route(
77+
path=path,
78+
title=title,
79+
description=description,
80+
image=image,
81+
meta=meta,
82+
component=wrapper,
83+
add_as_page=add_as_page,
84+
)
85+
86+
return webpage

pcweb/views/footer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from pcweb.pages.docs.library import library
1717
from pcweb.pages.errors import errors
1818
from pcweb.pages.faq import faq
19+
from pcweb.pages.use_cases.use_cases import use_cases_page
1920
from pcweb.pages.gallery import gallery
2021
from pcweb.signup import IndexState
2122

@@ -176,7 +177,7 @@ def footer() -> rx.Component:
176177
footer_link("Roadmap", ROADMAP_URL),
177178
footer_link("Forum", FORUM_URL),
178179
footer_link("Affiliates", "/affiliates"),
179-
footer_link("Use Cases", "/use-cases"),
180+
footer_link("Use Cases", use_cases_page.path),
180181
rx.box(class_name="grow"),
181182
dark_mode_toggle(),
182183
],

0 commit comments

Comments
 (0)