{"_id":"@alekorhonen/nuxt-admin","name":"@alekorhonen/nuxt-admin","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@alekorhonen/nuxt-admin","version":"0.0.1","description":"A Nuxt module for admin interface","repository":{"type":"git","url":"git+https://github.com/4leksanteri/nuxt-admin.git"},"license":"MIT","type":"module","exports":{".":{"types":"./dist/types.d.mts","import":"./dist/module.mjs"}},"main":"./dist/module.mjs","typesVersions":{"*":{".":["./dist/types.d.mts"]}},"workspaces":["playground"],"scripts":{"prepack":"nuxt-module-build build","dev":"npm run dev:prepare && nuxt dev playground","dev:build":"nuxt build playground","dev:prepare":"nuxt-module-build build --stub && nuxt-module-build prepare && nuxt prepare playground","release":"npm run lint && npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags","lint":"eslint .","test":"vitest run","test:watch":"vitest watch","test:types":"vue-tsc --noEmit && cd playground && vue-tsc --noEmit"},"dependencies":{"@nuxt/kit":"^4.3.1","@nuxt/ui":"^4.4.0","zod":"^4.3.6"},"devDependencies":{"@nuxt/devtools":"^3.2.1","@nuxt/eslint-config":"^1.15.1","@nuxt/module-builder":"^1.0.2","@nuxt/schema":"^4.3.1","@nuxt/test-utils":"^4.0.0","@types/node":"latest","changelogen":"^0.6.2","eslint":"^10.0.0","nuxt":"^4.3.1","typescript":"~5.9.3","vitest":"^4.0.18","vue-tsc":"^3.2.4"},"_id":"@alekorhonen/nuxt-admin@0.0.1","gitHead":"0196d25d8145622325d3353be4a66d7d946883be","bugs":{"url":"https://github.com/4leksanteri/nuxt-admin/issues"},"homepage":"https://github.com/4leksanteri/nuxt-admin#readme","_nodeVersion":"20.19.0","_npmVersion":"10.8.2","dist":{"integrity":"sha512-AXYk1kSimHuvQxsYxbtqfgf/nT0CuaQcbUiBkpSaUMJ/8ErBlkSaT2K0i7SnIxDzIExQgCT/ROE7wY56HZTyZg==","shasum":"b5e65dec69e278d9b37316051421d26e300076df","tarball":"https://registry.npmjs.org/@alekorhonen/nuxt-admin/-/nuxt-admin-0.0.1.tgz","fileCount":27,"unpackedSize":43898,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCRmsTsUmKNjnbwcOKSTft4wZakmt3Tn0e4PbF+uB6RXgIhAJBPNJviJnI7ctWWfDGKOLC6XgKe0DiWv8bsQqHyzcCR"}]},"_npmUser":{"name":"alekorhonen","email":"korhaleksi@outlook.com"},"directories":{},"maintainers":[{"name":"alekorhonen","email":"korhaleksi@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nuxt-admin_0.0.1_1771711400525_0.27901043600104125"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-21T22:03:20.421Z","0.0.1":"2026-02-21T22:03:20.708Z","modified":"2026-02-21T22:03:20.885Z"},"maintainers":[{"name":"alekorhonen","email":"korhaleksi@outlook.com"}],"description":"A Nuxt module for admin interface","homepage":"https://github.com/4leksanteri/nuxt-admin#readme","repository":{"type":"git","url":"git+https://github.com/4leksanteri/nuxt-admin.git"},"bugs":{"url":"https://github.com/4leksanteri/nuxt-admin/issues"},"license":"MIT","readme":"# nuxt-admin\n\n> Zero-config SSR admin panel module for Nuxt — powered by Nuxt UI.\n\n[![npm version](https://img.shields.io/npm/v/nuxt-admin.svg)](https://www.npmjs.com/package/nuxt-admin)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Features\n\n- ⚡ **Zero config** — auto-generates list, create, edit and delete from a single endpoint\n- 🔒 **SSR auth protection** — server-side middleware, API endpoints never exposed to the browser\n- 🎨 **Nuxt UI** — built entirely on Nuxt UI Dashboard components\n- 📋 **Column inference** — automatically infers table columns from your API response\n- 🔍 **Search & filters** — configurable query param mapping to match any API\n- ✅ **Zod validation** — auto-generated form validation from your field config\n- 🗑️ **Bulk delete** — select and delete multiple records with confirmation\n- 🌗 **Dark mode** — inherited from Nuxt UI\n\n---\n\n## Requirements\n\n- Nuxt `>= 4.3.1`\n- `@nuxt/ui` `>= 4.4.0`\n\n---\n\n## Installation\n\n```bash\nnpm install nuxt-admin @nuxt/ui\n```\n\n```ts\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  modules: ['nuxt-admin'],\n})\n```\n\n---\n\n## Quick start\n\nAdd your resources to `nuxt.config.ts`:\n\n```ts\nexport default defineNuxtConfig({\n  modules: ['nuxt-admin'],\n\n  admin: {\n    resources: [\n      {\n        name: 'users',\n        endpoint: '/api/admin/users',\n      },\n    ],\n  },\n})\n```\n\nThen visit `/admin` — that's it.\n\n---\n\n## Configuration\n\n### Top-level options\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `title` | `string` | `'Admin'` | Admin panel title shown in sidebar and browser tab |\n| `resources` | `AdminResource[]` | `[]` | List of CRUD resources |\n\n---\n\n## Resources\n\n### Zero config\n\nProvide just a name and endpoint — everything else is inferred:\n\n```ts\nresources: [\n  {\n    name: 'users',\n    endpoint: '/api/admin/users',\n  },\n]\n```\n\nThis generates:\n- `GET /api/admin/users` — list\n- `GET /api/admin/users/:id` — show (for edit prefill)\n- `POST /api/admin/users` — create\n- `PUT /api/admin/users/:id` — edit\n- `DELETE /api/admin/users/:id` — delete\n\n### Full configuration\n\n```ts\nresources: [\n  {\n    name: 'users',\n    endpoint: '/api/admin/users', // base endpoint (used as fallback)\n\n    // Override specific endpoints\n    endpoints: {\n      list:   { path: '/api/admin/users',         method: 'GET'    },\n      show:   { path: '/api/admin/users/:id',      method: 'GET'    },\n      create: { path: '/api/admin/users',          method: 'POST'   },\n      edit:   { path: '/api/admin/users/:id',      method: 'PATCH'  }, // use PATCH instead of PUT\n      delete: { path: '/api/admin/users/:id',      method: 'DELETE' },\n    },\n\n    // Table columns\n    table: {\n      columns: [\n        { key: 'name',       label: 'Name',    sortable: true },\n        { key: 'status',     label: 'Status',  badge: true    },\n        { key: 'created_at', label: 'Created', type: 'date'   },\n      ],\n    },\n\n    // Create/edit form fields\n    form: {\n      fields: [\n        { key: 'name',   label: 'Name',   type: 'text',   required: true },\n        { key: 'email',  label: 'Email',  type: 'email',  required: true },\n        { key: 'status', label: 'Status', type: 'select',\n          options: ['active', 'suspended'] },\n      ],\n    },\n\n    // Sidebar filters\n    filters: [\n      {\n        key:     'status',\n        label:   'Status',\n        type:    'select',\n        param:   'filter[status]', // exact query param sent to API\n        options: ['active', 'suspended'],\n      },\n    ],\n\n    // Custom query param names\n    query: {\n      page:   'page',\n      limit:  'per_page',   // your API uses per_page instead of limit\n      search: 'q',          // your API uses q instead of search\n      sort:   'sort_by',\n      order:  'sort_order',\n    },\n\n    // Custom error messages per status code\n    messages: {\n      404: 'User not found',\n      403: 'You do not have permission to manage users',\n    },\n\n    // Custom response shape\n    response: {\n      dataKey:    'data',    // default\n      totalKey:   'total',   // default\n      errorKey:   'errors',  // default\n      messageKey: 'message', // default\n    },\n  },\n]\n```\n\n---\n\n## Column types\n\n| Type | Description |\n|------|-------------|\n| `text` | Plain text (default) |\n| `date` | Formatted date |\n| `datetime` | Formatted date and time |\n| `badge` | Rendered as a `UBadge` |\n| `boolean` | Green/red badge for true/false |\n| `number` | Numeric value |\n\nSetting `badge: true` on a column is equivalent to `type: 'badge'`.\n\n---\n\n## Field types\n\n| Type | Component |\n|------|-----------|\n| `text` | `UInput` |\n| `email` | `UInput type=\"email\"` |\n| `password` | `UInput type=\"password\"` |\n| `number` | `UInput type=\"number\"` |\n| `textarea` | `UTextarea` |\n| `select` | `USelect` |\n| `multiselect` | `USelectMenu multiple` |\n| `boolean` | `UToggle` |\n| `date` | `UInput type=\"date\"` |\n| `datetime` | `UInput type=\"datetime-local\"` |\n\n---\n\n## Expected API response shape\n\nBy default the module expects:\n\n```json\n{\n  \"data\": [...],\n  \"total\": 100\n}\n```\n\nOverride with `response.dataKey` and `response.totalKey` if your API differs.\n\nFor validation errors (422), the module expects:\n\n```json\n{\n  \"message\": \"Validation failed\",\n  \"errors\": {\n    \"email\": [\"Email is required\"]\n  }\n}\n```\n\nOverride with `response.errorKey` and `response.messageKey`.\n\n---\n\n## License\n\nMIT","readmeFilename":"README.md","_rev":"1-176b531ec97e4add9d7ef5e9386c29c3"}