HexaGen UI is a visual configuration tool designed to simplify and accelerate the creation of production-ready, monorepo projects based on the Hexagonal Architecture (Ports and Adapters).
It provides an interactive interface to define your application's structure—from its core domain logic to its external-facing adapters—and generates a robust, type-safe foundation.
- Visual Project Wizard: Configure your architecture through a guided interface:
- Workspace: Set project name and monorepo scope (e.g.,
@zentask). - Drivers: Select UI and API frameworks (Fastify, React-Router-7).
- Core Hexagon: Define bounded contexts, entities, and use cases.
- Driven Adapters: Choose persistence (Prisma), messaging (BullMQ), and observability (OpenTelemetry).
- Workspace: Set project name and monorepo scope (e.g.,
- Instant Scaffolding: Generates a structured Yarn Workspaces monorepo.
- Interactive File Explorer: Preview the generated code before you download.
The generated project is not just boilerplate; it includes a built-in development lifecycle governed by your .architecture.yaml manifest:
- Architectural Linter (
yarn lint:arch): Usests-morphto ensure the "Inward Dependency" rule is never broken. It blocks the build if your Core accidentally imports from an Adapter. - Sync Script (
yarn sync): Automatically scaffolds boilerplate for new Entities, Use Cases, and Ports added to the manifest.
The generated project follows a strict Monorepo structure to enforce isolation between the Business Logic and Infrastructure.
zen-task-manager/
├── .architecture.yaml # The Source of Truth (Manifest)
├── package.json # Monorepo root with workspaces
├── apps/
│ ├── api/ # Fastify Driver
│ └── frontend/ # React-Router-7 Driver
├── packages/
│ ├── core/ # The Pure Hexagon (Domain + Application)
│ │ └── src/
│ │ ├── domain/ # Entities & Value Objects
│ │ └── application/
│ │ ├── use-cases/ # Logic Implementation
│ │ └── ports/ # Inbound & Outbound Interfaces
│ ├── adapters--prisma/ # Persistence Implementation
│ └── adapters--bull-mq/ # Queue Implementation
├── tools/
│ └── arch-linter/ # Architectural Governance Toolkit
│ ├── package.json # Tooling dependencies (ts-morph, lodash, etc.)
│ ├── tsconfig.json
│ └── src/
│ ├── index.ts # Linter: The "Enforcer" logic
│ └── sync.ts # Sync: The "Scaffolder" logic
└── tsconfig.base.json # Shared compiler configuration
- Install dependencies:
npm install - Run development server:
npm run dev - Open http://localhost:9002.
- Add a feature to
.architecture.yaml. - Run
yarn syncto generate the boilerplate interfaces. - Implement the logic in the generated
coreandadaptersfiles. - Run
yarn lint:archto verify architectural integrity.
- Framework: Next.js (App Router)
- Language: TypeScript
- UI: ShadCN UI & Tailwind CSS