Clarity (Clarity v0.1.1)

View Source

⚠️ Alpha Notice: Clarity is currently in an alpha state. APIs and features may change rapidly, and things may break. Feedback and contributions are very welcome!

Clarity is an interactive introspection and visualization tool for Elixir projects.
It automatically discovers and visualizes applications, domains, resources, modules, and their relationships, giving you a navigable graph interface enriched with diagrams, tooltips, and documentation.

Clarity Screenshot

Features

  • 📊 Graph navigation – explore your application structure visually.
  • 🗂 Extensible introspection – support for Ash domains/resources, Phoenix endpoints, Ecto repos, and more.
  • 🖼 Mermaid & Graphviz diagrams – ER diagrams, class diagrams, and policy diagrams where available.
  • 📝 Markdown rendering – show documentation from moduledocs and resource definitions.
  • 🔎 Interactive tooltips – quick overviews of nodes and edges.
  • LiveView-powered – fully dynamic, real-time updates in the browser.
  • 🔌 Custom extensions – add your own introspectors to visualize domain-specific concepts.

Installation

Igniter

mix igniter.install clarity

Manual

The package can be installed by adding clarity to your list of dependencies in mix.exs:

def deps do
  [
    {:clarity, "~> 0.1.0"}
  ]
end

Router:

import Clarity.Router
clarity("/clarity")

License

Copyright 2025 Alembic Pty Ltd

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Summary

Functions

Returns a specification to start this module under a supervisor.

Gets the current state of the clarity.

Builds a new clarity by introspecting the current state of the system.

Types

t()

@type t() :: %Clarity{
  graph: :digraph.graph(),
  root: Clarity.Vertex.t(),
  tree: tree(),
  vertices: %{required(String.t()) => Clarity.Vertex.t()}
}

tree()

@type tree() :: %{
  node: :digraph.vertex(),
  children: %{optional(:digraph.label()) => [tree()]}
}

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

get(name \\ __MODULE__)

@spec get(name :: Agent.agent()) :: t()

Gets the current state of the clarity.

introspect()

@spec introspect() :: t()

Builds a new clarity by introspecting the current state of the system.

update(name \\ __MODULE__)

@spec update(name :: Agent.agent()) :: t()