|
| 1 | +# Codú — contributor & assistant guide |
| 2 | + |
| 3 | +Codú is the community platform for AI builders and indie hackers: a curated feed |
| 4 | +of articles, tips, questions, and links, with profiles, discussions, moderation, |
| 5 | +and a build-board. This file orients anyone (human or AI assistant) working in the |
| 6 | +repo. |
| 7 | + |
| 8 | +## ⚠️ This is a public, open-source repository |
| 9 | + |
| 10 | +Everything committed here is public and permanent in git history. Before you write |
| 11 | +or commit anything: |
| 12 | + |
| 13 | +- **No private or internal content.** No secrets, API keys, access tokens, |
| 14 | + customer data, internal planning docs, design docs, scratch notes, or |
| 15 | + personal/operational details. Local-only notes belong in gitignored files |
| 16 | + (`local.md`, `.claude/`). |
| 17 | +- **No assistant attribution or scratch artifacts.** Do not add AI co-author |
| 18 | + trailers, "generated by" notes, planning/design markdown, or tool config to |
| 19 | + commits, commit messages, or PR descriptions. |
| 20 | +- **Code must clear public code review.** Assume every line will be read by |
| 21 | + external contributors and maintainers. Hold a high bar: clear naming, no dead |
| 22 | + code, no debug logging, tests for new logic, and changes scoped to one concern. |
| 23 | + |
| 24 | +## Stack |
| 25 | + |
| 26 | +- **Next.js (App Router)** + React + TypeScript. |
| 27 | +- **tRPC** for the API (`server/api/router/*`), **Drizzle ORM** over **Postgres** |
| 28 | + (`server/db/schema.ts`, migrations in `drizzle/`). |
| 29 | +- **NextAuth** for auth; **Tailwind CSS** for styling (design tokens in |
| 30 | + `styles/globals.css`). |
| 31 | +- **AWS**: S3 (uploads), Bedrock (content moderation/analysis), CDK-managed cron |
| 32 | + Lambdas + EventBridge (`cdk/`). Deployed on **Vercel** (the `develop` branch is |
| 33 | + production; `db:migrate` runs on the production build). |
| 34 | +- **Testing**: Vitest unit tests (`*.test.ts`), Playwright e2e (`e2e/`). |
| 35 | + |
| 36 | +## Layout (route groups = layout boundaries) |
| 37 | + |
| 38 | +`app/` is split into route groups, each its own layout "world": |
| 39 | + |
| 40 | +- `(app)` — the public 3-column rail shell (`AppShell`): feed (home), profiles, |
| 41 | + posts, discussions. The feed is the homepage. |
| 42 | +- `(admin)` — private, full-width admin cockpit (`AdminShell`); ADMIN-role gate in |
| 43 | + its `layout.tsx`. Not part of the public shell. |
| 44 | +- `(auth)`, `(editor)`, `(marketing)` — their own chrome. |
| 45 | + |
| 46 | +A page that should not use the public rail shell does **not** live in `(app)` — it |
| 47 | +gets a sibling route group. Don't reach for runtime flags to opt out of a layout. |
| 48 | + |
| 49 | +## Working in this repo |
| 50 | + |
| 51 | +- **Before claiming done, run and pass locally:** `npm run lint`, |
| 52 | + `npm run prettier`, `npm run test:unit`, and `npm run build`. Migrations: |
| 53 | + `npm run db:generate` after schema changes (review the generated SQL). |
| 54 | +- **Schema changes** are additive where possible; migrations apply on the prod |
| 55 | + deploy, so never write a migration that can fail destructively. |
| 56 | +- **Match the surrounding code**: comment density, naming, and idioms. New tRPC |
| 57 | + procedures go in the relevant `server/api/router/*` file; keep DB access there. |
| 58 | +- **Keep PRs focused** — one concern per PR, with a clear description of what and |
| 59 | + why. |
0 commit comments