Ready-to-run internal tool: an entity registry with CRUD, roles, CSV import/export and an audit log.
Find a file Use this template
w4c-templates 914988e187
Some checks failed
CI / quality (push) Has been cancelled
chore(template): publish Admin.Nuxt
2026-10-11 23:25:56 +03:00
.github/workflows chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
.w4c chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
app chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
docker chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
prisma chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
public chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
server chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
shared chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
tests chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
.dockerignore chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
.env.example chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
.gitignore chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
eslint.config.mjs chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
nuxt.config.ts chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
package-lock.json chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
package.json chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
README.md chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
tsconfig.json chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00
vitest.config.ts chore(template): publish Admin.Nuxt 2026-10-11 23:25:56 +03:00

Admin / CRM — Nuxt (templates2)

A ready-to-run internal tool built on the v2 Nuxt base: an entity registry (Customers, Deals) with CRUD, roles, CSV import/export and an audit log. Everything works on the first run — SQLite + mock providers need no keys. Feature-parity with templates2.Admin.Next.

Quickstart

npm ci
cp .env.example .env          # SQLite + mock providers by default — no keys needed
npm run db:setup              # prisma db push + seed (20 customers, 15 deals, audit trail)
npm run dev                   # http://localhost:3000/admin

Demo accounts (seeded)

Role Email Password Can do
admin admin@example.com password read, create/edit, delete, import/export
editor editor@example.com password read, create/edit, import/export
viewer viewer@example.com password read only

Roles are enforced server-side on every admin route (server/utils/guard.ts + shared/rbac.ts); the UI merely hides what a role cannot do.

What this case adds on top of the base

  • Entity registry — Customer and Deal with list (search, column filter, sort, pagination), detail, create/edit and delete (delete asks for confirmation). CustomersManager.vue and DealsManager.vue drive the /admin/customers and /admin/deals pages.
  • Dashboard — counters (customers, leads, deals, won value), a deals-by-stage bar chart and recent activity on /admin (server/utils/crm.ts#overview).
  • CSV import — /admin/import validates a CSV, shows a per-row error report and a preview of the first valid rows, then commits. Export is a text/csv download.
  • Audit log — every mutation writes an AuditLog row (server/utils/audit.ts); /admin/audit lists it and filters by action.
  • Loading / empty / error states on every list and the import wizard.

API

Method Path Role
GET /api/admin/customers?q=&status=&sort=&page= viewer+
POST /api/admin/customers editor+
GET / PATCH / DELETE /api/admin/customers/:id viewer+ / editor+ / admin
GET / POST /api/admin/deals viewer+ / editor+
PATCH / DELETE /api/admin/deals/:id editor+ / admin
POST /api/admin/import/customers ({ csv, commit }) editor+
GET /api/admin/export/customers viewer+
GET /api/admin/audit?action= viewer+

Data model

prisma/schema.prisma: the base User, Session, Subscription, AuditLog plus Customer and Deal — identical to the Next case. SQLite in development; point DATABASE_URL at Postgres for production.

Note: the SQLite URL is resolved against <cwd>/prisma at runtime (server/utils/db.ts) so the bundled Nitro output and the Prisma CLI agree on the same file.

Quality

node templates2/qa.mjs Admin.Nuxt

See ../CONTRACT.md for the Definition of Done.