Docs
Codebase

Project Structure

Learn how to navigate the codebase of the starter kit.

Achromatic uses Turborepo and pnpm workspaces to enforce a modern monorepo structure.

Workspaces

The monorepo is divided into three main workspaces:

packages:
  - "apps/*"
  - "packages/*"
  - "tooling/*"
  • Apps: Applications, such as the marketing website or dashboard.
  • Packages: Shared packages, basically all your libraries.
  • Tooling: Configurations for ESLint, Prettier, Tailwind and TypeScript.

Folders

  • apps

App workspace

DirectoryPurpose
/appsApplications (everything that can be executed)
/apps/dashboardMain web application
/apps/marketingMarketing pages
/apps/prisma-studioVisual Database Editor from Prisma
/apps/react-email-previewTo preview the React Email templates
/apps/requirements-checkScript to make sure you have min versions installed

Packages workspace

DirectoryPurpose
/packagesPackages (everything that can be installed into your apps)
/packages/api-keysGenerate and consume api keys for a public API
/packages/authAuth.js configuration, organizations and invitations
/packages/billingLogic to handle the billing and payments
/packages/commonTiny library for shared errors and type guards
/packages/databaseContains your Prisma schema, client and migrations
/packages/emailLogic to send emails and resolve the right provider
/packages/email-templatesReact Email templates
/packages/image-processingResizing and conversion of images using the sharp library
/packages/markdownHelpers to render markdown to HTML and the other way around
/packages/rate-limitRate limiters to protect your application from brute-force
/packages/routesCommon route object to be able to link dashboard and marketing together type-safe
/packages/uiThe design system based on shadcn/ui (components, hooks, styles)
/packages/webhooksHelpers to send webhooks

Tooling workspace

DirectoryPurpose
/toolingConfigurations for your monorepo
/tooling/eslint-configLinting rule-sets using ESLint
/tooling/prettier-configFormatting rules using Prettier
/tooling/tailwind-configShared tailwind config
/tooling/typescript-configTypescript presets for different use-cases

Namespace prefix

The namespace prefix is @workspace/*. This is the same as in the shadcn monorepo setup.