Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

Engineering Standards

Practical coding, API, contract, naming, formatting, and analysis rules and how automated checks enforce them.

Standards

Apply these standards at the boundary where a change is made. Automated checks catch many violations, but passing CI does not replace clear ownership or compatible contracts.

Non-negotiable

Keep business logic inside its owning service, preserve public contract compatibility, propagate cancellation through asynchronous work, and never commit credentials. Do not introduce MediatR; request handling uses the existing source-generated mediator.

Rules and enforcement

AreaFollowHow it is enforced
Service designUse Domain-Driven Design and Vertical Slice Architecture. Services own their business rules and persistence; do not add direct service-to-service project dependencies.Architecture tests and review
C#Prefer nullable-aware, file-scoped code. Seal endpoints, handlers, DbContexts, integration events, and test classes by default. Keep warnings actionable.Compiler warnings as errors, Roslyn analyzers, architecture tests
Async workUse async/await end to end and pass CancellationToken through every asynchronous boundary.Analyzers and review
Requests and APIsKeep endpoint handlers focused; use explicit API versions and apply authorization at the endpoint boundary. Validate input and return consistent errors.Build checks, tests, and review
Messaging contractsName events [Action][Entity]IntegrationEvent. Publish only fields consumers need; preserve message identity and ownership metadata.Pact contract tests and review
Protocol BuffersLint schemas, check backward compatibility, and regenerate the schema lock after an intentional change.Buf checks and consumer coordination
PostgreSQLUse snake_case for identifiers, columns, tables, and raw SQL.Review and database tests
FrontendUse Bun, keep workspace imports within the allowed dependency direction, avoid any, and provide accessible interactions.Boundary checks, TypeScript checks, ESLint
FormattingApply the repository formatter to changed files; do not suppress a formatter or analyzer finding globally.Git hooks and CI

Run the relevant checks

  • Backend: mise run build, then the relevant test task from Testing ExecutionCustom DocTesting ExecutionHow to run backend, frontend, contract, browser, and documentation checks locally and interpret their results.Ownerarchitecture-enabling-teamOpen doc.
  • Frontend: run bun run boundaries, bun run check-types, and bun run lint in the frontend workspace.
  • Protocol Buffers: after installing Buf with mise run setup:buf, run buf lint, buf breaking --against lock.binpb, and buf build -o lock.binpb from the schema workspace. Commit the schema and refreshed lock together.
  • Formatting: use mise run format:cs, mise run format:fe, or mise run format:docs for the changed area.

CI repeats the applicable format, analyzer, architecture, boundary, contract, and test checks. See Testing MatrixCustom DocTesting MatrixReference tables for test scope, dependencies, local and CI execution triggers, and passing criteria.Ownerarchitecture-enabling-teamOpen doc for which suites apply and Pull Request ProcessCustom DocPull Request ProcessPrepare a focused draft, satisfy automated checks and review, and merge a contribution safely.Ownerarchitecture-enabling-teamOpen doc for merge requirements.