koriym / app-state-diagram
An Application Diagram Generator
Installs: 129 760
Dependents: 1
Suggesters: 0
Security: 0
Stars: 32
Watchers: 7
Forks: 10
Open Issues: 1
Requires
- php: ^8.1
- ext-dom: *
- ext-filter: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- koriym/data-file: ^1.0
- michelf/php-markdown: ^1.9
- seld/jsonlint: ^1.8
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.4
- phpunit/phpunit: ^9.6.10
- rector/rector: ^1.1
- dev-master
- 0.11.10
- 0.11.9
- 0.11.8
- 0.11.7
- 0.11.6
- 0.11.5
- 0.11.4
- 0.11.3
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.4
- 0.10.3
- 0.10.2
- 0.10.1
- 0.10.0
- 0.9.8
- 0.9.7
- 0.9.6
- 0.9.5
- 0.9.4
- 0.9.3
- 0.9.2
- 0.9.1
- 0.9.0
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.1
- 0.5.0
- 0.4.2
- 0.4.1
- 0.4.0
- 0.3.6
- 0.3.5
- 0.3.4
- 0.3.3
- 0.3.2
- 0.3.1
- 0.3.0
- 0.2.0
- 0.1.3
- 0.1.2
- 0.1.1
- 0.1.0
- dev-xsd
- dev-better-xsd
This package is auto-updated.
Last update: 2024-10-23 02:45:14 UTC
README
Produces a full application state diagram and hyperlinked documentation from ALPS file.
The diagram is hypermedia in SVG format with application states and state transitions linked to the respective semantic descriptor document HTML. The semantic descriptor document HTML is also linked to each other to represent the structure of the REST application.
Documentation
Output Demo
See online demo.
Run
There are three ways to run it: Run locally, Run with docker, and Git Hub Action.
Run with GitHub action
You can try ASD in a minute without installing any tools.
- Click Use this template in alps-skeleton site to create ALPS skeleton. Please make the repository public for GitHub Pages.
- Configuring a publishing source for your GitHub Pages site. Choose
gh-pages
and/(root)
for the source. - Each time you commit, ASD diagram and hyper linked document will be generated in
https://{user}.github.io/{repository}/
.
Run with Docker
This is the most standard way.
curl -L https://alps-asd.github.io/app-state-diagram/asd.sh > ./asd && chmod +x ./asd && sudo mv ./asd /usr/local/bin
Run demo
Perform the following steps and open http://localhost:3000
mkdir work
curl -L curl https://alps-asd.github.io/app-state-diagram/blog/profile.json > work/profile.json
asd --watch ./work/profile.json
ASD documen appeared? Congratulations! Press the star in this repository to celebrate. 🌟
Usage
asd [options] [alpsFile]
-c, --config=asd.xml
Path to a asd.xml configuration file
-w, --watch
Watch mode
-m, --mode={markdown|html}
Output format
--port
Port number used in watch mode
- Supports XML and JSON formats.
- If you run it without the arguments,
asd.xml
config file in the same folder is used.
Run locally
This method is currently mainly for developers. It is tedious and time consuming.
Requirement
You can check with the following command.
% php -v
PHP 8.0.6 (cli) (built: May 8 2021 01:58:51) ( NTS )
% composer -V
Composer version 2.0.13 2021-04-27 13:11:08
% npm -v
7.17.0
Installation
composer global require koriym/app-state-diagram
Update
composer global update koriym/app-state-diagram
Usage
composer global exec asd -- [options] [alpsFile]
The options are the same as for the Docker version.
Configuration
ASD uses an XML config file (by default, asd.xml). A barebones example looks like this:
<?xml version="1.0"?> <asd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://alps-asd.github.io/app-state-diagram/asd.xsd"> <alpsFile>profile.xml</alpsFile> </asd>
Optional attributes
watch
<asd> <watch>[bool]</watch> </asd>
You can start ASD development server with watch mode. Each time the profile file changes, the page is reloaded.
If you want to start with a specific port number, you can specify the port number at startup as follows.
<asd> <port>3001</port> </asd>
markdown format
If your repository is private and your account is not a GHE or GHE Cloud account, you cannot make GitHub Pqges private. In such a case, you can output the document as Markdown and make the document private.
Unfortunately there is no way to host linked SVGs (diagrams) in Markdown, the dialog will lose the link when in Markdown.
This is an option if public HTML is not possible.
<asd> <mode>markdown</mode> </asd>