- Home
- Skills
- Onmax
- Nuxt Skills
- Nuxthub
nuxthub_skill
- TypeScript
431
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill onmax/nuxt-skills --skill nuxthub- SKILL.md12.3 KB
Overview
This skill helps you build NuxtHub v0.10.4 applications with integrated database (Drizzle ORM), KV, blob, and cache APIs. It describes configuration, schema and migration workflows, multi-cloud deployment patterns, and the hub:db, hub:kv, and hub:blob virtual imports. Ideal for TypeScript Nuxt apps that need consistent local and production data bindings.
How this skill works
It auto-imports server-side helpers like db, schema, kv, and blob so you can run type-safe Drizzle queries, KV operations, and blob uploads directly in route handlers. The module manages local vs remote bindings, applies migrations automatically during dev/build, and generates provider bindings for Cloudflare and other platforms. Build-time hooks let you extend schema and migrations, and composables/handlers simplify uploads and multipart flows.
When to use it
- Building Nuxt apps that require a relational database with Drizzle ORM type safety
- Storing files and uploads with blob storage and built-in upload helpers
- Using key-value caching or short-lived data across providers
- Deploying to Cloudflare, Vercel, Deno, Netlify or self-hosted clouds
- Running migrations and schema-driven workflows during dev and CI
Best practices
- Define schemas in server/db/schema.ts or server/db/schema/*.ts to enable auto-migrations and type sharing
- Choose remote:true only when you need production bindings in local dev and understand production data risks
- Use migrations commands (generate, migrate, squash) in CI and rely on auto-apply during nuxi dev/build for convenience
- Validate uploads server-side with ensureBlob and use handleMultipartUpload for large files
- Keep provider credentials out of source; use environment variables and platform binding configs
Example use cases
- Create a users table with Drizzle and use db.select()/db.insert() in server APIs
- Store user avatars using blob.put with addRandomSuffix and serve via blob.serve
- Cache external API results with defineCachedFunction and invalidate via useStorage('cache') when needed
- Use kv.set/get for session-like or feature-flag state across instances
- Deploy to Cloudflare with auto-generated wrangler bindings for D1, KV, and R2
FAQ
Migrations are auto-applied during npx nuxi dev and npx nuxi build. You can also run npx nuxt db migrate manually or use generate to create migrations from schema.
When should I enable remote mode?
Enable remote:true to connect to production D1/KV/R2 from local dev when you need to test against real data. Avoid this for routine local development to prevent accidental production changes.