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 (`