App Finishers

Proof

Before and after: check our demo fixes yourself

These are our own demo apps, built to show the fix: a booking app for a made-up hair salon, Studio Mira, and a small chat page. We made them up; there are no clients behind them. Each problem comes as a pair of small sites: "before" has the problem, "after" has our fix. You can check each one in your browser, or with one command in a macOS or Linux terminal.

A common problem: a blank white page after publishing

Symptom. The app works in the editor, but the published site shows a blank white page.

Cause. The app was built without its two Supabase settings. It stops while starting, with the error "supabaseUrl is required.", so nothing appears on the screen.

Fix. Build the app again with the two settings (VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY) in place.

Check it yourself. Open the two links: the before site stays blank, the after site shows the demo salon's services. Or run this in a terminal:

S=https://af-proof-blank-page-before.pages.dev; curl -s "$S$(curl -s "$S/" | grep -o '/assets/index-[^"]*\.js')" | grep -c "demo-project.invalid"

It prints 0: the database address is missing from the published code. Run it again with S=https://af-proof-blank-page-after.pages.dev and it prints 1. The demo uses a placeholder address, demo-project.invalid. In your own app, look for your project's supabase.co address. If both sites print 0, the download failed: run it again.

Before: https://af-proof-blank-page-before.pages.dev · After: https://af-proof-blank-page-after.pages.dev

A common problem: a refresh gives "Page not found"

Symptom. The app works, but refreshing the bookings page, or opening a shared link to it, shows "Page not found".

Cause. The bookings page exists only in the app's code in the browser. When the browser asks the server for /bookings, the server has no such file and answers 404 (not found).

Fix. One line in the site's _redirects file tells the server to answer /bookings with the app itself (status 200). Addresses that do not exist still get the "Page not found" page.

Check it yourself. Open the link, click Bookings, then press refresh. The before site shows "Page not found". The after site shows the bookings page again. Or run:

curl -s -o /dev/null -w "%{http_code}\n" https://af-proof-spa-404-before.pages.dev/bookings

It prints 404. With https://af-proof-spa-404-after.pages.dev it prints 200.

Before: https://af-proof-spa-404-before.pages.dev · After: https://af-proof-spa-404-after.pages.dev

A common problem: the AI key is visible in the browser

Symptom. In a real app built this way, the chat works, but the AI key is inside app.js, a file every visitor's browser downloads, so anyone could copy the key and use it. In this demo the key is fake and the before chat calls nothing: it shows an error on purpose.

Cause. The browser calls the AI service directly, so the key has to be in the code the browser receives.

Fix. The browser calls a small server function of our own (/api/chat) instead. The key stays on the server, in a server setting: none of the files the browser downloads contains it.

Check it yourself. Open https://af-proof-key-in-bundle-before.pages.dev/app.js and search for "sk-": the key is there. It is a fake key made for this demo, and the demo calls no real AI service. Open https://af-proof-key-in-bundle-after.pages.dev/app.js: there is no key. On the after site, ask the chat a question: a short demo reply comes back from our server. Or run:

curl -s https://af-proof-key-in-bundle-before.pages.dev/app.js | grep -c "sk-"

It prints 1. With https://af-proof-key-in-bundle-after.pages.dev it prints 0. Then:

curl -s -X POST -H "Content-Type: application/json" https://af-proof-key-in-bundle-after.pages.dev/api/chat -d '{"q":"hi"}'

The after site answers with a short demo reply from its server.

Before: https://af-proof-key-in-bundle-before.pages.dev · After: https://af-proof-key-in-bundle-after.pages.dev