About this demo

A multi-tenant workspace platform — projects, tasks, posts, comments, tags, and an activity feed — built on Nuxt 4 with all server routes hitting Cloudflare D1 directly via @orphnet/d1-eloquent. No separate API tier.

The Hono sibling example at hono-example.d1-eloquent.orph.dev exposes the same endpoints with identical responses; both apps use the same migrations and the same models — only the HTTP transport differs.

Workspace: Acme HQ

Slug
acme
Members
8
Projects
3
Posts
10
Settings (JSON cast)
{"theme":"default","invite_only":false}

Members belongsToMany

  • Liam Adams
    will.nguyen443@mail.test
  • Opal Andersonadmin
    leomoore622@inbox.example
  • Sam Wright
    blake_nelson777@mail.test
  • Quinn Hill
    vicmartinez375@sample.io
  • Reed Nelson
    frank_flores364@example.com
  • Frank Harris
    iris.white79@mail.test
  • Rita Johnson
    dave.mitchell241@demo.net
  • Sara Taylor
    bobmartin945@test.org

Projects withCount("tasks")

  • Marketing Site12 tasks
    Incididunt eiusmod excepteur veniam pariatur mollit ullamco quis anim et qui et.
  • Mobile App12 tasks
    Nostrud reprehenderit ad mollit nostrud lorem sint.
  • Platform12 tasks
    Excepteur minim ad dolor reprehenderit sint reprehenderit laboris aliqua est.

Tasks (default scope: open + in_progress) morphToMany("tags")

  • Exercitation tempor cillum ex irure ex nulla doopenP3
    → Frank Harrisannouncement
  • Adipiscing adipiscing et ex eiusmod amet anim culpaopenP3
    → Reed Nelson
  • Aute laborum laborum amet ut ea aute cillumopenP3
    → Sara Taylor
  • Eiusmod dolor tempor velit ad do elit reprehenderitopenP3
    → Reed Nelson
  • Deserunt magna quis commodo aute anim veniam voluptateopenP3
    → Quinn Hill
  • Laborum in irure ex velit sed commodo magnaopenP3
    → Sam Wrightdesignannouncement
  • Do fugiat magna non aute dolore sed temporopenP3
    → Rita Johnson
  • Proident minim nostrud enim laboris adipiscing deserunt mollitopenP2
    → Frank Harrisbug

Showing 8 of 32. Try /api/workspaces/acme/tasks?status=done to see completed ones.

Posts paginateCursor

Activity feed morphTo (actor + subject)

  • post.published by Liam Adams
    post → Irure qui et elit nostrud sunt ipsum eiusmod
  • post.published by Frank Harris
    post → Mollit aliqua minim id consectetur ut cupidatat occaecat
  • post.published by Rita Johnson
    post → Consectetur amet incididunt excepteur anim ea incididunt mollit
  • post.published by Opal Anderson
    post → Commodo amet deserunt deserunt esse ea excepteur commodo
  • post.published by Rita Johnson
    post → Consequat minim consectetur magna do incididunt labore enim
  • post.published by Sara Taylor
    post → Est labore ex aliquip minim irure quis proident

Try the API directly

GETtable links open the live JSON in a new tab. Write endpoints (POST/PATCH/DELETE) are listed below as curl recipes.

curl recipes for write endpoints (POST / PATCH / DELETE)
# Re-seed (wipes + reseeds the workspace)
curl -X POST https://nuxt-example.d1-eloquent.orph.dev/api/admin/seed?fresh=1

# Create a task (records an activity event + create revision)
curl -X POST https://nuxt-example.d1-eloquent.orph.dev/api/workspaces/acme/tasks \
  -H "content-type: application/json" \
  -d '{"project_id":"<project-id>","title":"new task","priority":3}'

# Update a task (writes a revision row)
curl -X PATCH https://nuxt-example.d1-eloquent.orph.dev/api/workspaces/acme/tasks/57d39ccc-5e89-4769-aa0c-5987d0aef225 \
  -H "content-type: application/json" \
  -d '{"status":"done","priority":5}'

# Soft-delete a task
curl -X DELETE https://nuxt-example.d1-eloquent.orph.dev/api/workspaces/acme/tasks/57d39ccc-5e89-4769-aa0c-5987d0aef225

# Comment on a task (morphMany)
curl -X POST https://nuxt-example.d1-eloquent.orph.dev/api/workspaces/acme/tasks/57d39ccc-5e89-4769-aa0c-5987d0aef225/comments \
  -H "content-type: application/json" \
  -d '{"author_id":"08ef2012-273a-4d62-8333-5de923b75b79","body":"LGTM"}'

# Attach a tag to a task (morphToMany pivot)
curl -X POST https://nuxt-example.d1-eloquent.orph.dev/api/tags/<tag-id>  # GET /api/tags/attach \
  -H "content-type: application/json" \
  -d '{"subject_type":"task","subject_id":"57d39ccc-5e89-4769-aa0c-5987d0aef225"}'

# Sync a task's tags (replace the full set)
curl -X POST https://nuxt-example.d1-eloquent.orph.dev/api/tags/sync \
  -H "content-type: application/json" \
  -d '{"subject_type":"task","subject_id":"57d39ccc-5e89-4769-aa0c-5987d0aef225","tag_ids":["<tag1>","<tag2>"]}'
full manifest from /api
  • POST /api/admin/seed?fresh=1
  • GET /api/workspaces
  • GET /api/workspaces/:slug
  • GET /api/workspaces/:slug/projects
  • GET /api/workspaces/:slug/tasks
  • POST /api/workspaces/:slug/tasks
  • PATCH /api/workspaces/:slug/tasks/:id
  • DELETE /api/workspaces/:slug/tasks/:id
  • POST /api/workspaces/:slug/tasks/:id/comments
  • GET /api/workspaces/:slug/posts
  • GET /api/workspaces/:slug/posts/:postSlug
  • GET /api/feed?workspace=:slug
  • GET /api/search?q=...
  • GET /api/tags
  • POST /api/tags/:id/attach
  • POST /api/tags/:id/detach
  • POST /api/tags/sync
  • GET /api/audit/:type/:id
  • GET /api/audit/tasks/:id/asof/:ts