Aurea Docs
Architecture

Conventions

TypeScript, formatting, import order, component design, and dependency rules enforced across the Aurea monorepo.

TypeScript

  • Strict mode is on in every package ("strict": true via @repo/typescript-config/base.json).
  • any is forbidden. Use unknown and narrow, or reach for a proper generic.
  • All configs extend @repo/typescript-configbase.json, nextjs.json, or react-library.json.
  • tsc --noEmit (or next typegen && tsc --noEmit for Next.js apps) is a required CI step.

Formatting — Prettier

All files are formatted by Prettier with these settings (.prettierrc.js):

module.exports = {
  semi: false,
  singleQuote: true,
  trailingComma: 'es5',
  tabWidth: 2,
  printWidth: 100,
  endOfLine: 'auto',
}

Formatting is enforced in CI (bun run format:check) and applied automatically by lint-staged on every commit via Husky.

Import ordering

Imports are sorted in three groups, separated by blank lines:

  1. Node built-ins (node:fs, node:path, …)
  2. External packages (npm — alphabetical within group)
  3. Internal / workspace paths (@/*, @repo/*, relative ./)

Example:

import { readFileSync } from 'node:fs'

import { Injectable } from '@nestjs/common'
import { z } from 'zod'

import { CasesService } from '@/modules/cases/cases.service'
import { toMcpContent } from './helpers'

The ESLint import/order rule (via @repo/eslint-config/base) enforces this automatically.

Component design — atomic design

@repo/ui follows a strict atomic design hierarchy:

LevelPathExamples
Atomscomponents/atoms/Button, Badge, Input
Moleculescomponents/molecules/FormField, SearchBar
Organismscomponents/organisms/Header, DataTable

Apps consume components via the @repo/ui workspace package — never by copying files.

Commit messages

Commits follow Conventional Commits (feat:, fix:, chore:, docs:, etc.) enforced by commitlint + Husky.

Dependency direction

AllowedForbidden
apps/*packages/*packages/*apps/*
packages/uipackages/sharedpackages/sharedpackages/ui
anything → packages/tooling/* (config)packages/tooling/* → runtime packages

Turborepo's dependsOn config mirrors this graph so that build order is always correct.

On this page