# ph-7/ph7webappboilerplate architecture

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

- Interactive diagram: https://gitdiagram.com/ph-7/ph7webappboilerplate
- Repository: https://github.com/ph-7/ph7webappboilerplate

## Overview

This is an archived Silex/Twig PHP web-app boilerplate, not a domain-specific application. Its runtime workflow is: a web entry point creates the app, loads environment settings and bootstrap services, registers routes, and runs Silex; the home route invokes a controller that renders the index template. Bootstrap also configures Twig, assets, and error rendering. README-listed Symfony capabilities are dependency offerings rather than demonstrated application workflows; source excerpts do not show them being used. The graph reflects only shown wiring and documented framework capabilities.

Main entry points: [`app/bootstrap.php`](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php) (Service bootstrap), [`web/index.php`](https://github.com/ph-7/ph7webappboilerplate/blob/master/web/index.php) (Production entry), [`web/index_dev.php`](https://github.com/ph-7/ph7webappboilerplate/blob/master/web/index_dev.php) (Development entry), [`app/routes.php`](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/routes.php) (Home route)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Web runtime"]
  node_prod_entry["Production entry<br/>[index.php]"]
  node_dev_entry["Development entry<br/>[index_dev.php]"]
  node_env_config["Environment config"]
  node_route_map["Home route<br/>[routes.php]"]
  node_controller["Home controller<br/>[MainController.php]"]
end

subgraph group_services["App services"]
  node_bootstrap["Service bootstrap<br/>[bootstrap.php]"]
  node_twig["Twig rendering<br/>[bootstrap.php]"]
  node_assets["Asset service<br/>[bootstrap.php]"]
  node_doctrine["Doctrine provider<br/>[bootstrap.php]"]
end

subgraph group_presentation["Views and errors"]
  node_index_view["Home view<br/>[index.twig]"]
  node_layout_view["Shared layout<br/>[layout.twig]"]
  node_error_handler["Error rendering<br/>[bootstrap.php]"]
  node_error_view["Error view<br/>[error.twig]"]
end

subgraph group_capabilities["Framework capabilities"]
  node_framework_libs["Symfony capabilities<br/>[composer.json]"]
end

node_browser(("Web client"))

node_browser -->|"requests"| node_prod_entry
node_prod_entry -->|"loads environment"| node_env_config
node_prod_entry -->|"loads services"| node_bootstrap
node_prod_entry -->|"loads routes"| node_route_map
node_prod_entry -->|"runs app"| node_browser
node_dev_entry -->|"loads dev config"| node_env_config
node_dev_entry -->|"loads services"| node_bootstrap
node_dev_entry -->|"loads routes"| node_route_map
node_dev_entry -->|"runs app"| node_browser
node_route_map -->|"routes home"| node_controller
node_controller -->|"renders template"| node_twig
node_twig -.->|"renders"| node_index_view
node_bootstrap -->|"registers"| node_twig
node_bootstrap -->|"registers"| node_assets
node_bootstrap -->|"registers"| node_doctrine
node_bootstrap -->|"registers errors"| node_error_handler
node_error_handler -->|"renders error"| node_twig
node_error_handler -->|"selects template"| node_error_view

click node_prod_entry "https://github.com/ph-7/ph7webappboilerplate/blob/master/web/index.php"
click node_dev_entry "https://github.com/ph-7/ph7webappboilerplate/blob/master/web/index_dev.php"
click node_env_config "https://github.com/ph-7/ph7webappboilerplate/tree/master/app/config"
click node_route_map "https://github.com/ph-7/ph7webappboilerplate/blob/master/app/routes.php"
click node_controller "https://github.com/ph-7/ph7webappboilerplate/blob/master/src/Controller/MainController.php"
click node_bootstrap "https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php"
click node_twig "https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php"
click node_assets "https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php"
click node_doctrine "https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php"
click node_index_view "https://github.com/ph-7/ph7webappboilerplate/blob/master/views/index.twig"
click node_layout_view "https://github.com/ph-7/ph7webappboilerplate/blob/master/views/layout.twig"
click node_error_handler "https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php"
click node_error_view "https://github.com/ph-7/ph7webappboilerplate/blob/master/views/error.twig"
click node_framework_libs "https://github.com/ph-7/ph7webappboilerplate/blob/master/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_prod_entry,node_dev_entry,node_env_config,node_route_map,node_controller,node_browser toneBlue
class node_bootstrap,node_twig,node_assets,node_doctrine toneAmber
class node_index_view,node_layout_view,node_error_handler,node_error_view toneMint
class node_framework_libs toneRose
```

## Components

### Web runtime

- [Production entry](https://github.com/ph-7/ph7webappboilerplate/blob/master/web/index.php): `web/index.php`
- [Development entry](https://github.com/ph-7/ph7webappboilerplate/blob/master/web/index_dev.php): `web/index_dev.php`
- [Environment config](https://github.com/ph-7/ph7webappboilerplate/tree/master/app/config): `app/config`
- [Home route](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/routes.php): `app/routes.php`
- [Home controller](https://github.com/ph-7/ph7webappboilerplate/blob/master/src/Controller/MainController.php): `src/Controller/MainController.php`

### App services

- [Service bootstrap](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php): `app/bootstrap.php`
- [Twig rendering](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php): `app/bootstrap.php`
- [Asset service](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php): `app/bootstrap.php`
- [Doctrine provider](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php): `app/bootstrap.php`

### Views and errors

- [Home view](https://github.com/ph-7/ph7webappboilerplate/blob/master/views/index.twig): `views/index.twig`
- [Shared layout](https://github.com/ph-7/ph7webappboilerplate/blob/master/views/layout.twig): `views/layout.twig`
- [Error rendering](https://github.com/ph-7/ph7webappboilerplate/blob/master/app/bootstrap.php): `app/bootstrap.php`
- [Error view](https://github.com/ph-7/ph7webappboilerplate/blob/master/views/error.twig): `views/error.twig`

### Framework capabilities

- [Symfony capabilities](https://github.com/ph-7/ph7webappboilerplate/blob/master/composer.json): `composer.json`

### Other components

- **Web client**

## Connections

- Web client → Production entry: requests
- Production entry → Environment config: loads environment (evidence: `web/index.php`)
- Production entry → Service bootstrap: loads services (evidence: `web/index.php`)
- Production entry → Home route: loads routes (evidence: `web/index.php`)
- Production entry → Web client: runs app (evidence: `web/index.php`)
- Development entry → Environment config: loads dev config (evidence: `web/index_dev.php`)
- Development entry → Service bootstrap: loads services (evidence: `web/index_dev.php`)
- Development entry → Home route: loads routes (evidence: `web/index_dev.php`)
- Development entry → Web client: runs app (evidence: `web/index_dev.php`)
- Home route → Home controller: routes home (evidence: `app/routes.php`)
- Home controller → Twig rendering: renders template (evidence: `src/Controller/MainController.php`)
- Twig rendering → Home view: renders
- Service bootstrap → Twig rendering: registers (evidence: `app/bootstrap.php`)
- Service bootstrap → Asset service: registers (evidence: `app/bootstrap.php`)
- Service bootstrap → Doctrine provider: registers (evidence: `app/bootstrap.php`)
- Service bootstrap → Error rendering: registers errors (evidence: `app/bootstrap.php`)
- Error rendering → Twig rendering: renders error (evidence: `app/bootstrap.php`)
- Error rendering → Error view: selects template (evidence: `app/bootstrap.php`)
