Full-stack hosting examples: React Router 7, TanStack Start, Astro 6#15
Open
netanelgilad wants to merge 7 commits into
Open
Full-stack hosting examples: React Router 7, TanStack Start, Astro 6#15netanelgilad wants to merge 7 commits into
netanelgilad wants to merge 7 commits into
Conversation
… Start, Astro 6) Real flagship examples for Base44 full-stack hosting (preview), each pinning preview SDK/CLI builds via npm aliases: - fullstack-react-router — Base44 Estates: real-estate agency site with edge-cached public SSR listings, RLS-protected inquiries/favorites, and an estate-assistant agent. - fullstack-tanstack-start — Base44 CRM: private team sales CRM with owner-scoped RLS, pipeline kanban, SSR dashboards (all no-store), and a sales-copilot agent. - fullstack-astro — Meridian: coffee-roaster storefront with an edge-cached catalog, dynamic product/category pages, authenticated checkout + orders, and a shopping-concierge agent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
…ins) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
…examples The platform dispatcher no longer reverse-proxies /login on app domains — its surface is only /api/apps/* and /ws-user-apps/* — so apps must own their login page. Google OAuth is also temporarily unavailable on new base domains (gateway allowlist), so every example is now fully usable with email/password alone, including new-user sign-up. - fullstack-react-router (Estates): new /login route (sign-in, sign-up with OTP verification via SDK register/verifyOtp, Google OAuth). Header button and /favorites, /agent, /seed anonymous redirects now target the app-owned /login?from_url=… instead of the removed hosted-login paths (redirectToLogin / getLoginUrl). - fullstack-tanstack-start (CRM): /login gains sign-up + OTP verification alongside the existing email/password + Google sign-in. - fullstack-astro (Meridian): its sign-in links pointed at the platform login (wrong user pool, no round trip back) — added an app-owned /login page plus same-origin /api/auth/* routes that run the SDK server-side and set the session cookie, per the app's conventions. - READMEs: document that apps own /login; hosted login is only used by the edge gate for fully-private apps; Google OAuth on new base domains pends gateway allowlist config. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
…ing, remove mock-data fallbacks
Three live fixes across the full-stack examples:
1. Estates /login error boundary (react-router): leaf-route meta() REPLACES
the root's in RR7, so the base44:app-id/api-url tags only existed on the
home page; getBrowserClient() then threw during hydration on every other
route (login, listings, favorites, agent, property). The tags are now
rendered directly in Layout <head> from the root loader data, guaranteed
on every document.
2. CRM browser SDK hitting the wrong backend (tanstack-start): the browser
client was created with createClient({ appId }) and no serverUrl, so the
SDK defaulted to the production platform origin — kanban drag writes,
deal/contact/activity forms and the Sales Copilot (whose failure message
is the reported "base44 deploy" error) all failed. The session server fn
now threads a runtime-resolved Base44Config { appId, apiUrl } (from the
Worker env the deploy injects — never build-time env, which --prebuilt
deploys don't have) through the root context to every browser SDK call.
3. No mock data in render paths (user requirement): removed the silent
demo-catalog fallbacks from Estates loaders (seed-data now feeds ONLY the
admin /seed route) and Meridian's store.ts (demo-data.ts deleted). Pages
render real entity data with honest empty states; read errors surface via
the error boundary / a thrown 500 instead of being masked. Missing-record
404s still render not-found pages (Base44Error.status === 404).
All three apps rebuilt, redeployed and live-verified on b44apps.dev.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
…mples The dispatcher reverse-proxies /api/apps/* (and the /ws-user-apps/* websocket) on the app's own domain, so the browser SDK must never target the platform origin directly — serverUrl: "" makes every call same-origin with zero CORS. - CRM (tanstack-start): getBrowserClient now hardcodes serverUrl: ""; Base44Config threads only the runtime-resolved appId (apiUrl removed from the type, the session server fn, and the cache key). - Estates (react-router): getBrowserClient uses serverUrl: "" and no longer reads the base44:api-url meta tag; root.tsx stops rendering it. - Meridian (astro): no browser SDK — its client code only fetches its own same-origin /api/auth/* routes; verified clean, no changes. Server-side createServerClient continues to read BASE44_API_URL from the Worker env (server-to-platform, not subject to CORS). Verified: no platform-origin URLs in any built client bundle. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
… platform default The CRM sales_copilot and Estates estate_assistant agents pinned "model": "anthropic/claude-sonnet-4-20250514", a dated vendor snapshot the platform's LLM provider no longer serves (backend ProviderError: 404 not_found_error). The platform's agent model allowlist only serves claude-sonnet-4-6 / claude-sonnet-5 / claude-opus-4-6..4-8 style ids. Dropping the field resets the stored config to the "automatic" platform default on the next deploy (the agent-configs bulk PUT fully replaces the config), matching the Meridian concierge which never pinned a model. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
Part 1 — hybrid rendering showcase: - New prerendered pages: /about (brand story) and /brewing (five brew guides + cheat-sheet), both 'export const prerender = true', emitted as static HTML into dist/client and served by the asset layer before any Worker code runs. The 404 is now prerendered too (404.html, served with a real 404 status for unmatched routes). - CacheBadge grew a third mode: static pages show 'Prerendered - built at <build time>' (frozen until redeploy) vs the SSR pages' 'server-rendered at' stamp; data-testid built-at/rendered-at for assertions. - Layout accepts staticCategories (src/lib/static-nav.ts) since the build sandbox has no Base44 backend to fetch the live Category list from; header/footer gained Brew Guides + About links. - build.format 'file' so /about serves 200 directly (about.html) instead of a trailing-slash redirect. Part 2 — Astro 7: - astro 6.4.8 -> 7.0.6, @astrojs/cloudflare 13.7.0 -> 14.1.1 (the Vite 8-based major that pairs with Astro 7). Verified: no new Worker bindings in the generated wrangler.json (ASSETS only), nodejs_compat kept, sessionDrivers.memory() still supported, .wrangler/deploy/config emitted as before. - compressHTML: true keeps v6 whitespace behavior (Astro 7's 'jsx' default strips spaces around inline elements on their own line). README: new hybrid-rendering section (which pages are SSG vs SSR vs edge-cached, and what the live response headers show), Astro 7 notes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three real flagship example apps for Base44 full-stack hosting (preview) — server-rendered framework apps whose Worker code talks to Base44 through the server SDK, deployed with
base44 deploy. Each pins preview builds of the SDK and CLI via npm aliases (@base44/sdk→npm:@base44-preview/sdk,base44→npm:@base44-preview/cli); they flip to the real packages at GA.The apps
/property/:idpages (Cache-Control: public), RLS-protected inquiries (only the property's agent reads them), strictly-private favorites, hosted-login redirect, an estate-assistant agentno-storerendered-attimestamp (cache HIT/MISS is demonstrable), client cart, authenticated checkout writing realOrderentities, per-user order history, a shopping-concierge agentShared patterns (deliberate, consistent across all three)
public, max-age/s-maxageso the platform's shared edge cache stores them; anything personalized setsprivate, no-store. Cached HTML never carries per-user content (auth state hydrates client-side).rlsblock ({"data.field": "{{user.email}}"},user_condition,$or) — e.g. Estates'Inquirydenormalizes the property'sagent_emailserver-side so RLS can scope reads without cross-entity joins.createServerClient({ request, env })runs in loaders/server functions/frontmatter only; verified the service token and server client never appear in the client bundles.base44/agents/*.jsoncwith entity-scopedtool_configs; the CRM surfaces its agent as an in-app chat panel running under the logged-in user's RLS scope..wrangler/deploy/config.jsoncontract the CLI deploys from.Notes
fullstack-astroalso fixes a real Astro 6 +@astrojs/cloudflarev13 breakage from the scaffold:Astro.locals.runtime.envwas removed in Astro 6; env access now goes throughimport { env } from "cloudflare:workers"(centralized insrc/lib/base44.ts).🤖 Generated with Claude Code
https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
Generated by Claude Code