Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions pcweb/github.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
"""Github stars count for the reflex repository."""

import asyncio
import httpx

import reflex as rx
import contextlib

GITHUB_API_URL = "https://api.github.com/repos/reflex-dev/reflex"


def get_stars_on_build():
"""Fetch the stars when app is built as default"""
resp = httpx.get(GITHUB_API_URL)
resp.raise_for_status()
data = resp.json()
return int(data.get("stargazers_count", 21000))


REFLEX_STAR_COUNT = get_stars_on_build()


async def fetch_count():
"""Fetch the stars count of the reflex repository."""
try:
while True:
with contextlib.suppress(Exception):
global REFLEX_STAR_COUNT
data = httpx.get(GITHUB_API_URL).json()
REFLEX_STAR_COUNT = int(data["stargazers_count"])
await asyncio.sleep(3600)
except asyncio.CancelledError:
pass
REFLEX_STAR_COUNT = 21500


class GithubStarState(rx.State):
Expand Down
2 changes: 1 addition & 1 deletion pcweb/pages/pricing/faq.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,5 @@ def faq() -> rx.Component:
class_name="max-w-[40rem] flex justify-center items-center flex-col mx-auto w-full gap-2",
),
sales_button(),
class_name="flex flex-col gap-8 w-full max-w-[64.19rem] 2xl:border-x border-slate-4 2xl:border-b pb-[6rem]",
class_name="flex flex-col gap-8 w-full max-w-[64.19rem] 2xl:border-x border-slate-4 2xl:border-b pb-[6rem] pt-16",
)
2 changes: 1 addition & 1 deletion pcweb/pages/pricing/header.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def header() -> rx.Component:
return rx.box(
rx.el.h1(
"Find a plan that's right for you",
"Pricing that scales with you",
class_name="gradient-heading font-semibold text-4xl xl:text-5xl text-center",
),
rx.el.h2(
Expand Down
1 change: 0 additions & 1 deletion pcweb/pages/pricing/pricing.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def pricing() -> rx.Component:
plan_cards(),
comparison_table_hosting(),
comparison_table_oss(),
calculator_section(),
faq(),
class_name="flex flex-col relative justify-center items-center w-full",
),
Expand Down
64 changes: 12 additions & 52 deletions pcweb/pages/pricing/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
display: grid !important;
grid-template-columns: minmax(100px, 1fr) repeat(4, minmax(100px, 1fr)) !important;
padding: 1rem 2.5rem;
gap: 6rem !important;
gap: 1rem !important;
}
.rt-ScrollAreaViewport {
padding-top: 2rem;
Expand All @@ -35,10 +35,8 @@

FRAMEWORK_SECTION = [
("Open Source Framework", True, True, True, True),
("Templates", True, True, True, True),
("One Click Auth", False, False, True, True),
("Embed Reflex Apps", False, False, True, True),
("Built-in Testing", False, False, True, True),
]

REFLEX_BRANDING_SECTION = [
Expand All @@ -49,30 +47,17 @@
("Number of Generations", "5/month", "100/month/seat", "250/month/seat", "Custom"),
]

DATABASE_SECTION = [
("Connect your own SQL DB", True, True, True, True),
("Database Editor UI", False, False, True, True),
("Database Migration Tool", False, False, True, True),
]

HOSTING_TEXT_SECTION = [
("Compute Limits", "1 CPU, .5GB", "5 CPU, 10GB", "Custom", "Custom"),
("Regions", "Single", "Multiple", "Multiple", "Multiple"),
("Build logs", "7 day", "30 days", "90 days", "Custom"),
("Runtime logs", "1 day", "7 days", "30 days", "Custom"),
("Logs", "1 day", "30 days", "90 days", "Custom"),
]

HOSTING_BOOLEAN_SECTION = [
("CLI Deployments", True, True, True, True),
("Automatic CI / CD Deploy (Github)", True, True, True, True),
("Custom Domains", False, True, True, True),
("Automatic CI / CD Deploy (Github)", False, False, True, True),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should keep this one

("Secrets", True, True, True, True),
("Secret Manager", False, False, True, True),
("App Analytics", False, False, True, True),
("Traces", False, False, True, True),
("Custom Alerts", False, False, True, True),
("Rollbacks", False, False, True, True),
("Large File Support", False, False, True, True),
("Secret Manager", False, True, True, True),
("App Analytics", False, True, True, True),
("On Prem Hosting", False, False, False, True),
]

Expand All @@ -81,8 +66,6 @@
("HTTP/SSL", True, True, True, True),
("DDos Protection", True, True, True, True),
("2 Factor Auth", True, True, True, True),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should keep this one as well

("Rich Permissions Control", False, False, True, True),
("Connect to Analytics Vendors", False, False, True, True),
("Audit Logs", False, False, False, True),
("SSO", False, False, False, True),
]
Expand All @@ -92,10 +75,8 @@
]

