Skip to content
All work

Internal standard · 2026

Next.js Frontend Template

The company standard for new frontends

What it is

An opinionated production template that new client frontends start from. I built and documented it on my own. It is not a starter kit, it is the argument for how we build frontends, written down so it survives me.

How it works

  • 143 files across app routes, a data-view component layer, shared UI, permissions, forms and a typed API client.
  • Backend-for-frontend authentication: tokens live in httpOnly cookies and are never exposed to JavaScript. Route handlers proxy auth and inject the bearer token.
  • Built-in RBAC with four default roles and resource.action permission strings, gating both navigation and individual components.
  • 17 numbered rule documents, each one topic, plus an architecture guide explaining how the pieces fit. A CLAUDE.md carries the guardrails and the anti-pattern list for AI assistants working in the repo.
  • Trimming support, so a project that does not need permissions, decimal money maths or dark mode can remove them cleanly instead of working around them.

What I took from it

Now the default starting point for new projects. Writing the rules down forced me to justify each one, and several did not survive the writing.