Anarchitecture Bricks Docs

Repository documentation hub for packages, guides, and generated references.

Nest Guide

Intent

This is the Nest implementation cookbook for Anarchitecture Bricks. It focuses on backend module composition and entry-point usage, while shared cross-stack contracts stay canonical in:

Architecture

Easy Mode with Composition Modules

Use facade composition modules for the default host-app path:

import { Module } from '@nestjs/common';
import { FormsModule } from '@anarchitects/forms-nest';
import { AuthModule } from '@anarchitects/auth-nest';

@Module({
  imports: [
    FormsModule.forRoot({}),
    FormsModule.forRootFromConfig(),
    AuthModule.forRoot({}),
    AuthModule.forRootFromConfig(),
  ],
})
export class AppModule {}

Easy mode is preferred when teams want predictable integration and minimal Nest wiring.

Advanced Mode with Layer Entry Points

Use layered entry points when you need explicit control over domain composition:

Advanced mode is for replacing adapters, customizing policy wiring, or composing only selected layers while preserving facade compatibility.

TS Contract Integration

Contract ownership is TS-first:

Nest libraries (@anarchitects/forms-nest, @anarchitects/auth-nest) map these contracts in presentation/application layers and keep schemas synchronized for OpenAPI generation. Ownership and compatibility policy are defined in TS Contracts Guide.

Library Entry Point Cookbook

Schema Evolution and Compatibility

Contract Verification Workflow

Common Pitfalls