Docs

Search documentation

Jump to a documentation page.

PricingMarketingApp

Search documentation

Jump to a documentation page.

Project Rules

Project rules

Summary of PROJECT-RULES.md at the monorepo root — that file is the source of truth; this page is for browsing in the docs site.

In the repository, open PROJECT-RULES.md at the monorepo root for the exact wording used by contributors and automation.

Goal

This repo is a pnpm monorepo: product (apps/web, TanStack Start), documentation (apps/docs, deploy to docs.*), marketing (apps/marketing), and shared packages (packages/core, packages/server, packages/shared). It targets multi-tenant B2B SaaS with orgs/workspaces, Stripe billing, and solid DX.

Tech stack

  • TanStack Start (router + full-stack)
  • React + TypeScript
  • TanStack Router
  • TanStack Query
  • Postgres + Drizzle
  • Stripe for subscriptions
  • shadcn/ui for the design system

Architecture rules

  • Multi-tenant by default: business data is scoped with organizationId where it applies.
  • Users can belong to multiple organizations (roles: owner, admin, member).
  • Product (app.* / apps/web): authenticated dashboard at / (pathless _shell layout); settings under /settings/*; platform admin under /admin/*.
  • Marketing (apex / apps/marketing): public /, /pricing, legal, sitemap.
  • Documentation (docs.* / apps/docs): Markdown under src/content/docs, routes at the site root (e.g. /guide/monorepo).
  • Cross-host links use appHref / marketingHref / docsHref from @yournextsaas/core (or @/config/origins in apps) plus VITE_APP_ORIGIN / VITE_MARKETING_ORIGIN / VITE_DOCS_ORIGIN.
  • Prefer feature-based organization in code where it helps; keep routing file-based.

Coding style

  • Strongly typed TypeScript everywhere.
  • Prefer hooks and feature modules over large “god” components.
  • Server state: TanStack Query; route wiring: loaders/actions in TanStack Router.
  • Keep domain logic out of presentational components (packages/server or feature modules under packages/shared).

AI / change discipline

  • For new features: propose a short plan, then implement in small steps.
  • Avoid deleting or rewriting large files unless asked.
  • Prefer small, focused changes per request.