nuxt-protokit
Schema-driven rapid prototyping for Nuxt 4. Turn a TypeScript schema into a persistent, interactive SaaS tool in minutes — backed by Y.js CRDT + IndexedDB, auto-synced across tabs, with optional server sync.
When to Use
- Defining a
PrototypeSchema with fields, collections, derived values, or visualizations
- Writing
usePrototype() or useProtoCollection() composables
- Using
<ProtoTool>, <ProtoDashboard>, <ProtoCrudModal>, <ProtoCalendar>, <ProtoViz> components
- Configuring offline persistence, encryption, namespace isolation, or corruption recovery
- Creating custom field/viz extensions with
defineProtokitExtension
- Using headless mode (
defineHeadlessSchema) without UI components
Quick Start
// schema.ts
import { definePrototype } from '@websideproject/nuxt-protokit'
export const schema = definePrototype({
key: 'my-tool',
title: 'My Tool',
shortTitle: 'My Tool',
description: 'Description',
icon: 'i-heroicons-calculator',
fields: {
revenue: { type: 'number', label: 'Revenue', default: 0, format: 'money' },
growth: { type: 'range', label: 'Growth %', default: 10, min: 0, max: 100 },
plan: { type: 'select', label: 'Plan', default: 'starter',
options: ['starter', 'pro', 'enterprise'] },
},
derived: {
projectedRevenue: {
deps: ['revenue', 'growth'],
compute: ctx => ctx.fields.revenue * (1 + ctx.fields.growth / 100),
},
},
})
<!-- pages/my-tool.vue -->
<script setup>
import { schema } from '~/schema'
const proto = usePrototype(schema)
</script>
<template>
<ProtoTool :schema="schema" :prototype="proto" />
</template>
Available Guidance
| File |
Topics |
| references/schema.md |
PrototypeSchema, all field types, CollectionSchema, DerivedDef, DashboardLayout, ProtoAction |
| references/composables.md |
usePrototype, useProtoCollection, useProtoDoc, namespace, encryption options |
| references/components.md |
ProtoTool, ProtoDashboard, ProtoCrudModal, ProtoCalendar, ProtoViz, ProtoActionBar |
| references/visualizations.md |
All 12 viz types with config interfaces and examples |
| references/offline-first.md |
Y.js + IndexedDB, multi-tab sync, encryption, corruption recovery, server sync |
| references/extensions.md |
defineProtokitExtension, custom field/viz type registration |
| references/headless.md |
defineHeadlessSchema, programmatic usage without UI components |
| references/module-authoring.md |
Building a Nuxt module that ships custom fields/viz: protokit:register-extension hook, plugin pattern |
Progressive Loading
Load only what you need:
- Defining fields, collections, or layout? → references/schema.md
- Writing
usePrototype or composable options? → references/composables.md
- Using
<ProtoTool>, <ProtoCrudModal>, <ProtoCalendar>? → references/components.md
- Configuring
visualizations: [] in schema? → references/visualizations.md
- Encryption, multi-tenant, corruption? → references/offline-first.md
- Custom field or viz type? → references/extensions.md
- No UI, programmatic storage? → references/headless.md
- Building a Nuxt module that ships extensions? → references/module-authoring.md
DO NOT read all files at once. Load based on current task.
Related Skills
nuxt — Nuxt 4 routing, server routes, middleware
nuxt-ui — @nuxt/ui components for surrounding page layout
vue — Vue 3 composables, reactivity patterns
Module Config (nuxt.config.ts)
export default defineNuxtConfig({
modules: ['@websideproject/nuxt-protokit'],
protokit: {
serverSync: true, // default — syncs to /api/yjs
// serverSync: false // local-only, no HTTP
// serverSync: { enabled: true, baseUrl: '/api/yjs' }
}
})
Token efficiency: Main skill ~400 tokens. Each reference file ~800–1400 tokens.
1---2name: nuxt-protokit3description: Use when building schema-driven prototypes with nuxt-protokit (@websideproject/nuxt-protokit) - provides definePrototype, usePrototype, ProtoTool, collections, derived values, and visualizations for rapid SaaS tool prototyping.4license: MIT5metadata:6 source: https://skillmd.com/skills/tuyv/nuxt-protokit7---89# nuxt-protokit1011Schema-driven rapid prototyping for Nuxt 4. Turn a TypeScript schema into a persistent, interactive SaaS tool in minutes — backed by Y.js CRDT + IndexedDB, auto-synced across tabs, with optional server sync.1213## When to Use1415- Defining a `PrototypeSchema` with fields, collections, derived values, or visualizations16- Writing `usePrototype()` or `useProtoCollection()` composables17- Using `<ProtoTool>`, `<ProtoDashboard>`, `<ProtoCrudModal>`, `<ProtoCalendar>`, `<ProtoViz>` components18- Configuring offline persistence, encryption, namespace isolation, or corruption recovery19- Creating custom field/viz extensions with `defineProtokitExtension`20- Using headless mode (`defineHeadlessSchema`) without UI components2122## Quick Start2324```ts25// schema.ts26import { definePrototype } from '@websideproject/nuxt-protokit'2728export const schema = definePrototype({29 key: 'my-tool',30 title: 'My Tool',31 shortTitle: 'My Tool',32 description: 'Description',33 icon: 'i-heroicons-calculator',34 fields: {35 revenue: { type: 'number', label: 'Revenue', default: 0, format: 'money' },36 growth: { type: 'range', label: 'Growth %', default: 10, min: 0, max: 100 },37 plan: { type: 'select', label: 'Plan', default: 'starter',38 options: ['starter', 'pro', 'enterprise'] },39 },40 derived: {41 projectedRevenue: {42 deps: ['revenue', 'growth'],43 compute: ctx => ctx.fields.revenue * (1 + ctx.fields.growth / 100),44 },45 },46})47```4849```vue50<!-- pages/my-tool.vue -->51<script setup>52import { schema } from '~/schema'53const proto = usePrototype(schema)54</script>5556<template>57 <ProtoTool :schema="schema" :prototype="proto" />58</template>59```6061## Available Guidance6263| File | Topics |64|------|--------|65| **[references/schema.md](references/schema.md)** | PrototypeSchema, all field types, CollectionSchema, DerivedDef, DashboardLayout, ProtoAction |66| **[references/composables.md](references/composables.md)** | usePrototype, useProtoCollection, useProtoDoc, namespace, encryption options |67| **[references/components.md](references/components.md)** | ProtoTool, ProtoDashboard, ProtoCrudModal, ProtoCalendar, ProtoViz, ProtoActionBar |68| **[references/visualizations.md](references/visualizations.md)** | All 12 viz types with config interfaces and examples |69| **[references/offline-first.md](references/offline-first.md)** | Y.js + IndexedDB, multi-tab sync, encryption, corruption recovery, server sync |70| **[references/extensions.md](references/extensions.md)** | defineProtokitExtension, custom field/viz type registration |71| **[references/headless.md](references/headless.md)** | defineHeadlessSchema, programmatic usage without UI components |72| **[references/module-authoring.md](references/module-authoring.md)** | Building a Nuxt module that ships custom fields/viz: protokit:register-extension hook, plugin pattern |7374## Progressive Loading7576Load only what you need:7778- Defining fields, collections, or layout? → [references/schema.md](references/schema.md)79- Writing `usePrototype` or composable options? → [references/composables.md](references/composables.md)80- Using `<ProtoTool>`, `<ProtoCrudModal>`, `<ProtoCalendar>`? → [references/components.md](references/components.md)81- Configuring `visualizations: []` in schema? → [references/visualizations.md](references/visualizations.md)82- Encryption, multi-tenant, corruption? → [references/offline-first.md](references/offline-first.md)83- Custom field or viz type? → [references/extensions.md](references/extensions.md)84- No UI, programmatic storage? → [references/headless.md](references/headless.md)85- Building a Nuxt module that ships extensions? → [references/module-authoring.md](references/module-authoring.md)8687**DO NOT read all files at once.** Load based on current task.8889## Related Skills9091- **`nuxt`** — Nuxt 4 routing, server routes, middleware92- **`nuxt-ui`** — @nuxt/ui components for surrounding page layout93- **`vue`** — Vue 3 composables, reactivity patterns9495## Module Config (`nuxt.config.ts`)9697```ts98export default defineNuxtConfig({99 modules: ['@websideproject/nuxt-protokit'],100 protokit: {101 serverSync: true, // default — syncs to /api/yjs102 // serverSync: false // local-only, no HTTP103 // serverSync: { enabled: true, baseUrl: '/api/yjs' }104 }105})106```107108_Token efficiency: Main skill ~400 tokens. Each reference file ~800–1400 tokens._