fix: Vercel production-readiness for Krosebrook/interact#59
fix: Vercel production-readiness for Krosebrook/interact#59
Conversation
…c, audit report) Co-authored-by: Krosebrook <214532761+Krosebrook@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to make Krosebrook/interact more deployable on Vercel by aligning environment variable naming, pinning Node to the repo’s standard version, and documenting the deployment process.
Changes:
- Updated
vercel.jsonto use the app’s Base44 env var names and added an SPA fallback rewrite. - Added
.nvmrcto pin Node.js to 20 and updated README deployment/prerequisites documentation. - Added an operations audit doc covering Vercel readiness and deployment steps.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
vercel.json |
Adjusts Vercel build env var names and adds SPA rewrite behavior. |
docs/operations/VERCEL_AUDIT.md |
Adds Vercel readiness/deployment audit and guidance. |
README.md |
Updates Node prerequisite and documents Vercel deploy + required env vars. |
.nvmrc |
Pins Node.js version for local/Vercel consistency. |
| |---|---|---| | ||
| | `VITE_BASE44_APP_ID` | ✅ Required | Base44 application identifier | | ||
| | `VITE_BASE44_BACKEND_URL` | ✅ Required | Base44 backend service URL | | ||
| | `VITE_BASE44_API_URL` | Optional | Base44 API URL (falls back to backend URL) | |
There was a problem hiding this comment.
The audit lists VITE_BASE44_API_URL as an optional frontend variable that “falls back to backend URL”, but this repo’s runtime code doesn’t read import.meta.env.VITE_BASE44_API_URL (it uses VITE_BASE44_BACKEND_URL via src/lib/app-params.js). This is likely misleading—either document that it’s currently unused in this codebase, or remove the fallback claim / variable from the required list to avoid confusion during deployments.
| | `VITE_BASE44_API_URL` | Optional | Base44 API URL (falls back to backend URL) | | |
| | `VITE_BASE44_API_URL` | Optional | Currently unused by this frontend; API base URL is derived from `VITE_BASE44_BACKEND_URL` via `src/lib/app-params.js` | |
| @@ -44,15 +41,8 @@ | |||
| ], | |||
| "rewrites": [ | |||
| { | |||
There was a problem hiding this comment.
The catch-all SPA rewrite will also rewrite /api/* requests (including the app’s client-side error logging POST to /api/logError) to /index.html. That prevents any /api endpoints (current or future) from working and can cause unexpected behavior for callers expecting non-HTML responses. Add a higher-priority rewrite for /api/:path* (to /api/:path*), or otherwise exclude /api/* from the SPA fallback rule.
| { | |
| { | |
| "source": "/api/(.*)", | |
| "destination": "/api/$1" | |
| }, | |
| { |
| "build": { | ||
| "env": { | ||
| "VITE_API_URL": "@api_url", | ||
| "VITE_BASE44_PROJECT_ID": "@base44_project_id" | ||
| "VITE_BASE44_APP_ID": "@vite_base44_app_id", | ||
| "VITE_BASE44_BACKEND_URL": "@vite_base44_backend_url" | ||
| } | ||
| }, |
There was a problem hiding this comment.
build.env is mapping frontend env vars from Vercel “secret” references (e.g. @vite_base44_app_id), but the README instructs users to set VITE_BASE44_APP_ID / VITE_BASE44_BACKEND_URL as standard Vercel Environment Variables. Unless those @... secrets are created, builds can run with missing values or fail unexpectedly. Consider removing the build.env block and relying on Vercel project env vars, or update documentation to explicitly require creating the referenced secrets.
vercel.json: correct env var names (VITE_BASE44_APP_ID,VITE_BASE44_BACKEND_URL), add SPA fallback rewrite, remove invalid redirect, remove no-openv.NODE_VERSION.nvmrcpinned to Node 20docs/operations/VERCEL_AUDIT.mdwith multi-repo assessment reportnpm run buildproducesdist/index.htmlsuccessfullyOriginal prompt
This pull request was created from Copilot chat.
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.
Summary by cubic
Audits all Krosebrook repositories for Vercel deployment readiness and adds docs/operations/VERCEL_AUDIT.md with a per-repo report. Makes Krosebrook/interact deployable on Vercel by adding an SPA fallback rewrite, fixing env var names in vercel.json, pinning Node 20 via .nvmrc, and updating the README with a deploy button and env var table.
Written for commit bc155d3. Summary will update on new commits.