Development Workflow
Learn the day-to-day commands, QA expectations, and collaboration practices for Raypx.
Environment Setup
- Install dependencies with
pnpm install. - Copy
.env.exampleto.env.localand fill in required secrets. - Run
pnpm db:migrateif the change set needs database primitives. - Start the dev server with
pnpm web:dev.
Use
pnpm devwhen you want Turborepo to watch all affected apps, not just the web front end.
Common Scripts
| Command | Description |
|---|---|
pnpm web:dev | Start the TanStack Start frontend in development mode. |
pnpm build | Build every package and app according to the Turborepo graph. |
pnpm typecheck | Validate TypeScript types workspace-wide. |
pnpm check | Run Biome linting and static analysis. |
pnpm test | Execute Vitest unit suites. |
pnpm coverage | Generate coverage reports with Vitest. |
pnpm clean | Clear build artifacts and .turbo caches. |
Coding Standards
- Formatting & linting: Biome enforces formatting and lint rules. The pre-commit hook runs
pnpm -w format, so make sure your changes pass locally. - Type safety: Projects compile with strict TypeScript settings. Prefer explicit return types in shared packages.
- Directory conventions: Co-locate tests next to their modules (
*.test.ts[x]) or inside__tests__/. Keep React Server Components inapps/web/src/appand Client Components undercomponents.
Git Practices
- Follow Conventional Commits (
feat:,fix:,chore:). Use comma-separated scopes for cross-package work:feat(web,i18n): add zh-cn landing page. - Avoid rewriting history on shared branches unless coordinated (
git push --force-with-leaseonly after confirming with the team). - Run
pnpm build,pnpm test, andpnpm checkbefore pushing.
Testing Guidance
- Add Vitest coverage for new logic. Prefer mocking only at the boundary (e.g., network, environment).
- For UI changes, add stories or screenshots wherever possible. Playwright suites will be added later; leave TODO comments rather than empty tests.
- Use
pnpm coveragebefore raising a PR to make sure the change does not regress coverage thresholds.
Working with Docs
- Documentation lives under
apps/web/content/docs. Each English MDX file can have a*.zh.mdxcounterpart for Simplified Chinese. - Run
pnpm web:devto preview docs locally; updates trigger automatic reloads. - Keep frontmatter titles and descriptions concise—they are surfaced in search, navigation, and SEO metadata.
Troubleshooting
- Delete
.turboand rerunpnpm installif builds behave unexpectedly. - If pnpm warns about missing peer dependencies, install them at the workspace root so all packages resolve the same version.
- Check
apps/web/source.generated.tsback into git only when MDX sources change; it is generated deterministically by Fumadocs.