mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 06:14:59 +00:00
2.7 KiB
2.7 KiB
Repository Guidelines
Project Structure & Module Organization
frontends/nextjs/: primary Next.js app (source insrc/, E2E ine2e/, local helper scripts inscripts/).packages/: JSON-driven component packages (seed/*.json, optionalstatic_content/, andtests/for schema/structure checks).dbal/: database abstraction layer (TypeScript library indbal/ts/; additional tooling/docs underdbal/).prisma/: Prisma schema and migrations (schema.prisma,migrations/).config/: shared config (Playwright/Vite/TS/ESLint) symlinked intofrontends/nextjs/.tools/: repo utilities (quality checks, workflow helpers, code analysis).
Build, Test, and Development Commands
Run app workflows from frontends/nextjs/:
npm install(ornpm ci): install dependencies.npm run dev: start local dev server.npm run build/npm run start: production build and serve.npm run lint/npm run lint:fix: lint (and auto-fix where safe).npm run typecheck: TypeScript checking (tsc --noEmit).npm run test:unit/npm run test:coverage: Vitest unit tests (coverage output tofrontends/nextjs/coverage/).npm run test:e2e: Playwright E2E tests.npm run db:generate/npm run db:push/npm run db:migrate: Prisma client + schema/migrations.
DBAL library workflows live in dbal/ts/ (npm run build, npm run test:unit).
Coding Style & Naming Conventions
- TypeScript + ESM. Prefer
@/…imports insidefrontends/nextjs/src/. - React components:
PascalCase.tsx; hooks:useThing.ts; tests:*.test.ts(x). - UI: use Material UI (
@mui/*) and SCSS/modules as needed; do not introduce Radix UI or Tailwind (seeUI_STANDARDS.md). - Package metadata: keep
packages/*/seed/metadata.jsonpackageIdinsnake_caseand versions semver (e.g.1.2.3).
Testing Guidelines
- Unit: Vitest (
frontends/nextjs/src/**/*.test.ts(x)andpackages/*/tests/*.test.ts). - E2E: Playwright (
frontends/nextjs/e2e/). - Add/adjust tests with behavior changes; keep tests deterministic (no network, stable clocks/IDs).
Commit & Pull Request Guidelines
- Commits generally follow Conventional Commits (examples in history:
feat: …,fix: …,docs: …,refactor: …,chore: …). - PRs should include: what/why, linked issue (if any), screenshots for UI changes, and notes on DB/schema changes.
- Before opening a PR, run
npm run lint,npm run typecheck, and the relevant tests.
Agent-Specific Notes
- Check for scoped rules in nested
AGENTS.mdfiles (e.g.,dbal/AGENTS.md) before editing those areas. - Keep changes focused, avoid dependency churn, and follow existing patterns/config in
config/andfrontends/nextjs/.