|
|
||
|---|---|---|
| .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 | ||
Content / Blog & Docs — Nuxt 3 (templates2)
A ready-to-run content site: posts and docs authored in a role-gated admin, rendered with a
table of contents and code highlighting, with tags, author pages, search, RSS and a sitemap. A fork
of templates2.Base.Nuxt that keeps the whole core — auth, roles, Prisma, mock
payments/email, the admin shell, SEO, i18n, observability, CI and the Docker image.
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):
| Role | Password | |
|---|---|---|
| admin | admin@example.com |
password |
| editor | editor@example.com |
password |
| user | user@example.com |
password |
Authoring
Sign in as editor (or admin) and open /admin/posts to
create draft posts and publish them, or /admin/docs for the
docs pages. A draft is invisible on the blog, the feed, the sitemap and search until it is
published. Authors pick a byline, tags and (for posts) a featured flag; the slug is suggested from
the title. The admin also offers a live preview. Deletion is admin-only; the editor role can author
and publish.
What works out of the box
- Content — posts and docs stored in Prisma (SQLite dev / Postgres prod), authored in the admin, never hard-coded. Markdown-lite bodies (headings, lists, quotes, links, fenced code) are rendered in-repo with a table of contents and language-labelled, highlighted code — no markdown package.
- Taxonomy — tags and author pages, plus related posts (shared tag or author).
- Search — a server route over post and doc titles and bodies, with a results page and empty state.
- Feeds/SEO —
sitemap.xml(incl. docs),rss.xml, per-post metadata and JSON-LDArticle. - Auth & roles — email + password, bcrypt, httpOnly cookie sessions.
user,editorandadminroles; authoring routes are gated server-side (requireStaff/requireAuthor). - Payments / Email — mock providers with no keys; Stripe and Resend activate from env.
- Admin — the base shell plus Posts and Docs managers; admin-only users and audit log.
- Delivery — multi-stage Dockerfile with a healthcheck; CI runs lint + typecheck + unit + build + e2e.
Data model
prisma/schema.prisma: the base (User, Session, Subscription, AuditLog) plus Author,
Tag, PostTag, Post (with status, publishedAt, readingMinutes, featured) and Doc.
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 |
Deployment
docker compose -f docker/docker-compose.yml up --build
Quality
node templates2/qa.mjs Content.Nuxt
See ../CONTRACT.md for the Definition of Done.