Skip to content

martinkrakowski/hexagen

Repository files navigation

HexaGen UI

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.

✨ Core Features

  • 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).
  • Instant Scaffolding: Generates a structured Yarn Workspaces monorepo.
  • Interactive File Explorer: Preview the generated code before you download.

🛠️ "Contract-First" Tooling

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): Uses ts-morph to 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.

📂 Project Anatomy

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

🚀 Getting Started

Developing HexaGen UI locally:

  1. Install dependencies: npm install
  2. Run development server: npm run dev
  3. Open http://localhost:9002.

Using the generated project:

  1. Add a feature to .architecture.yaml.
  2. Run yarn sync to generate the boilerplate interfaces.
  3. Implement the logic in the generated core and adapters files.
  4. Run yarn lint:arch to verify architectural integrity.

💻 Tech Stack

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages