Ready-to-run content site: markdown posts and docs, taxonomy, search, RSS/sitemap and a role-gated authoring admin.
Find a file Use this template
w4c-templates fa5b6ad079
Some checks failed
CI / quality (push) Has been cancelled
chore(template): publish Content.Next
2026-10-11 23:33:30 +03:00
.github/workflows chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
.w4c chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
app chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
components chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
docker chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
lib chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
messages chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
prisma chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
public chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
tests chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
.dockerignore chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
.env.example chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
.eslintrc.json chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
.gitignore chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
middleware.ts chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
next.config.ts chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
package-lock.json chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
package.json chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
postcss.config.mjs chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
README.md chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
tsconfig.json chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00
vitest.config.ts chore(template): publish Content.Next 2026-10-11 23:29:57 +03:00

Content / Blog & Docs — Next.js (templates2)

A ready-to-run content site: markdown-ish posts and docs with frontmatter-style fields (title, slug, date, tags, author, draft), a table of contents, code highlighting, taxonomy, server-side search, RSS/sitemap, JSON-LD and a role-gated authoring admin — all working on the first run.

Built by forking Base.Next; it inherits auth, roles, Prisma, mock payments and email, the admin shell, SEO, i18n, CI and Docker.

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), password password:

Role Email Can do
admin admin@example.com everything, incl. users & audit
editor editor@example.com author posts and docs
user user@example.com read-only

What works out of the box

  • Content — posts and docs stored in Prisma (authored in the admin, not hard-coded), rendered by an in-repo markdown renderer with a table of contents, fenced-code highlighting + language labels, lists, quotes, links and inline formatting.
  • Public site — paginated /blog, post pages with byline + related posts, /docs grouped by section with a sidebar and prev/next, /tags, /authors/[slug] and a server-side /search.
  • Authoring admin — /admin/posts and /admin/docs: create/edit/preview/publish/draft, featured posts, tag multi-select, with live preview; server API under /api/admin/posts and /api/admin/docs enforces the role and writes an audit entry.
  • Feeds/SEO — sitemap.xml (posts, docs, tags, authors), rss.xml, per-post metadata and JSON-LD Article.
  • Core — auth + roles, mock payments/email, admin shell, /api/health, both themes, responsive to 360 px, WCAG AA contrast.

Markdown support

Extending the base's minimal renderer (no mdx/remark/gray-matter dependency): #–### headings, paragraphs, ordered/unordered lists, blockquotes, ---, **bold**, *italic*, `inline code`, [links](/path), and fenced code blocks with a language label and lightweight syntax highlighting.

Data model

prisma/schema.prisma: Author, Tag, PostTag, Post, Doc (plus the base User, Session, Subscription, AuditLog). SQLite in development; point DATABASE_URL at Postgres for production.

Scripts

Script What it does
npm run dev Dev server with HMR
npm run build / npm start Production build / serve
npm run lint / npm run typecheck ESLint / tsc --noEmit
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.Next        # from the repo root: node templates2/qa.mjs Content.Next

The harness isolates a clean copy, then runs install → verify → test → build → boot → routes → e2e → screenshot. See ../CONTRACT.md for the Definition of Done.