From 7b3f28b3bf22970b43ccda759f4d94c243ee5584 Mon Sep 17 00:00:00 2001 From: Guido X Jansen Date: Fri, 13 Feb 2026 21:28:13 +0100 Subject: [PATCH] feat(scaffold): Phase 4 M1-M3 - Next.js 16 scaffold with design system --- .gitignore | 165 +- .husky/.gitignore | 10 + .husky/commit-msg | 1 + .husky/pre-commit | 1 + CLAUDE.md | 80 + README.md | 195 +- commitlint.config.mjs | 31 + eslint.config.mjs | 69 + lint-staged.config.mjs | 20 + next.config.ts | 34 + package.json | 100 + pnpm-lock.yaml | 8798 +++++++++++++++++++++++++++ postcss.config.mjs | 7 + prettier.config.mjs | 14 + public/barazo-logo-bw.svg | 15 + public/barazo-logo-currentcolor.svg | 15 + public/barazo-logo-dark.svg | 15 + public/barazo-logo-light.svg | 15 + public/file.svg | 1 + public/globe.svg | 1 + public/next.svg | 1 + public/vercel.svg | 1 + public/window.svg | 1 + src/app/favicon.ico | Bin 0 -> 25931 bytes src/app/globals.css | 260 + src/app/layout.tsx | 69 + src/app/page.tsx | 152 + src/components/skip-links.tsx | 19 + src/components/theme-provider.tsx | 16 + src/components/theme-toggle.tsx | 63 + src/lib/utils.ts | 10 + tsconfig.json | 34 + vitest.config.ts | 28 + 33 files changed, 9933 insertions(+), 308 deletions(-) create mode 100644 .husky/.gitignore create mode 100644 .husky/commit-msg create mode 100644 .husky/pre-commit create mode 100644 CLAUDE.md create mode 100644 commitlint.config.mjs create mode 100644 eslint.config.mjs create mode 100644 lint-staged.config.mjs create mode 100644 next.config.ts create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 postcss.config.mjs create mode 100644 prettier.config.mjs create mode 100644 public/barazo-logo-bw.svg create mode 100644 public/barazo-logo-currentcolor.svg create mode 100644 public/barazo-logo-dark.svg create mode 100644 public/barazo-logo-light.svg create mode 100644 public/file.svg create mode 100644 public/globe.svg create mode 100644 public/next.svg create mode 100644 public/vercel.svg create mode 100644 public/window.svg create mode 100644 src/app/favicon.ico create mode 100644 src/app/globals.css create mode 100644 src/app/layout.tsx create mode 100644 src/app/page.tsx create mode 100644 src/components/skip-links.tsx create mode 100644 src/components/theme-provider.tsx create mode 100644 src/components/theme-toggle.tsx create mode 100644 src/lib/utils.ts create mode 100644 tsconfig.json create mode 100644 vitest.config.ts diff --git a/.gitignore b/.gitignore index 91f49c0..c5e8b4f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,143 +1,42 @@ -# Claude Code -CLAUDE.md -.claude/ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* - -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json - -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage -*.lcov +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions -# nyc test coverage -.nyc_output +# testing +/coverage -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt +# next.js +/.next/ +/out/ -# Bower dependency directory (https://bower.io/) -bower_components +# production +/build +/dist -# node-waf configuration -.lock-wscript +# misc +.DS_Store +*.pem -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* -# Dependency directories -node_modules/ -jspm_packages/ +# env files (can opt-in for committing if needed) +.env* -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ +# vercel +.vercel -# TypeScript cache +# typescript *.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity - -# dotenv environment variable files -.env -.env.* -!.env.example - -# parcel-bundler cache (https://parceljs.org/) -.cache -.parcel-cache - -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# Sveltekit cache directory -.svelte-kit/ - -# vitepress build output -**/.vitepress/dist - -# vitepress cache directory -**/.vitepress/cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# Firebase cache directory -.firebase/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v3 -.pnp.* -.yarn/* -!.yarn/patches -!.yarn/plugins -!.yarn/releases -!.yarn/sdks -!.yarn/versions - -# Vite logs files -vite.config.js.timestamp-* -vite.config.ts.timestamp-* +next-env.d.ts diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..1365d03 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1,10 @@ +node_modules +.next +out +build +coverage +*.log +.env.local +.env.*.local +.DS_Store +*.tsbuildinfo diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..2e6b87e --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +pnpm exec commitlint --edit "$1" diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..5ee7abd --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +pnpm exec lint-staged diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..a2ec243 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,80 @@ +# Barazo Web -- Default Frontend + +MIT | Part of [github.com/barazo-forum](https://github.com/barazo-forum) + +The default frontend for Barazo forums. Communicates with the AppView backend exclusively via REST API. Forum admins can customize or replace entirely. + +## Tech Stack + +| Component | Technology | +|-----------|-----------| +| Framework | Next.js 16 / React 19 / TypeScript (strict) | +| Styling | TailwindCSS | +| Components | shadcn/ui (Radix primitives) for admin; custom forum components | +| Colors | Radix Colors (12-step system) + Flexoki (accent hues) | +| Icons | Phosphor Icons (6 weights, replaces Lucide) | +| Typography | Source Sans 3 / Source Code Pro (self-hosted, zero external DNS) | +| Syntax highlighting | Shiki + Flexoki theme (SSR, dual light/dark) | +| Testing | Vitest + vitest-axe + @axe-core/playwright | +| Accessibility | WCAG 2.2 AA from first commit | +| SEO | JSON-LD, OpenGraph, sitemaps, SSR | + +## What This Repo Does + +- Server-side rendered forum UI (topics, replies, categories, profiles, search) +- Admin dashboard (moderation, settings, branding) using shadcn/ui +- Communicates with barazo-api via REST API only (fully decoupled) +- Handles AT Protocol OAuth login flow (redirects to user's PDS) +- Markdown rendering for post content (sanitized) + +## Mandatory Standards + +Read these before writing any code: + +1. **Test-Driven Development** -- write tests BEFORE implementation. Use the `test-driven-development` skill. +2. **Strict TypeScript** -- `strict: true`, no `any`, no `@ts-ignore`. +3. **Accessibility** -- WCAG 2.2 AA from first commit. Pagination by default. eslint-plugin-jsx-a11y strict + vitest-axe + @axe-core/playwright in CI. +4. **SEO** -- JSON-LD structured data (DiscussionForumPosting, BreadcrumbList), OpenGraph + Twitter Cards, sitemaps, canonical URLs, robots.txt. +5. **Output sanitization** -- DOMPurify on all user-generated content. Prevent XSS. +6. **Conventional commits** -- `type(scope): description`. +7. **CI checks must pass** -- lint, typecheck, tests, a11y audit, Lighthouse CI on every PR. +8. **Semantic HTML** -- use correct elements (`