SUPPORT_BOOLEAN_SECTION = [
("White Glove Onboarding", False, False, False, True),
("Support SLAs Available", False, False, False, True),
("Migrate Existing Apps", False, False, False, True),
("Priority Support with Reflex Engineering Team", False, False, False, True),
("Personalized Onboarding", False, False, False, True),
("", "", "", "", ""),
]

Expand Down Expand Up @@ -164,7 +145,7 @@ def create_table_row_header(name: list, coming_soon: bool = False) -> rx.Compone
rx.table.column_header_cell("Team", class_name=STYLES["header_cell_sub"]),
rx.table.column_header_cell("Enterprise", class_name=STYLES["header_cell_sub"])
],
class_name="w-full [&>*:not(:first-child)]:text-center bg-slate-2 border border-slate-3 rounded-2xl z-[6] !h-[3.625rem] relative",
class_name="w-full [&>*:not(:first-child)]:text-center bg-slate-2 border border-slate-3 rounded-2xl z-[6] !h-[3.625rem] relative align-content center",
padding_x="5rem !important",
)

Expand Down Expand Up @@ -261,44 +242,23 @@ def table_body_hosting() -> rx.Component:

def table_body_oss() -> rx.Component:
return rx.table.root(
rx.el.style(TABLE_STYLE),
rx.table.header(
create_table_row_header("Framework"),
create_table_row_header("AI", coming_soon=True),
class_name="relative",
),
create_table_body(
*[
create_checkmark_row(feature, checks)
for feature, *checks in FRAMEWORK_SECTION
],
*[create_table_row(row) for row in REFLEX_BRANDING_SECTION],
*[create_table_row(row) for row in REFLEX_AI_SECTION],
),
rx.table.header(
create_table_row_header("Database"),
create_table_row_header("Framework"),
class_name="relative",
),
create_table_body(
*[
create_checkmark_row(feature, checks)
for feature, *checks in DATABASE_SECTION
for feature, *checks in FRAMEWORK_SECTION
],
),
rx.table.header(
create_table_row_header("AI", coming_soon=True),
class_name="relative",
),
create_table_body(
*[create_table_row(row) for row in REFLEX_AI_SECTION],
),
create_table_body(
rx.table.row(
rx.table.cell(),
*[
rx.table.cell(create_action_button(text, variant, extra))
for text, variant, extra in PLAN_BUTTONS
],
class_name="w-full [&>*:not(:first-child)]:text-center bg-slate-1 !py-[1.25rem] border-y border-slate-4 !h-[76px] relative",
),
*[create_table_row(row) for row in REFLEX_BRANDING_SECTION],
),
create_table_body(
*[create_table_row(row) for row in ASTERIX_SECTION],
Expand Down
3 changes: 0 additions & 3 deletions pcweb/pcweb.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import reflex as rx
from pcweb import styles
from pcweb.github import fetch_count
from pcweb.pages import page404, routes
from pcweb.pages.docs import outblocks, exec_blocks
from pcweb.whitelist import _check_whitelisted_path
Expand Down Expand Up @@ -144,5 +143,3 @@
app.add_page(lambda: rx.fragment(), route=source, on_load=rx.redirect(target))

app.add_page(page404.component, route=page404.path)

app.register_lifespan_task(fetch_count)
Loading