2.9 KiB
Repository Guidelines
Project Structure & Module Organization
This repository is a pnpm workspace with three packages under packages/:
packages/app: Vue 3 +uni-appWeChat mini-program. Pages live insrc/pages, shared UI insrc/components, state insrc/stores, and utilities insrc/utils.packages/server: NestJS API with Prisma. Feature modules live insrc/<domain>, unit tests are colocated in__tests__, and the database schema and seed script are inprisma/.packages/shared: shared TypeScript enums, constants, and types used by both app and server.
Reference docs and implementation notes are under docs/.
Build, Test, and Development Commands
pnpm dev:server: start the NestJS API with watch mode.pnpm dev:app: build and serve theuni-apptarget for WeChat mini-program development.pnpm build:shared: compile shared types before consuming package changes.pnpm build:server: build the backend intopackages/server/dist.pnpm build:app: produce the WeChat mini-program build.pnpm test: run workspace tests; today this mainly executes server Jest tests.pnpm lint: run workspace linting; currently defined for the server.
For Prisma tasks, work in packages/server: pnpm prisma:generate, pnpm prisma:migrate, pnpm prisma:seed.
Coding Style & Naming Conventions
Use TypeScript throughout. Follow the existing style: 2-space indentation in JSON/Markdown, camelCase for variables/functions, PascalCase for Vue components and NestJS classes, and kebab-case for page/component filenames such as flash-sales.vue. Keep modules feature-oriented and prefer colocating DTOs and tests with their domain module.
Linting is configured in the server via ESLint. The app relies on vue-tsc for type checks: run pnpm --filter @mp-pilates/app type-check before shipping UI changes.
Testing Guidelines
Server tests use Jest with *.spec.ts naming. Place tests in packages/server/src/**/__tests__/ and focus on service-level behavior and edge cases around booking, membership, payment, and scheduling logic. Run pnpm test for the full suite or pnpm --filter @mp-pilates/server test:cov when touching business-critical paths.
Commit & Pull Request Guidelines
Recent history uses Conventional Commit prefixes such as feat:, fix:, fix(app):, and perf:. Keep subjects short and specific, preferably describing the user-visible effect.
Pull requests should include a concise summary, linked issue or task reference, test notes, and screenshots or recordings for mini-program UI changes. Call out Prisma schema changes, new environment variables, or deployment steps explicitly.
Security & Configuration Tips
Do not commit real secrets. Review packages/server/certs/ and environment-specific payment or WeChat credentials carefully before pushing. When changing shared types or enums, update both consumers and rebuild @mp-pilates/shared to avoid runtime drift.