Modules
Container Diagram
C4 Model UI Kit
Keadex-independent, it exports the rendering system and Fabric.js (opens in a new tab) components to render C4 Model diagrams.
For more details, please visit the C4 Model UI Kit documentation.
Keadex Mina
Backend
Controllers
Controllers expose the Rust APIs and Tauri commands that the frontend can invoke. They serve as the interface between the frontend and the backend.
DAOs
Keadex Mina Backend adopts the DAO Pattern (opens in a new tab).
According to Baeldung' article (opens in a new tab):
"The Data Access Object Pattern, aka DAO Pattern, is an abstraction of data persistence and is considered closer to the underlying storage, which is often table-centric.
Therefore, in many cases, our DAOs match database tables, allowing a more straightforward way to send/retrieve data from storage, hiding the ugly queries."
File System
Keadex Mina uses the OS file system to:
- Store diagrams
- Store Mina's configuration files
Memory
Keadex Mina maintains an in-memory global state, which is used to:
- Store instances of singletons
- Cache data for the currently opened user's project (e.g., diagrams, project settings, etc.)
PlantUML Parser
Keadex Mina leverages the PlantUML Domain Specific Lanuage (DSL) (opens in a new tab) to allow users to create diagrams through code.
While the PlantUML DSL offers an extensive syntax, Keadex Mina focuses specifically on the syntax needed for coding C4 Model diagrams.
Therefore, Keadex Mina supports only the C4 Model PlantUML (opens in a new tab) syntax.
Currently, there are no open-source implementations of the PlantUML grammar available. Keadex Mina utilizes its own implementation of the C4 Model PlantUML grammar. This grammar is implemented using Pest (opens in a new tab) and can be found here (opens in a new tab).
The PlantUML Parser parses C4 Model PlantUML code and is automatically generated by Pest (opens in a new tab) based on the C4 Model PlantUML grammar (opens in a new tab) implemented by Keadex.
This module is one of the fundamental components of the Rendering System.
Project Initializer
The Project Initializer provides functions to initialize a new Mina project or load an existing one.
SerDes
Keadex Mina handles various data formats, primarily JSON and PlantUML. The SerDes module offers features to serialize and deserialize these data types.
Repositories
Keadex Mina Backend adopts the Repository Design Pattern.
As per Eric Evans' book Domain-Driven Design (opens in a new tab), the "repository is a mechanism for encapsulating storage, retrieval, and search behavior, which emulates a collection of objects."
Likewise, according to Patterns of Enterprise Application Architecture (opens in a new tab), it "mediates between the domain and data mapping layers using a collection-like interface for accessing domain objects."
So, according to Baeldung' article (opens in a new tab):
"A repository deals with data and hides queries similar to DAO. However, it sits at a higher level, closer to the business logic of an app.
Consequently, a repository can use a DAO to fetch data from the database and populate a domain object. Or, it can prepare the data from a domain object and send it to a storage system using a DAO for persistence."
Resolver
Keadex Mina Backend adopts the Singleton Design Pattern (opens in a new tab).
This pattern has both advantages and disadvantages. One notable drawback is its handling of multithreading: since the single instance is accessible to all threads and each thread is unaware of the actions taken by others on the same instance, using this pattern can lead to race conditions and synchronization issues.
To address this, Keadex Mina leverages the power of Rust for a more advanced implementation of the Singleton pattern. This implementation involves the creation of a Resolver.
The Resolver is responsible for storing single instances and providing access to them while preventing race conditions and synchronization issues through appropriate locking and unlocking mechanisms.
Services
Services implement the business logic, with each service focusing on the logic of a specific scope, such as AI, diagrams, hooks, search, etc.
Frontend
Components
The majority of the application's components are imported from the Keadex UI Kit.
However, certain components are specific to the Keadex Mina UI, such as the DiagramEditorToolbar
.
All of these components are utilized within the views.
Tauri Bridge
This is a bridge that uses the Tauri API to invoke the Tauri commands exposed by the Rust controllers of the Mina backend.
Views
Contain the views that constitute the UI of the application. Views are implemented as React components.
Keadex UI Kit
It provides the Keadex Design Language System (DLS), used to build the UI of the Keadex applications.
Keadex Utils
It contains a set of general purpose Typescript utilities used by the Keadex applications and libraries.
Mina Confluence App
Mina Confluence App is a React application with the configuration required for the integration with an Atlassian Forge (opens in a new tab) project. This application just imports and render the Mina React component.
Mina Confluence Plugin
Mina Confluence Plugin is an Atlassian Forge (opens in a new tab) project that includes the Mina Confluence plugin implementation. This plugins renders the Mina Confluence App.
Atlassian Marketplace link: https://marketplace.atlassian.com/apps/1233762?tab=overview&hosting=cloud (opens in a new tab)
Mina Docusaurus Plugin
Mina Docusaurus Plugin is used in combination with the Mina React package and it injects into Docusaurus the Webpack configuration required by the Mina React package.
Npm link: https://www.npmjs.com/package/@keadex/docusaurus-plugin-mina (opens in a new tab)
Mina React
Mina React exports a React component to render Mina diagrams. This library uses some React components of the Keadex Mina Frontend and a some Rust code of the Keadex Mina Backend. The Rust code is the compiled to WebAssembly (opens in a new tab).
Npm link: https://www.npmjs.com/package/@keadex/mina-react (opens in a new tab)