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: CHANGELOG.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
-**`apps/demo`** — added explicit `@objectstack/spec` and `zod` devDependencies as defense-in-depth for Vercel deployment.
14
14
-**`@objectql/types`** — moved `@objectstack/spec` and `zod` from `devDependencies` to `dependencies`. The compiled JS output contains runtime imports of `@objectstack/spec` (via `z.infer<typeof Data.X>` patterns), so they must be declared as production dependencies.
15
15
16
+
### Changed
17
+
18
+
-**`apps/demo`** — switched default data driver from `@objectstack/driver-memory` (InMemoryDriver) to `@objectql/driver-turso` (TursoDriver). When `TURSO_DATABASE_URL` is set, the demo uses a persistent Turso/libSQL database; otherwise falls back to InMemoryDriver for zero-config local development.
19
+
-`objectstack.config.ts` — environment-aware `createDefaultDriver()` selects Turso or MemoryDriver.
20
+
-`api/[[...route]].ts` — Vercel serverless handler uses TursoDriver with `TURSO_DATABASE_URL`, `TURSO_AUTH_TOKEN`, `TURSO_SYNC_URL`, and `TURSO_SYNC_INTERVAL` env vars.
21
+
-`scripts/build-vercel.sh` — now builds `@objectql/driver-turso` alongside other drivers.
22
+
-`README.md` — documents new Turso environment variables and architecture.
Copy file name to clipboardExpand all lines: apps/demo/README.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,8 @@ Runs locally with `@objectstack/cli` and deploys to **Vercel** as a serverless f
5
5
6
6
## Features
7
7
8
-
-**In-memory driver** — zero external database required; data persists across warm Vercel invocations.
8
+
-**Turso/libSQL driver** — persistent, edge-first SQLite via `@objectql/driver-turso` when `TURSO_DATABASE_URL` is set.
9
+
-**In-memory fallback** — zero external database required for quick local development.
9
10
-**Console UI** — full ObjectStack Console available at `/console/`.
10
11
-**Studio UI** — ObjectStack Studio available at `/_studio/`.
11
12
-**Project-Tracker showcase** — ships with the `examples/showcase/project-tracker` metadata (objects, views, permissions) so the demo has real data structures out of the box.
@@ -44,6 +45,10 @@ The development server starts on `http://localhost:3000`.
44
45
|---|---|---|
45
46
|`AUTH_SECRET`|**Yes** (production) | Secret key for signing auth tokens. Generate with `openssl rand -base64 32`. |
46
47
|`AUTH_TRUSTED_ORIGINS`| No | Comma-separated list of additional trusted origins (e.g. `https://myapp.example.com`). |
48
+
|`TURSO_DATABASE_URL`| No | Turso/libSQL database URL (e.g. `libsql://my-db-org.turso.io`). When set, uses Turso instead of in-memory driver. |
49
+
|`TURSO_AUTH_TOKEN`| When using Turso | JWT auth token for the Turso database. |
50
+
|`TURSO_SYNC_URL`| No | Remote sync URL for embedded replica mode. |
51
+
|`TURSO_SYNC_INTERVAL`| No | Periodic sync interval in seconds (default: 60). |
47
52
48
53
4. Deploy:
49
54
@@ -58,7 +63,7 @@ vercel --cwd apps/demo --prod
58
63
### How It Works
59
64
60
65
-**`vercel.json`** — Configures Vercel to use a custom build command, allocate 1 GiB memory to the serverless function, and rewrite all requests to the catch-all `api/[[...route]].ts` handler.
61
-
-**`api/[[...route]].ts`** — Bootstraps the full ObjectStack kernel with ObjectQL plugins, the in-memory driver, auth, Console, and Studio. Uses `@hono/node-server`'s `getRequestListener()` to bridge the Vercel serverless runtime with the Hono HTTP framework.
66
+
-**`api/[[...route]].ts`** — Bootstraps the full ObjectStack kernel with ObjectQL plugins, the Turso driver (or in-memory fallback), auth, Console, and Studio. Uses `@hono/node-server`'s `getRequestListener()` to bridge the Vercel serverless runtime with the Hono HTTP framework.
62
67
-**`scripts/build-vercel.sh`** — Builds all required workspace packages (foundation, drivers, plugins, protocols, examples) in the correct dependency order.
63
68
-**`scripts/patch-symlinks.cjs`** — Replaces pnpm workspace symlinks with real copies so Vercel can bundle the function without symlink errors.
0 commit comments