Skip to content

Repository files navigation

Gold Standard

Gold Standard is an opinionated full-stack TypeScript monorepo starter.

It is designed to be a strong default for new projects: a practical baseline for monorepo layout, API contracts, schema ownership, auth flows, shared packages, and backend layering.

Instead of being just a demo app, Gold Standard is meant to answer questions like:

  • How should a new feature/module be added?
  • Where should contracts, schemas, services, and repositories live?
  • How should frontend and backend types stay aligned?
  • What does a clean full-stack TypeScript monorepo look like?

Status

Gold Standard is currently a work in progress. The core structure is in place, but the template is still evolving as the conventions, tooling, and auth story are refined.

Planned Additions

  • Upgraded auth, either with Better Auth or a custom approach, with support for refresh tokens and social login
  • Package versioning strategy using the pnpm catalog
  • Test coverage for the template and its core flows

What Gold Standard Is

  • A pnpm workspace managed with Turborepo
  • A full-stack TypeScript monorepo
  • An opinionated starter for new monorepo-based products
  • A reference implementation for typed APIs and shared contracts
  • A project with first-class autogenerated Scalar/Swagger API docs baked into the backend
  • A starter with a structured notifications layer, React Email templates, and Resend-based email delivery already wired in

Apps

  • apps/web: Vite + React frontend
  • apps/api: Hono + oRPC backend

Packages

  • packages/api-schemas: shared Zod schemas for inputs and outputs
  • packages/api-contract: shared oRPC contract definitions
  • packages/api-client: typed API client and TanStack Query helpers
  • packages/auth-react: reusable client-side auth state utilities
  • packages/db: Prisma schema, generated client, and DB access package
  • packages/ui: shared UI components and styles

Tooling

  • tooling/eslint: shared ESLint config package used across apps and packages via @workspace/eslint-config
  • tooling/prettier: shared Prettier config package used across the workspace via @workspace/prettier-config
  • tooling/typescript: shared TypeScript base configs used across apps and packages via @workspace/tsconfig

Notifications and Email

The backend already includes a structured notifications module instead of scattering email logic across feature services.

  • apps/api/src/infrastructure/notifications: typed notification events, channel renderers, transport registration, and the notification dispatcher
  • apps/api/src/infrastructure/email: React Email templates, template rendering, and the Resend-backed email client

The current setup is designed so modules trigger notifications by event name and payload, while delivery stays transport-specific. Right now email is fully wired with React Email and Resend, and the notification layer is already shaped to support additional channels like SMS, WhatsApp, and push without changing feature-level orchestration.

API Docs / Scalar Integration

A major part of this architecture is its built-in Scalar/Swagger documentation layer. The API docs are autogenerated from the oRPC contract and Zod schemas, and served live from the running backend at /api/docs. The machine-readable OpenAPI JSON spec is available at /api/spec.

This is not a separate docs project — it is part of the API contract itself, ensuring the API surface is always documented and discoverable.

Architectural Direction

Gold Standard favors a clear separation of concerns:

  • Prisma models define persistence
  • Zod schemas define API inputs and outputs
  • API contracts define the transport surface
  • Routers implement procedures
  • Services hold business logic
  • Repositories handle database access

That means new backend modules should generally follow:

procedure -> service -> repository -> prisma
                     -> dto mapper -> output schema

Documentation

Getting Started

Install dependencies:

pnpm install

Run everything in dev:

pnpm dev

Common commands:

pnpm build
pnpm lint
pnpm lint:fix
pnpm check-types
pnpm db:generate
pnpm db:push

Notes

  • Gold Standard is intentionally opinionated: it optimizes for consistency, maintainability, and a clean developer experience.
  • It is meant to be a starting point, not a rigid framework. Adapt it to your product, but keep the architectural boundaries deliberate.
  • Several Turborepo-specific conventions and workspace patterns are inspired by t3-oss/create-t3-turbo.

About

Gold Standard is a turborepo starter template for building apps with e2e type-safety using contract-first oRPC.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages