Clarity
⚠️ 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.
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 vertices and edges.
- ⚡ LiveView-powered – fully dynamic, real-time updates in the browser.
- 🔌 Custom extensions – add your own introspectors to visualize domain-specific concepts.
Third-Party Libraries
Third-party libraries can add custom content to Clarity, extending its
visualization capabilities. To install any of these libraries, simply add them
to your mix.exs dependencies.
- ash_diagram – Provides mermaid diagrams for Ash
Library authors: see Integrating a Library with Clarity for the convention used to ship Clarity content from inside your own library — no host-side configuration required on the consumer's part.
Installation
Igniter
mix igniter.install clarity
If you want to include Ash diagramming and visualisation support then also install ash_diagram:
mix igniter.install clarity ash_diagram
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")
Documentation can be generated with ExDoc and published on HexDocs.The docs can be found at https://hexdocs.pm/clarity.
Development
To run the development server with the demo application:
mix dev
This starts a Phoenix server at http://localhost:4000 with live reload enabled.
See usage-rules/development.md for more details on testing, asset building, and code quality tools.
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.