You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: apps/console/README.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,19 +60,29 @@ Both modes support the same features and use the same codebase. Choose developme
60
60
61
61
## Vercel Deployment
62
62
63
-
The console can be deployed as a standalone static SPA (e.g. to Vercel) that connects to a remote ObjectStack backend. The build configured in `vercel.json` disables the MSW mock worker (`VITE_USE_MOCK_SERVER=false`) so that all `/api/v1/*` requests go to the real backend.
63
+
The console is deployed to Vercel (e.g. `demo.objectui.org`) as a **self-contained static SPA** — the MSW mock worker runs in the browser and serves all `/api/v1/*` requests from an in-memory ObjectStack kernel with persistent localStorage storage. No external backend is required.
64
64
65
-
**Required environment variable** (set in the Vercel project's *Environment Variables* panel):
65
+
The build configured in `vercel.json` enables the MSW mock worker (`VITE_USE_MOCK_SERVER=true`) so that:
66
+
67
+
- Seed data for the example apps (`crm_enterprise`, `todo`, `kitchen_sink`) is loaded on first visit.
68
+
- Records, views, and user-created data persist in `localStorage` across page refreshes.
69
+
- Record IDs (including composite driver-assigned IDs such as `crm__account-<timestamp>-<n>`) remain stable per-browser, so record detail URLs keep working after reload.
70
+
71
+
No environment variables are required for the standalone demo deployment.
72
+
73
+
### Optional: pointing at a real backend
74
+
75
+
If you want to deploy the console against a live ObjectStack backend instead of the self-contained demo, override the build command to set `VITE_USE_MOCK_SERVER=false` and set `VITE_SERVER_URL` in the Vercel project settings:
66
76
67
77
| Variable | Example | Description |
68
78
| --- | --- | --- |
69
-
|`VITE_SERVER_URL`|`https://demo.objectstack.ai`| Absolute URL of the ObjectStack backend. When unset, requests default to the same origin — which will 404 on a static SPA host. |
79
+
|`VITE_SERVER_URL`|`https://your-backend.example.com`| Absolute URL of the ObjectStack backend. When unset, requests default to the same origin — which will 404 on a static SPA host like Vercel. |
70
80
71
81
Additional backend requirements for cross-origin deployments:
72
82
73
83
1. The backend must allow CORS from the SPA origin (`Access-Control-Allow-Origin: <spa-origin>`, `Access-Control-Allow-Credentials: true`).
74
84
2. Auth cookies must use `SameSite=None; Secure` so they are sent on cross-site requests.
75
-
3. The apps and objects referenced in URLs (e.g. `crm_enterprise`, `lead`) must actually exist in the backend metadata — otherwise the console will render its *object not found* empty state.
85
+
3. The apps and objects referenced in URLs (e.g. `crm_enterprise`, `lead`) must exist in the backend metadata and expose stable record IDs — otherwise the console will render its *object not found* / *record not found* empty state.
0 commit comments