Enterprise Architecture Engine — A CLI tool that turns software architecture into executable, validated code.
ArchForge X helps you:
- Generate production-ready Node.js projects with proper architecture (Express or NestJS)
- Validate that your code follows architectural rules (layer boundaries)
- Audit existing code for violations and get fix suggestions
- Visualize your project's dependency graph
# Install globally
npm install -g archforge-x
# Or install in your project
npm install --save-dev archforge-x
# Verify it works
archforge --versionarchforge initThe wizard will ask you:
- Project name
- Framework: Express or NestJS
- Architecture: Clean, DDD, or Layered
- ORM: Prisma, TypeORM, or none
- Database: PostgreSQL, MySQL, SQLite
- Include authentication module? (yes/no)
# NestJS with Clean Architecture and Prisma
archforge generate --framework nestjs --architecture clean --orm prisma
# Express with DDD and TypeORM
archforge generate --framework express --architecture ddd --orm typeormmy-project/
├── src/
│ ├── domain/ # Entities, repository interfaces
│ ├── application/ # Use cases, DTOs
│ ├── infrastructure/ # Database, external services
│ └── interfaces/ # Controllers, routes
├── prisma/ # (if using Prisma)
│ └── schema.prisma
├── .env # Environment variables
├── .env.example
├── Dockerfile
├── docker-compose.yml
├── .github/
│ └── workflows/ci.yml # GitHub Actions CI
├── archforge.yaml # Architecture definition
├── package.json
└── README.md # Project documentation
ArchForge uses a YAML config file (archforge.yaml) to define your architecture:
version: "1.0"
project:
name: "my-api"
layers:
- name: "domain"
path: "src/domain"
canImport: [] # Domain has no dependencies
- name: "application"
path: "src/application"
canImport: ["domain"] # Can only import domain
- name: "infrastructure"
path: "src/infrastructure"
canImport: ["domain", "application"]
- name: "interfaces"
path: "src/interfaces"
canImport: ["domain", "application"]
rules:
enforceLayerBoundaries: trueCheck if your code follows the rules:
archforge validateIf everything is correct:
✅ Architecture validation passed!
Layers: 4
Files: 47
Violations: 0
If there's a violation:
❌ Violation in src/domain/user.entity.ts:15
Domain layer imports from Infrastructure
archforge auditThe audit command gives you intelligent suggestions:
💡 Fix Suggestion (Dependency Inversion):
1. Define an interface in Domain (IUserRepository)
2. Implement it in Infrastructure
3. Inject via constructor
archforge graph --output architecture.svgGenerates an SVG diagram showing layer relationships.
| Command | What It Does |
|---|---|
archforge init |
Interactive wizard to create a project |
archforge generate |
Generate project from config |
archforge validate |
Check for architecture violations |
archforge audit |
Deep scan with fix suggestions |
archforge graph |
Generate dependency graph |
archforge sync |
Sync config with existing code |
| Framework | Architectures | ORMs | Databases |
|---|---|---|---|
| Express | Clean, DDD, Layered | Prisma, TypeORM | PostgreSQL, MySQL, SQLite |
| NestJS | Clean, DDD, Layered | Prisma, TypeORM | PostgreSQL, MySQL, SQLite |
Add validation to your pipeline:
# .github/workflows/ci.yml
- name: Check Architecture
run: npx archforge validategit clone https://github.com/Henabakos/archforge-x.git
cd archforge-x
npm install
npm test
npm run buildMIT