# 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 dev` starts the API in watch mode; `npm start` runs it normally; `npm test` executes all `node:test` tests. - Frontend: `npm run dev` starts Vite; `npm run type-check` validates Vue/TypeScript; `npm run build` type-checks and writes `dist/`; `npm run preview` serves that build. - Frontend tests: `node --experimental-strip-types --test test/*.test.ts` runs the current suite because no `npm test` script 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`.