Nuxt Crouton is a modular ecosystem consisting of a main module and multiple feature packages. The architecture provides flexibility through config-based feature enabling, keeping bundle sizes small while allowing you to use only what you need.
@fyit/crouton automatically includes the core, auth, admin, and i18n features. Optional features are enabled via configuration.@fyit/crouton (main module)
│
├── Always includes:
│ └── @fyit/crouton-core (base CRUD layer)
│
├── Core add-ons (enabled by default):
│ ├── @fyit/crouton-auth (authentication)
│ ├── @fyit/crouton-admin (admin dashboard)
│ └── @fyit/crouton-i18n (translations)
│
├── Optional add-ons (disabled by default):
│ ├── @fyit/crouton-editor (TipTap)
│ ├── @fyit/crouton-flow (Vue Flow)
│ ├── @fyit/crouton-assets (media library)
│ ├── @fyit/crouton-maps (Mapbox)
│ ├── @fyit/crouton-ai (LLM integration)
│ ├── @fyit/crouton-email (Vue Email)
│ ├── @fyit/crouton-events (audit trail)
│ ├── @fyit/crouton-collab (real-time)
│ ├── @fyit/crouton-pages (CMS)
│ ├── @fyit/crouton-devtools (dev tools)
│ └── @fyit/crouton-themes (UI themes)
│
└── Mini-apps (experimental):
├── @fyit/crouton-bookings
└── @fyit/crouton-sales
Purpose: Unified Nuxt module that aggregates all Crouton packages with opt-in features
Install: pnpm add @fyit/crouton
This is the main entry point for the Crouton ecosystem. It automatically includes core features and allows enabling optional add-ons via configuration.
Configuration:
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@fyit/crouton'],
crouton: {
// Global settings
apiPrefix: '/api',
defaultPageSize: 20,
// Core add-ons (enabled by default, can disable)
auth: true,
admin: true,
i18n: true,
// Optional add-ons (disabled by default)
editor: false,
flow: false,
assets: false,
maps: false,
ai: false,
email: false,
events: false,
collab: false,
pages: false,
devtools: undefined, // Auto-detect in dev mode
themes: false,
// Mini-apps (experimental, disabled by default)
bookings: false,
sales: false
}
})
Minimal setup (core features only):
export default defineNuxtConfig({
modules: ['@fyit/crouton']
// Gets: core, auth, admin, i18n automatically
})
These packages are automatically included when you install @fyit/crouton. No separate installation needed.
Purpose: Base CRUD layer with collections, composables, and components Status: Always included
Contains:
Purpose: Authentication layer with teams, passkeys, and 2FA Status: Enabled by default
Contains:
Routes provided: /auth/* (login, register, forgot-password, etc.)
Disable if needed:
crouton: {
auth: false // Use your own auth system
}
Purpose: Super admin dashboard for system-wide management Status: Enabled by default
Contains:
Routes provided: /super-admin/*
Purpose: Translation and multi-language support Status: Enabled by default
Contains:
Provides:
common.* - Generic UI stringsforms.* - Form field labelserrors.* - Error messagestime.* - Time formatting stringsnavigation.* - Navigation labelsEnable these features in your crouton config as needed.
Purpose: Rich text editing with Tiptap
Enable: crouton: { editor: true }
Contains:
When to use: Blog posts, descriptions, content management
Purpose: AI chat and completion integration
Enable: crouton: { ai: true }
Contains:
Environment Variables:
NUXT_OPENAI_API_KEY=sk-...
NUXT_ANTHROPIC_API_KEY=sk-ant-...
Purpose: Centralized asset management with NuxtHub blob storage
Enable: crouton: { assets: true }
Contains:
Requires: hub: { blob: true } in nuxt.config
Purpose: Event management with audit trail
Enable: crouton: { events: true }
Contains:
Purpose: Map integration with location fields
Enable: crouton: { maps: true }
Contains:
Purpose: Visual flow builder with drag-and-drop
Enable: crouton: { flow: true }
Contains:
Purpose: Email infrastructure with Vue Email templates and Resend
Enable: crouton: { email: true }
Contains:
Environment Variables:
RESEND_API_KEY=re_xxx
Integration: Works with @fyit/crouton-auth for auth emails
Purpose: Real-time collaboration with Yjs CRDTs
Enable: crouton: { collab: true }
Contains:
Room types: page (TipTap), flow (graphs), document (text), generic
Note: Sync mode requires Cloudflare Durable Objects
Purpose: CMS-like page management system
Enable: crouton: { pages: true }
Contains:
/[team]/[slug]URL Structure:
/[team]/[slug]/admin/[team]/pagesPurpose: Development tools and debugging utilities
Enable: crouton: { devtools: true } (auto-detected in dev mode)
Contains:
Note: Auto-enabled in development mode
Purpose: Swappable UI themes for Nuxt UI applications
Enable: crouton: { themes: true } or extend directly
Available Themes:
| Theme | Description | Extend Path |
|---|---|---|
| KO | Hardware-inspired (Teenage Engineering KO II) | @fyit/crouton-themes/ko |
Usage (theme-specific extend):
export default defineNuxtConfig({
extends: ['@fyit/crouton-themes/ko']
})
Contains:
variant="ko")These are experimental domain-specific applications built on Crouton. APIs may change.
Purpose: Booking system for slots and inventory
Enable: crouton: { bookings: true }Status: Experimental ⚠️
Contains:
Requires: @fyit/crouton-auth, optionally @fyit/crouton-email
Purpose: Event-based Point of Sale (POS) system
Enable: crouton: { sales: true }Status: Experimental ⚠️
Contains:
Requires: @fyit/crouton-auth
These packages are used during development and are not included in your production bundle.
Purpose: CLI tool for code generation
Install: pnpm add -D @fyit/crouton-cli
Commands:
crouton generate <layer> <collection>
crouton rollback <layer> <collection>
crouton rollback-bulk --layer=<name>
crouton rollback-interactive
crouton init
crouton install
Key insight: Dev-time dependency only. Generated code doesn't depend on it.
Purpose: MCP server for AI-assisted collection generation
Install: Dev tool, configured in .claude/settings.json
Contains:
Tools: design_schema, validate_schema, generate_collection, list_collections, dry_run, rollback
Purpose: Visual schema design tool Install: Dev tool
Contains:
# Install main module
pnpm add @fyit/crouton
# Install CLI for code generation (dev dependency)
pnpm add -D @fyit/crouton-cli
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@fyit/crouton']
// Gets: core, auth, admin, i18n automatically
})
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@fyit/crouton'],
crouton: {
// Enable features you need
editor: true,
assets: true,
events: true,
pages: true
}
})
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@fyit/crouton'],
crouton: {
// All optional features
editor: true,
flow: true,
assets: true,
maps: true,
ai: true,
email: true,
events: true,
collab: true,
pages: true
}
})
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@fyit/crouton'],
crouton: {
bookings: true,
email: true,
pages: true
}
})
| Tier | Route Pattern | Purpose | Access |
|---|---|---|---|
| User | /dashboard/[team]/* | User-facing features | Any team member |
| Admin | /admin/[team]/* | Team management | Team admins/owners |
| Super Admin | /super-admin/* | System management | App owner only |
When defining collection schemas, certain field types require specific features to be enabled.
| Field Type | Required Feature | Config |
|---|---|---|
editor | Editor | crouton: { editor: true } |
i18n / translation | i18n | crouton: { i18n: true } (default) |
asset | Assets | crouton: { assets: true } |
map / location | Maps | crouton: { maps: true } |
flow | Flow | crouton: { flow: true } |
1. Small Bundle Sizes
2. Independent Updates
3. Clear Separation
4. Flexible Adoption
Q: Why is the generator a separate package? A: It's a dev-time tool. Your production app doesn't need the generator, templates, or CLI code.
Q: Why use module-based config instead of extends? A: Cleaner config, better tree-shaking, and automatic feature discovery.
Q: Can I use the core without the module? A: Yes! You can extend individual packages directly if you prefer the layer pattern.
Q: Do add-ons depend on each other? A: Mostly no. Each add-on depends on core. Some have optional integrations (e.g., email + auth).
The core package isn't installed:
pnpm add @fyit/crouton
The generator isn't installed:
pnpm add -D @fyit/crouton-cli
Make sure the feature is enabled:
crouton: {
editor: true // Enable the feature
}
Run Nuxt prepare to regenerate types:
npx nuxt prepare
npx nuxt typecheck