Basilic
Architecture

Monorepo Structure

Turborepo workspace: apps, @repo packages, and tools.

One repository, Turborepo task graph, pnpm workspaces. Rationale: ADR 001. Tooling: Development Tooling. Conventions: Package Conventions, File Organization.

Apps: api (Fastify), web (Next.js 16), mobile (Expo 57 UI scaffold — shares tokens later, not components/@repo/core types yet), docu (Fumadocs, not copied into generated projects).

Tools: eslint, typescript (copied), create-basilic (generator; excluded from generated projects). See ADR 012.

Packages: core (generated, no app runtime), react (handwritten hooks on core), ui, email, error, utils, cli.

Dependency rule: corereact; apps depend on packages, never the reverse. Pattern A packages import src/ in the workspace; Pattern B Node consumers (Fastify, serverless) use dist/. prepack switches to dist/ for npm. See Publishing and ESM & TypeScript.