# amanprojects-ops/phpstart architecture

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

- Interactive diagram: https://gitdiagram.com/amanprojects-ops/phpstart
- Repository: https://github.com/amanprojects-ops/phpstart

## Overview

PHPStart is a command-line project scaffolder. The main workflow parses a user command, dispatches it, selects a project-type scaffolder, and generates a project from stub files. The graph also includes the documented project-type catalog, version command, installer and backup-panel templates, and Laravel setup. Sampled source confirms core/API generation and shared template-writing behavior; MVC/Laravel implementation details and some command wiring are represented only at the documented or directory level.

Main entry points: [`src/Commands/NewCommand.php`](https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/NewCommand.php) (New project), [`src/Application.php`](https://github.com/amanprojects-ops/phpstart/blob/main/src/Application.php) (Command router), [`src/Scaffolders/BaseScaffolder.php`](https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/BaseScaffolder.php) (Scaffold helpers), [`src/Console/Output.php`](https://github.com/amanprojects-ops/phpstart/blob/main/src/Console/Output.php) (Console output)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_entry["CLI entry"]
  node_input["Argument parser<br/>[Input.php]"]
  node_application["Command router<br/>[Application.php]"]
  node_new["New project<br/>[NewCommand.php]"]
  node_list["Type catalog<br/>[ListCommand.php]"]
  node_help["Help command<br/>[HelpCommand.php]"]
  node_version["Version command<br/>[VersionCommand.php]"]
  node_output["Console output<br/>[Output.php]"]
end

subgraph group_generation["Project generation"]
  node_core["Core scaffolder"]
  node_mvc["MVC scaffolder<br/>[MvcScaffolder.php]"]
  node_api["API scaffolder<br/>[ApiScaffolder.php]"]
  node_laravel["Laravel setup"]
  node_base["Scaffold helpers<br/>[BaseScaffolder.php]"]
  node_project["Generated project"]
end

subgraph group_templates["Project templates"]
  node_corestubs["Core templates"]
  node_apistubs["API templates"]
  node_mvcstubs["MVC templates"]
  node_commonstubs["Installer and backup"]
end

node_user(("CLI user"))
node_composer["Composer service"]
node_versionfiles["Version metadata<br/>[composer.json]"]

node_user -->|"runs command"| node_entry
node_entry -->|"starts"| node_application
node_application -->|"reads arguments"| node_input
node_application -->|"dispatches"| node_new
node_application -->|"dispatches"| node_list
node_application -->|"dispatches"| node_help
node_application -->|"dispatches"| node_version
node_new -->|"reads options"| node_input
node_new -->|"selects core"| node_core
node_new -->|"selects MVC"| node_mvc
node_new -->|"selects API"| node_api
node_new -->|"selects Laravel"| node_laravel
node_new -->|"reports progress"| node_output
node_core -->|"uses helpers"| node_base
node_api -->|"uses helpers"| node_base
node_base -->|"loads templates"| node_corestubs
node_base -->|"loads templates"| node_apistubs
node_base -->|"loads templates"| node_mvcstubs
node_base -->|"loads templates"| node_commonstubs
node_core -->|"generates"| node_project
node_mvc -->|"generates"| node_project
node_api -->|"generates"| node_project
node_laravel -->|"sets up"| node_project
node_laravel -.->|"runs setup"| node_composer
node_version -->|"updates metadata"| node_versionfiles
node_version -->|"prints version"| node_output
node_list -->|"prints types"| node_output
node_help -->|"prints help"| node_output

click node_entry "https://github.com/amanprojects-ops/phpstart/blob/main/bin/phpstart"
click node_input "https://github.com/amanprojects-ops/phpstart/blob/main/src/Console/Input.php"
click node_application "https://github.com/amanprojects-ops/phpstart/blob/main/src/Application.php"
click node_new "https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/NewCommand.php"
click node_list "https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/ListCommand.php"
click node_help "https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/HelpCommand.php"
click node_version "https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/VersionCommand.php"
click node_output "https://github.com/amanprojects-ops/phpstart/blob/main/src/Console/Output.php"
click node_core "https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/CorePhpScaffolder.php"
click node_mvc "https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/MvcScaffolder.php"
click node_api "https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/ApiScaffolder.php"
click node_laravel "https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/LaravelScaffolder.php"
click node_base "https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/BaseScaffolder.php"
click node_corestubs "https://github.com/amanprojects-ops/phpstart/tree/main/stubs/core"
click node_apistubs "https://github.com/amanprojects-ops/phpstart/tree/main/stubs/api"
click node_mvcstubs "https://github.com/amanprojects-ops/phpstart/tree/main/stubs/mvc"
click node_commonstubs "https://github.com/amanprojects-ops/phpstart/tree/main/stubs/common"
click node_versionfiles "https://github.com/amanprojects-ops/phpstart/blob/main/composer.json"

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_entry,node_input,node_application,node_new,node_list,node_help,node_version,node_output,node_user toneBlue
class node_core,node_mvc,node_api,node_laravel,node_base,node_project toneAmber
class node_corestubs,node_apistubs,node_mvcstubs,node_commonstubs toneMint
class node_composer toneIndigo
class node_versionfiles toneTeal
```

## Components

### CLI commands

- [CLI entry](https://github.com/amanprojects-ops/phpstart/blob/main/bin/phpstart): `bin/phpstart`
- [Argument parser](https://github.com/amanprojects-ops/phpstart/blob/main/src/Console/Input.php): `src/Console/Input.php`
- [Command router](https://github.com/amanprojects-ops/phpstart/blob/main/src/Application.php): `src/Application.php`
- [New project](https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/NewCommand.php): `src/Commands/NewCommand.php`
- [Type catalog](https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/ListCommand.php): `src/Commands/ListCommand.php`
- [Help command](https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/HelpCommand.php): `src/Commands/HelpCommand.php`
- [Version command](https://github.com/amanprojects-ops/phpstart/blob/main/src/Commands/VersionCommand.php): `src/Commands/VersionCommand.php`
- [Console output](https://github.com/amanprojects-ops/phpstart/blob/main/src/Console/Output.php): `src/Console/Output.php`

### Project generation

- [Core scaffolder](https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/CorePhpScaffolder.php): `src/Scaffolders/CorePhpScaffolder.php`
- [MVC scaffolder](https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/MvcScaffolder.php): `src/Scaffolders/MvcScaffolder.php`
- [API scaffolder](https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/ApiScaffolder.php): `src/Scaffolders/ApiScaffolder.php`
- [Laravel setup](https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/LaravelScaffolder.php): `src/Scaffolders/LaravelScaffolder.php`
- [Scaffold helpers](https://github.com/amanprojects-ops/phpstart/blob/main/src/Scaffolders/BaseScaffolder.php): `src/Scaffolders/BaseScaffolder.php`
- **Generated project**

### Project templates

- [Core templates](https://github.com/amanprojects-ops/phpstart/tree/main/stubs/core): `stubs/core`
- [API templates](https://github.com/amanprojects-ops/phpstart/tree/main/stubs/api): `stubs/api`
- [MVC templates](https://github.com/amanprojects-ops/phpstart/tree/main/stubs/mvc): `stubs/mvc`
- [Installer and backup](https://github.com/amanprojects-ops/phpstart/tree/main/stubs/common): `stubs/common`

### Other components

- **CLI user**
- **Composer service**
- [Version metadata](https://github.com/amanprojects-ops/phpstart/blob/main/composer.json): `composer.json`

## Connections

- CLI user → CLI entry: runs command
- CLI entry → Command router: starts
- Command router → Argument parser: reads arguments
- Command router → New project: dispatches
- Command router → Type catalog: dispatches
- Command router → Help command: dispatches
- Command router → Version command: dispatches
- New project → Argument parser: reads options
- New project → Core scaffolder: selects core
- New project → MVC scaffolder: selects MVC
- New project → API scaffolder: selects API
- New project → Laravel setup: selects Laravel
- New project → Console output: reports progress
- Core scaffolder → Scaffold helpers: uses helpers
- API scaffolder → Scaffold helpers: uses helpers
- Scaffold helpers → Core templates: loads templates
- Scaffold helpers → API templates: loads templates
- Scaffold helpers → MVC templates: loads templates
- Scaffold helpers → Installer and backup: loads templates
- Core scaffolder → Generated project: generates
- MVC scaffolder → Generated project: generates
- API scaffolder → Generated project: generates
- Laravel setup → Generated project: sets up
- Laravel setup → Composer service: runs setup
- Version command → Version metadata: updates metadata
- Version command → Console output: prints version
- Type catalog → Console output: prints types
- Help command → Console output: prints help
