MCPcopy Index your code
hub / github.com/archifacts/archifacts

github.com/archifacts/archifacts @0.6.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.6.1 ↗ · + Follow
615 symbols 1,877 edges 119 files 36 documented · 6%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Verify Maven Central License

archifacts is a free (Apache 2.0 license) library for describing and detecting architectural building blocks and their relationships in your Java applications.

archifacts heavily relies on ArchUnit which analyzes the Java bytecode. With the help of descriptors archifacts identifies building blocks, relationships and containers of your application and builds a model.

Having this model in place you can visualize your application's architecture or verify it against certain rules.

While we already have some support for the former, the latter is subject of future work.

Experimental API

Caution! archifacts is in a very early state. The API is not intended to be stable. We might introduce breaking changes at any time if we think it improves the overall user experience. Please be aware of this, if you decide to use archifacts.

Nevertheless we try to reduce the breaking changes to a minimum, but there is no guarantee.

Usage

Gradle

implementation 'org.archifacts:archifacts-core:<latest-version>'

Maven

<dependency>
    <groupId>org.archifacts</groupId>
    <artifactId>archifacts-core</artifactId>
    <version>&lt;latest-version&gt;</version>
</dependency>

How to get started

Take a look at our Fraktalio demo application example and Spring Restbucks example to get an idea about how to use archifacts.

Fraktalio

The project documents the Fraktalio demo application which is a Spring Boot and Axon Framework based microservice system, implemented in Java and Kotlin.

The generated documentation is deployed using GitHub Actions. You can find it here

Spring Restbucks

The project documents the Spring Restbucks application which is a Spring Boot and jMolecules based modular monolith system, implemented in Java.

The generated documentation is deployed using GitHub Actions. You can find it here

Why is it called 'archifacts'?

archifacts is a made-up word out of architects, artifacts and facts.

architects who want to visualize or verify their architecture are the main target group of the library.

Every class, interface or enum in your application is treated as an artifact. Artifact is the common base class for all these elements and therefore the foundation of archifacts.

archifacts is all about facts as the model is extracted from bytecode. With this approach archifacts tackles outdated documentation. The model contents are facts.

How can I contribute?

The most helpful contribution in this early project phase is feedback. Feedback about bugs, missing features, misconceptions, successes, whatever. We would like to get in touch with the library's users to improve archifacts.

Release process

Releases are created manually via GitHub Releases and published by the Release GitHub Actions workflow.

Prerequisites

  • The required repository secrets for Maven Central publishing and GPG signing are configured:
  • SONATYPE_USERNAME
  • SONATYPE_PASSWORD
  • GPG_PRIVATE_KEY
  • GPG_PASSPHRASE
  • MAVEN_GPG_KEYNAME
  • All changes for the release are merged and verified on main.

Steps

  1. Create and push a release tag (SemVer-style), for example:
git checkout main
git pull
git tag 0.7.0
git push origin 0.7.0
  1. Open GitHub -> Releases -> Draft a new release.
  2. Choose the existing tag from the tag selector.
  3. Add title and release notes.
  4. Publish the release.

Publishing the release triggers .github/workflows/release.yml (release.published event), checks out the tagged commit, and runs Maven deploy with:

-Drevision=<tag-name>

This repository uses Maven CI-friendly versions, so the Git tag is the source of truth for the released artifact version.

License

archifacts is published under the Apache License 2.0, see http://www.apache.org/licenses/LICENSE-2.0 for details.

Extension points exported contracts — how you extend this code

AsciiDocElement (Interface)
Implementations of this interface are considered renderable AsciiDoc elements. The implementations are responsible thems [15 …
integration/asciidoc/src/main/java/org/archifacts/integration/asciidoc/AsciiDocElement.java
BuildingBlockDescriptor (Interface)
Describes a BuildingBlock. @author Oliver Libutzki @see BuildingBlock [17 implementers]
core/src/main/java/org/archifacts/core/descriptor/BuildingBlockDescriptor.java
C4ModelLookup (Interface)
(no doc) [3 implementers]
integration/c4-model/src/main/java/org/archifacts/integration/c4/model/C4ModelLookup.java
SourceBasedArtifactRelationshipDescriptor (Interface)
Describes an ArtifactRelationship. As it is source-based the relationship's source side is the artifact which is [19 implementers]
core/src/main/java/org/archifacts/core/descriptor/SourceBasedArtifactRelationshipDescriptor.java
ComputationRuleBuilderPredicateStage (Interface)
(no doc) [1 implementers]
integration/c4-model/src/main/java/org/archifacts/integration/c4/model/C4ModelBuilder.java
ArtifactRelationshipDescriptor (Interface)
Describes an ArtifactRelationship. @author Oliver Libutzki @see ArtifactRelationship [18 implementers]
core/src/main/java/org/archifacts/core/descriptor/ArtifactRelationshipDescriptor.java
ComputationRuleBuilderBuildStage (Interface)
(no doc) [1 implementers]
integration/c4-model/src/main/java/org/archifacts/integration/c4/model/C4ModelBuilder.java
ArtifactContainerDescriptor (Interface)
Describes an ArtifactContainer. @author Oliver Libutzki @see ArtifactContainer [7 implementers]
core/src/main/java/org/archifacts/core/descriptor/ArtifactContainerDescriptor.java

Core symbols most depended-on inside this repo

descriptor
called by 129
core/src/main/java/org/archifacts/core/model/ApplicationBuilder.java
of
called by 80
core/src/main/java/org/archifacts/core/model/BuildingBlockType.java
getName
called by 64
core/src/main/java/org/archifacts/core/model/Named.java
builder
called by 41
core/src/main/java/org/archifacts/core/model/Application.java
buildApplication
called by 40
core/src/main/java/org/archifacts/core/model/ApplicationBuilder.java
of
called by 28
core/src/main/java/org/archifacts/core/model/ArtifactRelationshipRole.java
getArtifacts
called by 19
core/src/main/java/org/archifacts/core/model/Application.java
getJavaClass
called by 19
core/src/main/java/org/archifacts/core/model/Artifact.java

Shape

Method 441
Class 156
Interface 18

Languages

Java100%

Modules by API surface

core/src/test/java/org/archifacts/core/model/ApplicationBuilderTest.java41 symbols
core/src/test/java/org/archifacts/core/model/Descriptors.java30 symbols
integration/c4-model/src/main/java/org/archifacts/integration/c4/model/C4ModelBuilder.java26 symbols
integration/asciidoc/src/main/java/org/archifacts/integration/asciidoc/TableDocElement.java21 symbols
integration/c4-model/src/test/java/org/archifacts/integration/c4/model/C4ModelBuilderTest.java19 symbols
core/src/test/java/org/archifacts/core/model/Classes.java14 symbols
core/src/main/java/org/archifacts/core/model/ArtifactContainer.java14 symbols
integration/jmolecules/src/test/java/org/archifacts/integration/jmolecules/JMoleculesDescriptorsTest.java13 symbols
integration/asciidoc/src/test/java/org/archifacts/integration/asciidoc/TableDocElementTest.java12 symbols
core/src/test/java/org/archifacts/core/descriptor/BuildingBlockDescriptorTest.java12 symbols
core/src/main/java/org/archifacts/core/model/Artifact.java12 symbols
core/src/main/java/org/archifacts/core/model/Application.java10 symbols

For agents

$ claude mcp add archifacts \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact