7. The Authoring Workflow « FC4 User Manual
Summarized Workflow
- Start Structurizr (docs)
- Run
fc4 -fsrw path/to/repo
to start fc4 watching for changes
- Create and/or edit diagram YAML files
- fc4 will automatically format, snap, and render the
diagrams
- Run
git commit
to commit the new/changed files
Full Workflow
- Create a new git branch in your local instance of the diagram repository
- In your text editor: either create a new diagram source file or open an existing diagram source
file
- Start Structurizr (docs)
- In your terminal, run
fc4 -fsrw path/to/repo
- This starts FC4 watching your repository for changes to any diagram source YAML file (or new
files)
- Each file will be formatted, snapped, and rendered when
it changes or is created
- A future release of the tool will enable users to specify which actions should be performed
- In your text editor, open a diagram YAML file in one pane and its rendered PNG file in an
adjacent pane
- If the diagram is new then the PNG file won’t exist until you’ve saved the YAML file and
fc4 has successfully rendered the diagram
- Edit the diagram YAML by adding/changing elements, relationships, etc, then save the file
- This will cause fc4 to format, snap, and render
the diagram
- Ideally your editor will see the changes the open files and automatically refresh your open
buffers/windows/tabs so you can immediately see the changes
- Continue to edit the YAML, save the file, and observe the changes to the PNG until you’re
happy with the changes
- In your terminal, hit
ctrl-c
to stop fc4
- Use your git UI of choice to commit your changes
- Push your local changes to the remote repository regularly
- When you’re ready to submit your changes for review, open a
Merge Request or
Pull Request to get your changes
reviewed and then merged into the default branch (e.g.
main
)
Here’s a screenshot of an editor with a diagram open in two panes:
Optional: Using Structurizr Express for Graphical Editing
This is optional, but can be very helpful when you need to make broad layout changes, or experiment
quickly with various changes to a layout.
During an editing session as described above, when you have both files of a diagram open in your
editor, you can use Structurizr Express (SE) like so:
- Select the entire contents of the YAML file in your text editor and cut it into your clipboard
- Switch to your Web browser and open SE, using your local URL (e.g. http://localhost:8080/express)
- Once SE has loaded, click the YAML tab on the left-hand side of the UI
- Paste the diagram source into the YAML textarea
- Press tab to blur the textarea
- SE will either render the diagram, or display a red error indicator in its toolbar
- If SE shows its red error indicator, click the indicator button to bring up a dialog listing
the errors
- Use the right-hand side of SE to arrange the elements and edges as desired
- Don’t worry about aligning elements precisely; fc4 will take care of this for you
- Cut the diagram source from the SE YAML textarea into your clipboard
- Switch back to your editor, paste the diagram source into the YAML file buffer, and save the file
- fc4 will see that the YAML file has changed, and will process it as described above
- NB: the processing includes snapping the elements and vertices of a diagram to a
virtual grid, which has the effect of precisely aligning elements that had been only roughly
aligned
Here’s a screenshot of Structurizr Express:
Please continue to Publishing or go back to the top page of the manual.