Commit Graph

8 Commits

Author SHA1 Message Date
878ebca143 Open /Events without a Base44 login
Turns PUBLIC_ROUTES into a path -> component map and adds /Events, so the page
is reachable on our own domain without the login redirect.

This removes the redirect, not the auth requirement: Event, Staff and VendorRate
all still 403 for an anonymous visitor, so the page renders its shell with empty
lists. initialData on the events query keeps that an empty state rather than a
crash. Getting real data here needs the app made public on the Base44 side.

Match case-insensitively, the way React Router already matches the gated routes
— otherwise /events and /Events would disagree about whether login is required.

Rendered bare rather than through LayoutWrapper, so the nav chrome doesn't fire
its own authenticated queries on a page meant to work signed out.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 20:47:03 +05:30
cbc9357c5c Show the landing page at / for signed-out visitors
The bare domain rendered Dashboard, so an anonymous visitor to the front door
was held on the spinner and then redirected to Google — the marketing page was
only reachable by knowing the /LandingPage URL.

Key the decision off appParams.token rather than the resolved auth state so it
settles synchronously, and the first paint is the landing page instead of a
spinner waiting on a bootstrap request that can only redirect them away. A
signed-in user still gets Dashboard.

Also treat auth_required on / as signed out. Reaching that branch there means a
token existed but is expired or revoked, and redirecting would trap the front
door in a login bounce.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 20:39:52 +05:30
015da4e68b Render the landing page without a Base44 session
LandingPage is pure marketing markup — no entity reads, no useAuth — but it sat
below both gates in AuthenticatedApp, so anonymous visitors were held on the
spinner for a bootstrap round-trip and then redirected to Google before they
could read anything about the product.

Check the path against a PUBLIC_ROUTES set first and return early. Its CTAs
still point at /Dashboard, which stays gated, so signing in is one click away.

Drops the old /LandingPage block that sat below the auth gate; the early return
makes it unreachable, as the previous ordering already did.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 20:37:10 +05:30
3c649fc123 Fix blank page on self-hosted deploys
The app reads its Base44 app id and backend URL from VITE_BASE44_APP_ID and
VITE_BASE44_BACKEND_URL, but neither was set anywhere, so Vite compiled both
defaults to undefined and app-params resolved them to null at runtime. On
base44's own host these arrive as query params; on a custom domain they never
do. A null serverUrl skipped the SDK's default (it only applies to undefined),
making every API baseURL relative — requests hit our own nginx, which answered
with index.html, and the app rendered against HTML and died. Deploys reported
success while serving an empty page.

appBaseUrl was never passed either, so login/logout redirects were relative too
and bounced between /login and the SPA fallback. redirectToLogin also omits
app_id, which base44.app/login 404s on when the request comes from our domain
rather than a *.base44.app one, so login now goes through loginWithProvider.

Set both vars as build args in the Dockerfile — they must be present at build
time, since runtime env vars in Dokploy arrive after Vite has already inlined
them. Guard the build against an empty app id and a missing dist/index.html.

Surface failures instead of hiding them: an ErrorBoundary around the tree, and
a diagnostic panel for auth errors that previously fell through to a crash.

In nginx, serve a real 404 for missing /assets/ files. Falling through to the
SPA rule returned index.html as text/html, which the browser refuses to run as
a module — another silent blank page. Also add /health and stop the SPA
fallback from being cached under the requested path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 20:31:04 +05:30
3b16d507f8 Update Dockerfile 2026-08-17 14:32:04 +00:00
f795ddd0b8 Update Dockerfile 2026-08-17 14:30:29 +00:00
6b55776b2f Add nginx.conf 2026-08-17 14:26:27 +00:00
3c27da77a8 first commit 2026-08-17 19:45:29 +05:30