koriym/app-state-diagram
Composer 安装命令:
composer require koriym/app-state-diagram
包简介
An Application Diagram Generator
README 文档
README
app-state-diagram is a tool that visualizes state transitions and information structures of RESTful applications. It generates interactive state diagrams and hyperlinked documentation from ALPS (Application-Level Profile Semantics) profiles written in XML or JSON.
Key Benefits
- Application Overview: Visually grasp complex RESTful applications and understand the big picture
- Clear Information Semantics: See how data flows and what each element means
- Enhanced Team Communication: Both technical and business teams can discuss using the same visual representation
- Design Consistency: Represent application structures uniformly and discover design issues early
Quick Start
Online Editor (No Installation)
https://editor.app-state-diagram.com/
Install with Homebrew (Recommended)
brew install alps-asd/asd/asd
Auto-updates with brew upgrade.
Install with npm
npm install -g @alps-asd/app-state-diagram
Try It
curl -O https://raw.githubusercontent.com/alps-asd/app-state-diagram/2.x/docs/demo/bookstore/alps.xml
asd alps.xml
open index.html # on macOS
CLI Options
asd [options] <profile.json|profile.xml>
| Option | Description |
|---|---|
-o, --output <file> |
Output file path |
-f, --format <format> |
Output format: html (default), svg, dot, mermaid |
-w, --watch |
Watch mode with live reload |
--port <port> |
CDP port for watch mode (default: 9222) |
--label <mode> |
Label mode: id (default) or title |
--validate |
Validate ALPS profile only |
-e, --echo |
Output to stdout |
Subcommands
asd merge <base.json> <partial.json> # Merge partial ALPS into base profile
Watch Mode
Start watch mode with automatic Chrome launch and live reload:
asd -w profile.json
Chrome opens automatically with remote debugging enabled. Changes to the ALPS file trigger instant browser refresh.
Validation
The validator checks for errors, warnings, and suggestions:
- Errors (E001-E011) - Missing id/href, missing rt, invalid type, broken references, duplicate ids, etc.
- Warnings (W001-W004) - Missing title, naming conventions (go*/do* prefixes), orphan descriptors
- Suggestions (S001-S003) - Consider adding doc/title to improve documentation
See Validation Issues Reference for detailed explanations and how to fix each issue.
asd profile.json --validate
Examples
See live demos or visit app-state-diagram.com
Mock Generation
Generate a browsable HTML mock site from an ALPS profile. Every CSS class in the HTML is an ALPS descriptor ID — zero presentation classes. Switch between bare HTML, wireframe, and production quality by changing one CSS file.
alps.xml → html/ + css/level{1,2,3}.css + api/ + i18n/
See AI Integration Guide for setup (requires alps2mock skill).
Design Application with AI
This repository includes .mcp.json for MCP clients. It starts the ALPS MCP server with:
{
"command": "npx",
"args": ["-y", "@alps-asd/mcp"]
}
See AI Integration Guide and MCP Server README for Claude Code, Claude Desktop, and other AI tools.
Documentation
Related Projects
- ALPS Specification
- asd-action - GitHub Action for CI/CD
- alps-skills - ALPS skills for Claude Code
- alps-skeleton-xml - ALPS skeleton (XML)
- alps-skeleton-json - ALPS skeleton (JSON)
License
MIT
koriym/app-state-diagram 适用场景与选型建议
koriym/app-state-diagram 是一款 基于 TypeScript 开发的 Composer 扩展包,目前已累计 243.36k 次下载、GitHub Stars 达 39, 最近一次更新时间为 2019 年 12 月 19 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 koriym/app-state-diagram 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 koriym/app-state-diagram 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 243.36k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 39
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-12-19