DevLink is a developer community platform built in a TypeScript monorepo, around one idea: the API contract should be a single artefact that everything else is derived from, so drift between server and client becomes impossible rather than merely unlikely.

A shared Zod contract package generates three things at once: NestJS request validation, the OpenAPI 3.0 document, and the browser client types. Change a field in a way the client does not expect and the build fails. The surface it describes is 38 documented REST operations across 9 Prisma models.

The hardest correctness problem is the feed. Ranking (Hot, Top, New, Discussed) relies on denormalised counters, which are exactly the kind of state that silently drifts under concurrent writes. Every counter update is a single-statement atomic SQL write inside the same transaction as the action that caused it, and a recount job plus an end-to-end concurrency suite assert zero counter drift rather than assuming it.

Auth runs on Argon2id hashing with httpOnly-cookie JWT sessions and refresh-token rotation with family-wide theft detection. Search is PostgreSQL full-text over a trigger-maintained GIN tsvector index, paginated by keyset so a feed that reorders mid-scroll never repeats or skips a row.

The client is Next.js 16 and React 19 Server Components with optimistic reactions and threaded comments. Everything is gated by 246 automated tests and a GitHub Actions pipeline running lint, typecheck, unit, end-to-end and OpenAPI-drift checks against containerised PostgreSQL.