Multi-Tenant Notes
Tenant from path segment or x-tenant-id header - isolated notes in Neon/memory with honest fallbacks.
Run this experiment yourself
Demos are not embedded on this site. Deploy a standalone copy on Vercel or run the experiment app locally.
Local development
cd apps/experiments/multi-tenant-notes pnpm install pnpm dev
Then open http://localhost:3010.
This is an experimental demo. Use it as a starting point for your own projects.
Multi-Tenant Notes is a Wave 3 Batch H composition lab. Pure helpers live in logic.ts; missing providers or stores degrade honestly (never fabricate AI output).
Features
- Resolve tenant from header or query
- Per-tenant note lists
- Neon/memory persistence
API Reference
GET|POST /api/notes
{ "text": "Ship docs", "tenant": "acme" }| Status | Cause |
|---|---|
200 | Success |
400 | Missing tenant/text |
Implementation Details
Validate
Inputs are length-capped in logic.ts; APIs return 400 for missing fields.
Run
Route Handlers compose AI SDK, Redis/Neon, or ImageResponse as documented. Fallbacks include honest notes.
Limitations
- Not row-level security.
- No auth users.
- Memory resets on cold start.
Use in your project
Copy the Route Handler(s) and logic.ts from apps/experiments/multi-tenant-notes/.
Deployment
Local Development
cd apps/experiments/multi-tenant-notes
pnpm install
pnpm devConfiguration
| Variable | Required | Purpose |
|---|---|---|
DATABASE_URL | No | Neon persistence |