8000 GitHub - SebaVDP/Perpetua: Perpetua - embed meaningful markers in your code; tools follow them to generate documentation (C4/Structurizr, flows, onboarding). · GitHub
[go: up one dir, main page]

Skip to content
SebaVDPPublic

About

Perpetua - embed meaningful markers in your code; tools follow them to generate documentation (C4/Structurizr, flows, onboarding).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

115 Commits

Folders and files

Repository files navigation

Perpetua

CI NuGet (Perpetua) NuGet (Perpetua.Structurizr) License: MIT

Architecture diagrams drift. Someone draws them once, the code moves on, and nobody trusts them anymore.

Perpetua generates architecture diagrams from explicit markers in your C# code. Keep architectural intent close to the implementation, and regenerate the diagrams instead of maintaining them separately. The markers declare which container a service represents, what it depends on and which events it publishes or consumes. Perpetua reads them from your compiled assemblies and generates Structurizr fragments.

The diagrams reflect those declarations. Perpetua does not verify that they match the implementation, so the markers still need to be maintained as the code changes.

Containers diagram of the Library sample, generated from its attributes

The diagram above is the Library sample: six deployment units whose containers, dependencies and BookBorrowed event all come from attributes. Only the workspace that includes the generated fragments is written by hand. The legend explains the notation.

Install

dotnet add package Perpetua
dotnet tool install --global Perpetua.Structurizr

Quick start

Mark your service and what it depends on:

[Container("Loans", "Library")]
public class Program { }

[DependsOn("Members", description: "Checks borrowing rights")]
public class MembersClient { }

Generate the fragments from the build output of each deployment unit:

perpetua-structurizr ./loans/bin/Release/net10.0 ./docs

Include the generated folders in your hand-written Structurizr workspace, and the relationship Library.Loans -> Library.Members appears in your diagram.

Learn more

  • Concepts: the words Perpetua uses and how a run turns markers into Structurizr fragments.
  • Attributes: [Container], [DependsOn], [Publishes], [Consumes] and the rules they follow, including migration from the previous API.
  • Failures: the exit code and the PSTRUCT problem codes.
  • Library sample: a complete system with six deployment units, whose diagram is generated from its attributes.

License

MIT

About

Perpetua - embed meaningful markers in your code; tools follow them to generate documentation (C4/Structurizr, flows, onboarding).

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

0