- Source:
src/withcomponents/,pages/(e.g.,HomePage.tsx),hooks/,lib/,contexts/,types/, andtest/utilities. - Entry points:
index.html,src/main.tsx,src/App.tsx,src/AppRouter.tsx. - Assets:
public/(e.g.,manifest.webmanifest, redirects). Build output:dist/. - Config:
vite.config.ts,tailwind.config.ts,eslint.config.js,tsconfig*.json, custom ESLint rules ineslint-rules/. - Aliases: import app code via
@/…(seetsconfigandvite.config).
npm run dev: install deps and start Vite on:8080.npm run build: install deps, build, and copyindex.htmlto404.html.npm run test: type-check, lint (TS + HTML), run unit tests (Vitest/jsdom), then build.- Deploy:
npm run deploy(nostr-deploy-cli),npm run deploy:cloudflareor:preview(Wrangler Pages).
- Language: TypeScript + React 18. Components in
.tsx; utilities in.ts. - Naming: Components
PascalCase, hooksuseX, pages*Page.tsx, tests*.test.ts(x)colocated. - Linting: ESLint with TypeScript, React Hooks, HTML rules and custom rules in
eslint-rules/.- No inline
eslint-disable(enforced). Avoid placeholder comments and inline<script>in HTML.
- No inline
- TailwindCSS for styling; prefer utility classes and
tailwind-merge.
- Frameworks: Vitest + @testing-library/react with
jsdom. Global setup:src/test/setup.ts. - Place tests next to code (
*.test.ts/*.test.tsx). Favor user-facing assertions via Testing Library. - Run locally:
npm run testorvitest run(CI mode). Keep tests deterministic; mock browser APIs as needed.
- Commits: imperative, present tense (e.g., "Add profile page"). Keep focused; reference issue IDs when applicable.
- PRs: include summary, motivation, screenshots for UI changes, and test coverage for new logic.
- CI hygiene: ensure
npm run testpasses locally before opening/merging PRs.
- Do not commit secrets. Configure deploy targets via
wrangler.tomland environment variables. - Verify
public/manifest.webmanifestand HTML meta requirements (HTML ESLint rules) before deploy.