2.7 KiB
Repository Guidelines
Project Structure & Module Organization
This repository is a Turbo monorepo with npm workspaces.
apps/web: main Next.js app and API surface. Most product code lives inapps/web/src, with UI insrc/components, routes insrc/appandsrc/pages, shared helpers insrc/lib, and queries insrc/queries.apps/demo: lightweight demo app for validating thezenblogpackage.packages/zenblog: published TypeScript client, with source insrc, tests intests, and build output indist.packages/types,packages/hash,packages/code-block-sugar-high: supporting workspace packages.apps/web/publicandapps/web/assets: static assets.supabase/contains local Supabase state and tooling data.
Build, Test, and Development Commands
npm run dev: starts workspace development via Turbo.npm run dev:web: runs the main app only.npm run build: builds all workspaces.npm run test: runs Vitest from the repo root.npm run format: formatsts,tsx, andmdfiles with Prettier.cd apps/web && npm run lint: lint the web app with ESLint.cd apps/web && npm run typecheck: run TypeScript checks for the web app.npm run db:start/npm run db:stop: manage the local Supabase stack.
Coding Style & Naming Conventions
Use TypeScript throughout and keep formatting consistent with Prettier: 2-space indentation, no tabs. Follow the existing file-local style rather than renaming for consistency alone.
- React components:
PascalCasefilenames, e.g.ContentRenderer.tsx. - Hooks:
use...names, e.g.useKeyboard.ts. - Utilities and route helpers: short descriptive names, commonly lowercase or kebab-case, e.g.
create-id.ts,slugify.test.ts.
Testing Guidelines
Vitest is the active test runner. Place tests close to the code for app behavior or under package-level tests/ folders for libraries. Use *.test.ts naming. Run focused tests first, then broader workspace tests if needed.
Do not edit generated outputs unless required by the task; regenerate them instead. This especially applies to apps/web/src/types/supabase.ts and package build artifacts in packages/zenblog/dist.
Commit & Pull Request Guidelines
Recent history favors short, imperative commit messages, often with conventional prefixes like feat:, fix:, or style:. Keep commits focused and scoped to one change.
Pull requests should include a concise summary, linked issue or context, testing notes, and screenshots for UI changes. Call out schema, env, or webhook changes explicitly so reviewers can validate local setup.
Configuration Tips
Use Node.js 20+ when possible. Stripe and Supabase workflows exist in the repo scripts; avoid committing secrets or local-only config values.