Hey is a decentralized and permissionless social media app built with Lens Protocol 🌿
at main 46 lines 2.4 kB view raw view rendered
1# Repository Guidelines 2 3## Project Structure & Modules 4 5- `apps/web`: Vite + React 19 frontend (sources under `src/`, static assets in `public/`). 6- `apps/api`: Hono-based API server (entry `src/index.ts`, routes in `src/routes/`). 7- `packages/*`: Shared code (`helpers`, `data`, `types`, `indexer`, `config`). 8- `script/*`: Maintenance utilities (e.g., sorting `package.json`, cleaning branches). 9- Tooling: PNPM workspaces (`pnpm-workspace.yaml`), Biome config (`biome.json`), Husky hooks (`.husky/`). 10 11## Build, Test, and Development 12 13- Root dev: `pnpm dev` — run all workspaces in watch mode. 14- Root build: `pnpm build` — build all workspaces in parallel. 15- Web app: `pnpm -F @hey/web dev` (preview: `pnpm -F @hey/web start`, build: `pnpm -F @hey/web build`). 16- API: `pnpm -F @hey/api dev` (typecheck: `pnpm -F @hey/api typecheck`). 17- Lint/format: `pnpm biome:check` (auto-fix: `pnpm biome:fix`). 18- Types: `pnpm typecheck` — TypeScript across the monorepo. 19- Node & PM: Node 20 (`.nvmrc`), PNPM 10 (see `package.json#packageManager`). 20 21## Coding Style & Naming 22 23- Language: TypeScript (strict, shared configs in `packages/config`). 24- Formatting: Biome controls style; no trailing commas; spaces for indentation. 25- Imports: Use workspace packages (`@hey/*`) and web alias `@/*` to `apps/web/src`. 26- Files: React components `PascalCase.tsx`; helpers/stores `camelCase.ts`. 27- Keep modules small, colocate domain helpers with their feature when practical. 28 29## Testing Guidelines 30 31- Current status: no formal unit tests present. Enforce quality via `biome` and `tsc`. 32- If adding tests, prefer Vitest for web and lightweight integration tests for API. 33- Naming: `*.test.ts` or `*.test.tsx`, colocated with the code or under `__tests__/`. 34- Run with a future `pnpm test` script at root or per package. 35 36## Commit & Pull Requests 37 38- Commits: imperative mood, concise subject; optional scope like `web:`, `api:`, `helpers:`. 39- Include rationale and references (e.g., `Closes #123`). 40- PRs: clear description, screenshots for UI changes, reproduction steps for fixes, and env notes. 41- CI hooks: pre-commit runs `biome` and type checks; ensure both pass locally before pushing. 42 43## Security & Configuration 44 45- Copy `.env.example` to `.env` in `apps/web` and `apps/api`. Never commit secrets. 46- Validate envs at startup; keep keys minimal and documented near usage.