PHPackages                             tourze/architecture-diagram-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tourze/architecture-diagram-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

tourze/architecture-diagram-bundle
==================================

自动生成 Symfony 项目架构图的 Bundle

0.0.3(5mo ago)00proprietaryPHPPHP ^8.2CI passing

Since Nov 13Pushed 4mo agoCompare

[ Source](https://github.com/tourze/architecture-diagram-bundle)[ Packagist](https://packagist.org/packages/tourze/architecture-diagram-bundle)[ RSS](/packages/tourze-architecture-diagram-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (17)Versions (4)Used By (0)

Architecture Diagram Bundle
===========================

[](#architecture-diagram-bundle)

[English](README.md) | [中文](README.zh-CN.md)

自动生成 Symfony 项目架构图的 Bundle，基于 C4 Model 规范输出 PlantUML 格式。

功能特性
----

[](#功能特性)

- 🔍 **自动扫描**：扫描项目中的 Controller、Entity、Repository、Service
- 📊 **C4 Model**：生成符合 C4 Model 规范的架构图
- 🎨 **PlantUML**：输出标准 PlantUML 格式，可直接渲染
- 📈 **统计信息**：显示组件数量、类型分布、层级分布
- 🔧 **灵活配置**：支持多种输出选项

安装
--

[](#安装)

```
composer require tourze/architecture-diagram-bundle
```

使用方法
----

[](#使用方法)

### 基础用法

[](#基础用法)

生成项目架构图：

```
php bin/console app:generate-architecture-diagram projects/symfony-easy-admin-demo
```

### 增强架构图生成（推荐）

[](#增强架构图生成推荐)

生成包含基础设施、外部系统、数据流和安全措施的增强架构图：

```
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo
```

增强版本包括：

- 🏗️ 基础设施组件（数据库、缓存、消息队列等）
- 🌐 外部系统集成（支付网关、短信服务等）
- 📊 数据流分析（组件间数据传输）
- 🔒 安全措施（防火墙、SSL、认证等）

### 指定输出文件

[](#指定输出文件)

```
php bin/console app:generate-architecture-diagram projects/symfony-easy-admin-demo -o architecture.puml
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --output-dir ./diagrams
```

### 显示统计信息

[](#显示统计信息)

```
php bin/console app:generate-architecture-diagram projects/symfony-easy-admin-demo --show-stats
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --show-stats
```

### 生成简单格式（非C4）

[](#生成简单格式非c4)

```
php bin/console app:generate-architecture-diagram projects/symfony-easy-admin-demo --no-c4
```

### 不按层分组

[](#不按层分组)

```
php bin/console app:generate-architecture-diagram projects/symfony-easy-admin-demo --no-layers
```

### 生成不同类型的架构图（增强版）

[](#生成不同类型的架构图增强版)

```
# 系统概览图
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --type overview

# 组件图
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --type component

# 部署图
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --type deployment

# 时序图
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --type sequence

# 所有类型（默认）
php bin/console app:generate-enhanced-architecture projects/symfony-easy-admin-demo --type all
```

命令选项
----

[](#命令选项)

### app:generate-architecture-diagram

[](#appgenerate-architecture-diagram)

选项简写说明默认值--output-o输出文件路径控制台输出--format-f输出格式plantuml--level-lC4层级 (context/container/component/code)component--no-c4不使用C4 Model格式false--no-layers不按层分组false--show-stats显示架构统计信息false### app:generate-enhanced-architecture

[](#appgenerate-enhanced-architecture)

选项简写说明默认值--type-t架构图类型 (overview/component/deployment/sequence/all)all--output-dir-o输出目录路径项目路径--show-stats显示架构统计信息false架构层级
----

[](#架构层级)

系统按照以下层级组织组件：

- **Presentation Layer（展示层）**：Controller、Command、Form
- **Application Layer（应用层）**：Service、Handler、Manager
- **Domain Layer（领域层）**：Entity、Model、ValueObject
- **Infrastructure Layer（基础设施层）**：Repository、Gateway、Adapter

查看生成的图表
-------

[](#查看生成的图表)

### 在线查看

[](#在线查看)

将生成的 PlantUML 代码复制到在线编辑器：

### 本地查看

[](#本地查看)

如果已安装 PlantUML：

```
plantuml architecture.puml
```

示例输出
----

[](#示例输出)

```
@startuml
!include https://raw.githubusercontent.com/plantuml-stdlib/C4-PlantUML/master/C4_Component.puml

Container_Boundary(app, "Application") {
    Container_Boundary(presentation, "Presentation Layer") {
        Component(controller_user, "UserController", "Symfony Controller", "...")
    }
    Container_Boundary(domain, "Domain Layer") {
        Component(entity_user, "User", "Doctrine ORM", "...")
    }
}

Rel(controller_user, entity_user, "Uses")
@enduml
```

扩展功能（计划中）
---------

[](#扩展功能计划中)

- 支持扫描 Bundle 依赖关系
- 支持自定义组件类型
- 支持导出 SVG/PNG 格式
- 支持 Monorepo 多项目联合分析
- 支持依赖注入关系自动推断

许可证
---

[](#许可证)

Proprietary

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance72

Regular maintenance activity

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e354fdb316da535dfa8ba2e9193a473c403b6bc6fb9170778d1dc50e304c6e9d?d=identicon)[tourze](/maintainers/tourze)

---

Top Contributors

[![tourze](https://avatars.githubusercontent.com/u/13899502?v=4)](https://github.com/tourze "tourze (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/tourze-architecture-diagram-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tourze-architecture-diagram-bundle/health.svg)](https://phpackages.com/packages/tourze-architecture-diagram-bundle)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[symfony/maker-bundle

Symfony Maker helps you create empty commands, controllers, form classes, tests and more so you can forget about writing boilerplate code.

3.4k111.1M568](/packages/symfony-maker-bundle)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
