AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Nuxt Server Data

skill-leeovery-agentic-skills-nuxt-server-data · by leeovery

Server-side data layer with Drizzle ORM + Cloudflare D1 + NuxtHub. Use when designing schema, generating and applying migrations, querying from Nitro routes, sharing types between client and server, or testing DB writes.

No reviews yet
0 installs
31 views
0.0% view→install

Install

$ agentstack add skill-leeovery-agentic-skills-nuxt-server-data

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-leeovery-agentic-skills-nuxt-server-data)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
3mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Nuxt Server Data? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Nuxt Server Data

The server-side persistence layer for a Nuxt + NuxtHub + Cloudflare app. Drizzle ORM models the schema in TypeScript, NuxtHub auto-exposes a db handle, D1 is the runtime database.

This is the server-side counterpart to nuxt-repositories — repositories are the client-side API access layer; this skill covers what's behind the API.

When to use

  • Designing a Drizzle schema for D1 / SQLite
  • Generating and applying migrations (local + remote)
  • Querying inside Nitro server routes (server/api/*.post.ts)
  • Sharing types between client and server via shared/types/
  • Avoiding the wrangler-deploy migration gotcha (migrations do NOT auto-apply)
  • Testing DB writes with isolation seams

Reference files

  • [drizzle-d1.md](references/drizzle-d1.md) — schema definition (sqliteTable, json columns, notNull, defaults), querying patterns (select, insert, count, joins), Drizzle conventions
  • [nuxt-hub.md](references/nuxt-hub.md)hub.db config, the auto-imported db and schema exports, migration generation (nuxt-hub db generate), the _hub_migrations table, local vs remote migration apply, the build-then-wrangler script pattern
  • [server-types.md](references/server-types.md)shared/utils/ and shared/types/ for cross-side type reuse, Drizzle's inferred row types, request/response shape sharing with Zod

Stack at a glance

Vue component
   │  $fetch('/api/contact', ...)
   ▼
server/api/contact.post.ts        ← Nitro event handler
   │  validates via shared Zod schema
   ▼
db.insert(submissions).values(...)
   │  auto-imported `db` from NuxtHub
   ▼
Cloudflare D1                    ← SQLite at the edge

Quick example

// server/db/schema.ts
import { sql } from 'drizzle-orm'
import { sqliteTable, text, integer } from 'drizzle-orm/sqlite-core'

export const submissions = sqliteTable('submissions', {
  id:          text('id').primaryKey(),
  createdAt:   text('created_at').notNull().default(sql`(datetime('now'))`),
  name:        text('name').notNull(),
  email:       text('email').notNull(),
  preferences: text('preferences', { mode: 'json' }).$type(),
  status:      text('status').notNull().default('new')
})
// server/api/contact.post.ts
import { and, eq, gt, sql } from 'drizzle-orm'
import { submissions } from '../db/schema'

export default defineEventHandler(async (event) => {
  const data = await readValidatedBody(event, contactPayloadSchema.parse)

  await db.insert(submissions).values({
    id: crypto.randomUUID(),
    name: data.name,
    email: data.email,
    preferences: data.preferences
  })

  return { ok: true }
})

Notice: db is auto-imported by NuxtHub — no import { db } from ... line. Schema is imported by name (submissions) from ../db/schema.

Critical: migrations don't auto-apply

Neither nuxt build, wrangler deploy, nor Cloudflare Workers Builds run migrations. You apply them manually from a local checkout:

// package.json
"scripts": {
  "db:migrate:remote": "NITRO_PRESET=cloudflare-module nuxt build && npx wrangler d1 migrations apply DB --remote --config .output/server/wrangler.json"
}

Detail in [nuxt-hub.md](references/nuxt-hub.md). This is the single biggest footgun in the stack — if you're seeing "no such table" on prod after a deploy, you forgot this step.

Anti-patterns

  • ❌ Querying from shared/utils/ — that code runs in the client bundle too. Server queries go in server/ only.
  • ❌ Importing db explicitly — it's auto-imported by NuxtHub; an explicit import path is a sign you're working against the framework.
  • ❌ Putting raw SQL strings inline for filtering — use Drizzle's eq/and/gt operators; they're typed against your schema.
  • ❌ Running migrations against --remote from a CI environment — CI doesn't have your wrangler auth and the build script in db:migrate:remote does. Run it locally.
  • ❌ Reaching for vi.mock('~/server/db') in tests — see nuxt-testing/test-seams.md for the env-guarded seam pattern.

Related

  • [nuxt-config](../nuxt-config/references/cloudflare-deployment.md) — Cloudflare Workers deployment, wrangler.json generation, secrets vs vars
  • [nuxt-forms](../nuxt-forms/references/marketing-forms.md) — the contact.post.ts route that consumes the submissions table
  • [nuxt-testing](../nuxt-testing/references/test-seams.md) — DB test isolation seam (/api/_dev/db)
  • [nuxt-repositories](../nuxt-repositories/SKILL.md) — client-side API access (the layer above this one)

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.