|
|
||
|---|---|---|
| .github/workflows | ||
| .w4c | ||
| app | ||
| docker | ||
| prisma | ||
| public | ||
| server | ||
| shared | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .gitignore | ||
| eslint.config.mjs | ||
| nuxt.config.ts | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vitest.config.ts | ||
Base — Nuxt 3 (templates2)
A ready-to-run Nuxt application — the shared core every Nuxt v2 case forks: authentication,
roles, Prisma, mock payments and email, an admin shell, SEO, i18n, observability, CI and a Docker
image. Feature-parity with templates2.Base.Next.
Not listed in the user catalog (
"catalog": falsein.w4c/template.json).
Quickstart
npm ci
cp .env.example .env # SQLite + mock providers by default — no keys needed
npm run db:setup # prisma db push + seed
npm run dev # http://localhost:3000
Demo accounts (seeded): admin@example.com (admin) and user@example.com (user) — password
password.
Scripts
| Script | What it does |
|---|---|
npm run dev |
Dev server with HMR |
npm run build / npm start |
Production build / serve .output |
npm run lint / npm run typecheck |
ESLint / nuxt typecheck |
npm test |
Unit tests (Vitest) |
npm run test:e2e |
HTTP end-to-end smoke (server must be running) |
npm run db:setup |
prisma db push + seed |
What works out of the box
- Auth & roles — email + password, bcrypt, httpOnly cookie sessions (
Sessiontable),userandadminroles.server/middleware/guard.tsgates protected pages before render; server routes enforce authorization (requireUser,requireAdmin). - Payments — provider interface: a mock provider with no keys (activates the subscription directly) plus Stripe from env. Webhooks are signature-checked and idempotent.
- Email — log provider by default, Resend from env.
- Admin — role-gated shell, stats dashboard, users table (role change / delete with confirmation) and an audit log.
- SEO —
useSeoMetaper page, JSON-LD,sitemap.xmlandrobots.txtserved fromserver/routes. - i18n — English dictionary in
shared/en.json,t()inapp/utils/i18n.ts. - Observability —
/api/health, empty/loading states, error handling. - Delivery — multi-stage Dockerfile with a healthcheck; CI runs lint + typecheck + unit + build
- e2e.
Data model
prisma/schema.prisma: User, Session, Subscription, AuditLog — identical to the Next base.
Deployment
docker compose -f docker/docker-compose.yml up --build
Quality
node templates2/qa.mjs Base.Nuxt
See ../CONTRACT.md for the Definition of Done.