# allmacht/domain-forge architecture

> Architecture diagram of the GitHub repository allmacht/domain-forge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/allmacht/domain-forge
- Repository: https://github.com/allmacht/domain-forge

## Overview

Domain Forge is a Laravel package that scaffolds DDD and hexagonal domain modules. Its principal workflow is an Artisan command that parses property definitions and delegates module creation to generators for domain and infrastructure artifacts; model and migration customization are optional. A separate install command creates the shared base structure. The graph reflects documented capabilities and indexed references; some generator internals were not excerpted, so their relationships are shown only where the orchestrator or README supports them.

Main entry points: [`src/Generators/ModuleGenerator.php`](https://github.com/allmacht/domain-forge/blob/main/src/Generators/ModuleGenerator.php) (Module orchestrator), [`src/Console/Commands/createModuleCommand.php`](https://github.com/allmacht/domain-forge/blob/main/src/Console/Commands/createModuleCommand.php) (Domain command), [`src/Providers/DomainForgeServiceProvider.php`](https://github.com/allmacht/domain-forge/blob/main/src/Providers/DomainForgeServiceProvider.php) (Package service provider), [`src/Support/PropertyParser.php`](https://github.com/allmacht/domain-forge/blob/main/src/Support/PropertyParser.php) (Property parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Artisan entry points"]
  node_install["Base installer<br/>[InstallCommand.php]"]
  node_create["Domain command"]
end

subgraph group_support["Property modeling"]
  node_parser["Property parser<br/>[PropertyParser.php]"]
  node_property["Property model<br/>[Property.php]"]
  node_idstrategy["ID strategy<br/>[IdStrategy.php]"]
end

subgraph group_domain["Domain generators"]
  node_directories["Directory structure"]
  node_entity["Entity generator"]
  node_valueobjects["Value object generator"]
  node_enums["Enum generator<br/>[EnumGenerator.php]"]
end

subgraph group_infrastructure["Infrastructure generators"]
  node_mapper["Mapper generator"]
  node_repository["Repository generator"]
  node_routes["Routes generator"]
  node_serviceprovider["Module provider generator"]
  node_migration["Migration generator"]
  node_model["Model customizer"]
end

subgraph group_package["Package integration"]
  node_module["Module orchestrator"]
  node_provider["Package service provider"]
  node_version["Package version<br/>[DomainForge.php]"]
end

node_artisan(("Laravel Artisan"))

node_artisan -->|"runs install"| node_install
node_artisan -->|"runs domain command"| node_create
node_create -->|"parses properties"| node_parser
node_create -->|"delegates generation"| node_module
node_parser -->|"builds properties"| node_property
node_parser -->|"selects ID strategy"| node_idstrategy
node_module -->|"creates structure"| node_directories
node_module -->|"generates enums"| node_enums
node_module -->|"generates value objects"| node_valueobjects
node_module -->|"generates entity"| node_entity
node_module -->|"generates mapper"| node_mapper
node_module -->|"generates repository"| node_repository
node_module -->|"generates routes"| node_routes
node_module -->|"generates provider"| node_serviceprovider
node_module -->|"optionally generates"| node_migration
node_module -->|"optionally customizes"| node_model
node_provider -->|"registers command"| node_create
node_provider -->|"registers command"| node_install
node_provider -->|"binds generator"| node_module

click node_install "https://github.com/allmacht/domain-forge/blob/main/src/Console/Commands/InstallCommand.php"
click node_create "https://github.com/allmacht/domain-forge/blob/main/src/Console/Commands/createModuleCommand.php"
click node_parser "https://github.com/allmacht/domain-forge/blob/main/src/Support/PropertyParser.php"
click node_property "https://github.com/allmacht/domain-forge/blob/main/src/Support/Property.php"
click node_idstrategy "https://github.com/allmacht/domain-forge/blob/main/src/Support/IdStrategy.php"
click node_module "https://github.com/allmacht/domain-forge/blob/main/src/Generators/ModuleGenerator.php"
click node_directories "https://github.com/allmacht/domain-forge/blob/main/src/Generators/DirectoryStructureGenerator.php"
click node_entity "https://github.com/allmacht/domain-forge/blob/main/src/Generators/EntityGenerator.php"
click node_valueobjects "https://github.com/allmacht/domain-forge/blob/main/src/Generators/ValueObjectGenerator.php"
click node_enums "https://github.com/allmacht/domain-forge/blob/main/src/Generators/EnumGenerator.php"
click node_mapper "https://github.com/allmacht/domain-forge/blob/main/src/Generators/MapperGenerator.php"
click node_repository "https://github.com/allmacht/domain-forge/blob/main/src/Generators/RepositoryGenerator.php"
click node_routes "https://github.com/allmacht/domain-forge/blob/main/src/Generators/RoutesGenerator.php"
click node_serviceprovider "https://github.com/allmacht/domain-forge/blob/main/src/Generators/ServiceProviderGenerator.php"
click node_migration "https://github.com/allmacht/domain-forge/blob/main/src/Generators/MigrationGenerator.php"
click node_model "https://github.com/allmacht/domain-forge/blob/main/src/Generators/ModelCustomizer.php"
click node_provider "https://github.com/allmacht/domain-forge/blob/main/src/Providers/DomainForgeServiceProvider.php"
click node_version "https://github.com/allmacht/domain-forge/blob/main/src/DomainForge.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_install,node_create toneBlue
class node_parser,node_property,node_idstrategy toneAmber
class node_directories,node_entity,node_valueobjects,node_enums toneMint
class node_mapper,node_repository,node_routes,node_serviceprovider,node_migration,node_model toneRose
class node_module,node_provider,node_version,node_artisan toneIndigo
```

## Components

### Artisan entry points

- [Base installer](https://github.com/allmacht/domain-forge/blob/main/src/Console/Commands/InstallCommand.php): `src/Console/Commands/InstallCommand.php`
- [Domain command](https://github.com/allmacht/domain-forge/blob/main/src/Console/Commands/createModuleCommand.php): `src/Console/Commands/createModuleCommand.php`

### Property modeling

- [Property parser](https://github.com/allmacht/domain-forge/blob/main/src/Support/PropertyParser.php): `src/Support/PropertyParser.php`
- [Property model](https://github.com/allmacht/domain-forge/blob/main/src/Support/Property.php): `src/Support/Property.php`
- [ID strategy](https://github.com/allmacht/domain-forge/blob/main/src/Support/IdStrategy.php): `src/Support/IdStrategy.php`

### Domain generators

- [Directory structure](https://github.com/allmacht/domain-forge/blob/main/src/Generators/DirectoryStructureGenerator.php): `src/Generators/DirectoryStructureGenerator.php`
- [Entity generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/EntityGenerator.php): `src/Generators/EntityGenerator.php`
- [Value object generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/ValueObjectGenerator.php): `src/Generators/ValueObjectGenerator.php`
- [Enum generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/EnumGenerator.php): `src/Generators/EnumGenerator.php`

### Infrastructure generators

- [Mapper generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/MapperGenerator.php): `src/Generators/MapperGenerator.php`
- [Repository generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/RepositoryGenerator.php): `src/Generators/RepositoryGenerator.php`
- [Routes generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/RoutesGenerator.php): `src/Generators/RoutesGenerator.php`
- [Module provider generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/ServiceProviderGenerator.php): `src/Generators/ServiceProviderGenerator.php`
- [Migration generator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/MigrationGenerator.php): `src/Generators/MigrationGenerator.php`
- [Model customizer](https://github.com/allmacht/domain-forge/blob/main/src/Generators/ModelCustomizer.php): `src/Generators/ModelCustomizer.php`

### Package integration

- [Module orchestrator](https://github.com/allmacht/domain-forge/blob/main/src/Generators/ModuleGenerator.php): `src/Generators/ModuleGenerator.php`
- [Package service provider](https://github.com/allmacht/domain-forge/blob/main/src/Providers/DomainForgeServiceProvider.php): `src/Providers/DomainForgeServiceProvider.php`
- [Package version](https://github.com/allmacht/domain-forge/blob/main/src/DomainForge.php): `src/DomainForge.php`

### Other components

- **Laravel Artisan**

## Connections

- Laravel Artisan → Base installer: runs install (evidence: `README.md`)
- Laravel Artisan → Domain command: runs domain command (evidence: `README.md`)
- Domain command → Property parser: parses properties (evidence: `src/Console/Commands/createModuleCommand.php`)
- Domain command → Module orchestrator: delegates generation (evidence: `src/Console/Commands/createModuleCommand.php`)
- Property parser → Property model: builds properties (evidence: `src/Support/PropertyParser.php`)
- Property parser → ID strategy: selects ID strategy (evidence: `src/Support/PropertyParser.php`)
- Module orchestrator → Directory structure: creates structure (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Enum generator: generates enums (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Value object generator: generates value objects (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Entity generator: generates entity (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Mapper generator: generates mapper (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Repository generator: generates repository (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Routes generator: generates routes (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Module provider generator: generates provider (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Migration generator: optionally generates (evidence: `src/Generators/ModuleGenerator.php`)
- Module orchestrator → Model customizer: optionally customizes (evidence: `src/Generators/ModuleGenerator.php`)
- Package service provider → Domain command: registers command (evidence: `src/Providers/DomainForgeServiceProvider.php`)
- Package service provider → Base installer: registers command (evidence: `src/Providers/DomainForgeServiceProvider.php`)
- Package service provider → Module orchestrator: binds generator (evidence: `src/Providers/DomainForgeServiceProvider.php`)
