2.8 KiB
Repository Guidelines
Project Structure & Module Organization
This workspace contains two Node.js 20+ applications. digital-me-backend/ is an Express API: runtime code is under src/, HTTP handlers under src/routes/, middleware under src/middleware/, shared helpers under src/lib/, operational utilities under scripts/, and Node tests under test/. digital-me-web/ is a Vue 3, TypeScript, and Vite SPA. Its route-level screens live in src/views/, reusable UI in src/components/, Pinia state in src/stores/, composables in src/composables/, and tests in test/. Treat dist/, output/, tmp/, and .pnpm-store/ as generated or local-only. Supporting material belongs in docs/ and artifacts/.
Build, Test, and Development Commands
Run commands from the relevant application directory after npm ci:
- Backend:
npm run devstarts the API in watch mode;npm startruns it normally;npm testexecutes allnode:testtests. - Frontend:
npm run devstarts Vite;npm run type-checkvalidates Vue/TypeScript;npm run buildtype-checks and writesdist/;npm run previewserves that build. - Frontend tests:
node --experimental-strip-types --test test/*.test.tsruns the current suite because nonpm testscript is defined.
Coding Style & Naming Conventions
Preserve the established two-space indentation, semicolons, ES modules, and single-quoted strings. Backend files use camelCase names and exports; route modules should remain thin and move reusable logic into src/lib/ or src/services/. Vue components and views use PascalCase, composables use the useThing.ts pattern, and other TypeScript identifiers use camelCase. Prefer @/ imports in the frontend. No repository-wide formatter or linter is configured, so match nearby code and rely on type checking.
Testing Guidelines
Use node:test with node:assert/strict. Name tests *.test.js in the backend and *.test.ts in the frontend. Add focused regression coverage near the affected domain, including failure and authorization cases for API changes. No coverage threshold is configured; run the relevant suite and frontend type check before review.
Commit & Pull Request Guidelines
Git history is unavailable in this workspace, so no local convention can be verified. Use concise imperative subjects, optionally feat:, fix:, docs:, or test:. Pull requests should explain impact, list verification commands, link issues, and include before/after screenshots for UI work. Avoid generated files and unrelated refactors.
Configuration & Security
Copy each app's .env.example to .env. Never commit credentials, tokens, or production endpoints; frontend VITE_ values are public. Backend development requires MongoDB, and AI/media features may require provider keys and a publicly reachable PUBLIC_URL.