# emirustaoglu/artisan architecture

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

- Interactive diagram: https://gitdiagram.com/emirustaoglu/artisan
- Repository: https://github.com/emirustaoglu/artisan

## Overview

Artisan is a PHP command-line toolkit for non-Laravel projects: developers invoke a generated project-level `artisan` proxy, which dispatches commands for database changes, scaffolding, and serving a development project. Migration and seed commands delegate to separate managers and database appliers; scaffolding and server dispatch are handled by the CLI class. The README documents view, controller, middleware, model, enum, migration, and seed generation. The CLI excerpt is partial, so undocumented command wiring and details of several generators are not inferred.

Main entry points: [`src/artisan.php`](https://github.com/emirustaoglu/artisan/blob/main/src/artisan.php) (Command dispatcher), [`src/databases/MigrationManager.php`](https://github.com/emirustaoglu/artisan/blob/main/src/databases/MigrationManager.php) (Migration manager), [`src/databases/Migration.php`](https://github.com/emirustaoglu/artisan/blob/main/src/databases/Migration.php) (Migration applier), [`src/databases/SeedsManager.php`](https://github.com/emirustaoglu/artisan/blob/main/src/databases/SeedsManager.php) (Seed manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command interface"]
  node_cli["Command dispatcher<br/>[artisan.php]"]
end

subgraph group_database["Database operations"]
  node_migration_manager["Migration manager"]
  node_migration_runner["Migration applier<br/>[Migration.php]"]
  node_seed_manager["Seed manager<br/>[SeedsManager.php]"]
  node_seed_runner["Seed applier<br/>[Seeds.php]"]
end

subgraph group_scaffold["Setup and scaffolding"]
  node_generator["Scaffold generators<br/>[artisan.php]"]
  node_templates["Scaffold templates"]
  node_installer["Proxy installer<br/>[FirstInstall.php]"]
end

node_developer(("Developer"))
node_proxy["Project artisan proxy"]
node_mysql[("MySQL database")]
node_project_files["Generated project files"]
node_php_server["PHP development server"]
node_project["Project public directory"]

node_developer -->|"runs command"| node_proxy
node_proxy -->|"calls"| node_cli
node_cli -->|"dispatches migrate"| node_migration_manager
node_migration_manager -->|"applies files"| node_migration_runner
node_migration_runner -->|"executes SQL"| node_mysql
node_cli -->|"dispatches seeds"| node_seed_manager
node_seed_manager -->|"applies files"| node_seed_runner
node_seed_runner -->|"executes SQL"| node_mysql
node_cli -->|"dispatches make"| node_generator
node_generator -->|"reads templates"| node_templates
node_generator -->|"writes scaffolds"| node_project_files
node_developer -->|"requests setup"| node_installer
node_installer -->|"creates proxy"| node_proxy
node_cli -->|"starts server"| node_php_server
node_php_server -->|"serves files"| node_project

click node_cli "https://github.com/emirustaoglu/artisan/blob/main/src/artisan.php"
click node_migration_manager "https://github.com/emirustaoglu/artisan/blob/main/src/databases/MigrationManager.php"
click node_migration_runner "https://github.com/emirustaoglu/artisan/blob/main/src/databases/Migration.php"
click node_seed_manager "https://github.com/emirustaoglu/artisan/blob/main/src/databases/SeedsManager.php"
click node_seed_runner "https://github.com/emirustaoglu/artisan/blob/main/src/databases/Seeds.php"
click node_generator "https://github.com/emirustaoglu/artisan/blob/main/src/artisan.php"
click node_templates "https://github.com/emirustaoglu/artisan/tree/main/src/temp"
click node_installer "https://github.com/emirustaoglu/artisan/blob/main/src/install/FirstInstall.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_cli toneBlue
class node_migration_manager,node_migration_runner,node_seed_manager,node_seed_runner,node_mysql toneAmber
class node_generator,node_templates,node_installer,node_php_server toneMint
class node_developer,node_proxy,node_project_files,node_project toneIndigo
```

## Components

### Command interface

- [Command dispatcher](https://github.com/emirustaoglu/artisan/blob/main/src/artisan.php): `src/artisan.php`

### Database operations

- [Migration manager](https://github.com/emirustaoglu/artisan/blob/main/src/databases/MigrationManager.php): `src/databases/MigrationManager.php`
- [Migration applier](https://github.com/emirustaoglu/artisan/blob/main/src/databases/Migration.php): `src/databases/Migration.php`
- [Seed manager](https://github.com/emirustaoglu/artisan/blob/main/src/databases/SeedsManager.php): `src/databases/SeedsManager.php`
- [Seed applier](https://github.com/emirustaoglu/artisan/blob/main/src/databases/Seeds.php): `src/databases/Seeds.php`

### Setup and scaffolding

- [Scaffold generators](https://github.com/emirustaoglu/artisan/blob/main/src/artisan.php): `src/artisan.php`
- [Scaffold templates](https://github.com/emirustaoglu/artisan/tree/main/src/temp): `src/temp`
- [Proxy installer](https://github.com/emirustaoglu/artisan/blob/main/src/install/FirstInstall.php): `src/install/FirstInstall.php`

### Other components

- **Developer**
- **Project artisan proxy**
- **MySQL database**
- **Generated project files**
- **PHP development server**
- **Project public directory**

## Connections

- Developer → Project artisan proxy: runs command
- Project artisan proxy → Command dispatcher: calls
- Command dispatcher → Migration manager: dispatches migrate
- Migration manager → Migration applier: applies files
- Migration applier → MySQL database: executes SQL
- Command dispatcher → Seed manager: dispatches seeds
- Seed manager → Seed applier: applies files
- Seed applier → MySQL database: executes SQL
- Command dispatcher → Scaffold generators: dispatches make
- Scaffold generators → Scaffold templates: reads templates
- Scaffold generators → Generated project files: writes scaffolds
- Developer → Proxy installer: requests setup
- Proxy installer → Project artisan proxy: creates proxy
- Command dispatcher → PHP development server: starts server
- PHP development server → Project public directory: serves files
