Fix Vercel blank page by building web assets at root path.

Use .env.web and vercel build env for VITE_BASE_PATH=/; trim README deploy
section. GitHub Pages CI still overrides base to /gsd-pi-config/.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Jeremy McSpadden
2026-05-25 11:27:28 -05:00
parent e34668656e
commit 4aed376576
5 changed files with 13 additions and 32 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
# Production web build (Vercel: pi.opengsd.net — root path, not GitHub Pages subpath)
# Loaded for `vite --mode web` (dev, preview, and production web builds).
# GitHub Pages CI overrides VITE_BASE_PATH to /gsd-pi-config/
VITE_BASE_PATH=/
VITE_PRESETS_INDEX_URL=https://raw.githubusercontent.com/open-gsd/gsd-pi-presets/main/index.json
VITE_PRESETS_RAW_BASE_URL=https://raw.githubusercontent.com/open-gsd/gsd-pi-presets/main/
+1 -1
View File
@@ -1,5 +1,5 @@
# Web build (copy to .env.web.local for `npm run dev:web`)
VITE_BASE_PATH=/gsd-pi-config/
VITE_BASE_PATH=/
VITE_PRESETS_INDEX_URL=https://raw.githubusercontent.com/open-gsd/gsd-pi-presets/main/index.json
VITE_PRESETS_RAW_BASE_URL=https://raw.githubusercontent.com/open-gsd/gsd-pi-presets/main/
VITE_PRESETS_CONTRIBUTING_URL=https://github.com/open-gsd/gsd-pi-presets/blob/main/CONTRIBUTING.md
+4 -29
View File
@@ -7,7 +7,7 @@ Copyright (c) 2026 Jeremy McSpadden <jeremy@fluxlabs.net>
Desktop configuration manager for [GSD Pi](https://github.com/open-gsd/gsd-pi) preferences. A native Tauri app that gives you a structured GUI over the YAML preferences file you'd otherwise hand-edit, plus a library view for skills, agents, and API keys.
**Web app:** Cloud-hosted editor — upload or create a configuration, edit in the browser, then download `preferences.md`, `models.json`, and `settings.json` for your machine. Preset gallery and wizard included (see [Web vs desktop](#web-vs-desktop)).
**Web app:** Browser editor — upload or create a configuration, edit in the browser, then download `preferences.md`, `models.json`, and `settings.json` for your machine. Preset gallery and wizard included (see [Web vs desktop](#web-vs-desktop)).
## Screenshots
@@ -60,37 +60,12 @@ npm run dev:web
Opens the gallery + editor on port `5173`. Copy `.env.web.example` to `.env.web.local` to override preset repo URLs.
```bash
npm run build:web # static dist/ for GitHub Pages
npm run build:web
npm run preview:web
npm test # preferencesCore unit tests
npm test
```
Preset gallery data lives in [`gsd-pi-presets/`](gsd-pi-presets/) (publish as [open-gsd/gsd-pi-presets](https://github.com/open-gsd/gsd-pi-presets)).
### Deploy to Vercel (`pi.opengsd.net`)
Production uses root path `/` (see `.env.web.production`). GitHub Pages builds use `/gsd-pi-config/` via the Pages workflow.
1. Import the repo in [Vercel](https://vercel.com) (team **fluxlabs-projects** or your org).
2. Framework preset: **Other**`vercel.json` sets `buildCommand`, `outputDirectory`, and SPA rewrites.
3. **Environment variables** (Project → Settings → Environment Variables):
| Variable | Required | Notes |
|----------|----------|--------|
| `GITHUB_CLIENT_ID` | For preset submit | GitHub OAuth App |
| `GITHUB_CLIENT_SECRET` | For preset submit | Server only |
| `PRESETS_REPO` | Optional | Default `open-gsd/gsd-pi-presets` |
Build-time `VITE_*` vars come from `.env.web.production` in the repo.
4. **Domain:** Project → Settings → Domains → add `pi.opengsd.net`. At your DNS host, add a CNAME (or Vercels recommended A/ALIAS records) pointing to Vercel.
5. **GitHub OAuth App** (if using Submit preset): set callback URL to `https://pi.opengsd.net/oauth/callback`.
```bash
npm i -g vercel # optional CLI
vercel link # link to project
vercel --prod # production deploy
```
Preset gallery data is loaded from [open-gsd/gsd-pi-presets](https://github.com/open-gsd/gsd-pi-presets) (override URLs in `.env.web.local`).
### Web vs desktop
+5
View File
@@ -3,6 +3,11 @@
"installCommand": "npm ci",
"buildCommand": "npm run build:web",
"outputDirectory": "dist",
"build": {
"env": {
"VITE_BASE_PATH": "/"
}
},
"rewrites": [
{
"source": "/((?!api/).*)",
+1 -1
View File
@@ -11,7 +11,7 @@ export default defineConfig(({ mode }) => {
return {
plugins: [react(), tailwindcss()],
clearScreen: false,
base: isWeb ? process.env.VITE_BASE_PATH ?? "/gsd-pi-config/" : "/",
base: isWeb ? (process.env.VITE_BASE_PATH ?? "/") : "/",
define: {
"import.meta.env.VITE_PLATFORM": JSON.stringify(isWeb ? "web" : "desktop"),
},