# gram-ax/gramax architecture

> Architecture diagram of the GitHub repository gram-ax/gramax, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/gram-ax/gramax
- Repository: https://github.com/gram-ax/gramax

## Overview

Gramax is a Markdown-based documentation editor and publishing platform. The main workflow is to create a workspace and catalog, edit articles, collaborate through Git synchronization, then publish documentation to a portal or static site. Its architecture also includes platform-specific app initialization, search, authentication, plugins, enterprise capabilities, and migration imports. The README supports the product workflow and capabilities; source excerpts show app initialization and selected internal services, but not most command-to-service wiring, so those relationships are not inferred.

Main entry points: [`app/web/app.ts`](https://github.com/gram-ax/gramax/blob/master/app/web/app.ts) (Application initialization), [`app/commands/article`](https://github.com/gram-ax/gramax/tree/master/app/commands/article) (Article editing), [`app/commands/workspace`](https://github.com/gram-ax/gramax/tree/master/app/commands/workspace) (Workspaces and catalogs), [`app/commands/storage`](https://github.com/gram-ax/gramax/tree/master/app/commands/storage) (Local Markdown storage)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Documentation authoring"]
  node_workspace["Workspaces and catalogs"]
  node_article["Article editing"]
  node_markdown["Markdown parsing and rendering"]
  node_richcontent["Rich content elements"]
  node_language["Multilingual catalogs"]
  node_catalogviews["Catalog views and navigation"]
end

subgraph group_collaboration["Storage and collaboration"]
  node_storage[("Local Markdown storage")]
  node_git["Git version control"]
  node_review["Reviews and merge requests"]
  node_enterprise["Enterprise workspaces"]
end

subgraph group_delivery["Publishing and import"]
  node_portal["Documentation portal"]
  node_static["Static site generation"]
  node_imports["Content migration"]
end

subgraph group_platform["Application platform"]
  node_appinit["Application initialization<br/>[app.ts]"]
  node_appmodel["Application service model<br/>[Application.ts]"]
  node_config["Application configuration<br/>[AppConfig.ts]"]
  node_search["Search"]
  node_auth["Authentication"]
  node_plugins["Workspace plugins"]
  node_coremodules["Core runtime modules"]
end

node_author(("Documentation author"))

node_author -->|"creates workspace"| node_workspace
node_workspace -->|"contains articles"| node_article
node_author -->|"edits articles"| node_article
node_article -->|"stores Markdown"| node_storage
node_author -->|"synchronizes changes"| node_git
node_author -.->|"collaborates"| node_review
node_author -->|"publishes catalog"| node_portal
node_author -->|"builds static site"| node_static
node_author -->|"imports content"| node_imports
node_appinit -->|"reads configuration"| node_config
node_appinit -->|"assembles services"| node_appmodel
node_appinit -->|"initializes provider"| node_storage
node_appinit -->|"creates search manager"| node_search
node_appinit -->|"initializes parser"| node_markdown
node_appinit -->|"registers file handlers"| node_coremodules
node_appinit -.->|"provides auth services"| node_auth
node_appinit -.->|"enables workspace plugins"| node_plugins

click node_workspace "https://github.com/gram-ax/gramax/tree/master/app/commands/workspace"
click node_article "https://github.com/gram-ax/gramax/tree/master/app/commands/article"
click node_markdown "https://github.com/gram-ax/gramax/tree/master/core/extensions/markdown"
click node_richcontent "https://github.com/gram-ax/gramax/tree/master/app/commands/elements"
click node_language "https://github.com/gram-ax/gramax/tree/master/app/commands/catalog/language"
click node_catalogviews "https://github.com/gram-ax/gramax/tree/master/app/commands/catalog/views"
click node_storage "https://github.com/gram-ax/gramax/tree/master/app/commands/storage"
click node_git "https://github.com/gram-ax/gramax/tree/master/app/commands/versionControl"
click node_review "https://github.com/gram-ax/gramax/tree/master/app/commands/mergeRequests"
click node_enterprise "https://github.com/gram-ax/gramax/tree/master/app/commands/enterprise"
click node_portal "https://github.com/gram-ax/gramax/tree/master/apps/docportal/server/handlers"
click node_static "https://github.com/gram-ax/gramax/blob/master/apps/cli/src/logic/StaticSiteBuilder.ts"
click node_imports "https://github.com/gram-ax/gramax/tree/master/apps/cli/src/features/import/yandex"
click node_appinit "https://github.com/gram-ax/gramax/blob/master/app/web/app.ts"
click node_appmodel "https://github.com/gram-ax/gramax/blob/master/app/types/Application.ts"
click node_config "https://github.com/gram-ax/gramax/blob/master/app/config/AppConfig.ts"
click node_search "https://github.com/gram-ax/gramax/tree/master/app/commands/search"
click node_auth "https://github.com/gram-ax/gramax/blob/master/core/extensions/security/logic/AuthManagerProvider.ts"
click node_plugins "https://github.com/gram-ax/gramax/blob/master/core/plugins/bootstrap/WorkspacePluginBootstrap.ts"
click node_coremodules "https://github.com/gram-ax/gramax/tree/master/core"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_workspace,node_article,node_markdown,node_richcontent,node_language,node_catalogviews toneBlue
class node_storage,node_git,node_review,node_enterprise toneAmber
class node_portal,node_static,node_imports toneMint
class node_appinit,node_appmodel,node_config,node_search,node_auth,node_plugins,node_coremodules toneRose
class node_author toneIndigo
```

## Components

### Documentation authoring

- [Workspaces and catalogs](https://github.com/gram-ax/gramax/tree/master/app/commands/workspace): `app/commands/workspace`
- [Article editing](https://github.com/gram-ax/gramax/tree/master/app/commands/article): `app/commands/article`
- [Markdown parsing and rendering](https://github.com/gram-ax/gramax/tree/master/core/extensions/markdown): `core/extensions/markdown`
- [Rich content elements](https://github.com/gram-ax/gramax/tree/master/app/commands/elements): `app/commands/elements`
- [Multilingual catalogs](https://github.com/gram-ax/gramax/tree/master/app/commands/catalog/language): `app/commands/catalog/language`
- [Catalog views and navigation](https://github.com/gram-ax/gramax/tree/master/app/commands/catalog/views): `app/commands/catalog/views`

### Storage and collaboration

- [Local Markdown storage](https://github.com/gram-ax/gramax/tree/master/app/commands/storage): `app/commands/storage`
- [Git version control](https://github.com/gram-ax/gramax/tree/master/app/commands/versionControl): `app/commands/versionControl`
- [Reviews and merge requests](https://github.com/gram-ax/gramax/tree/master/app/commands/mergeRequests): `app/commands/mergeRequests`
- [Enterprise workspaces](https://github.com/gram-ax/gramax/tree/master/app/commands/enterprise): `app/commands/enterprise`

### Publishing and import

- [Documentation portal](https://github.com/gram-ax/gramax/tree/master/apps/docportal/server/handlers): `apps/docportal/server/handlers`
- [Static site generation](https://github.com/gram-ax/gramax/blob/master/apps/cli/src/logic/StaticSiteBuilder.ts): `apps/cli/src/logic/StaticSiteBuilder.ts`
- [Content migration](https://github.com/gram-ax/gramax/tree/master/apps/cli/src/features/import/yandex): `apps/cli/src/features/import/yandex`

### Application platform

- [Application initialization](https://github.com/gram-ax/gramax/blob/master/app/web/app.ts): `app/web/app.ts`
- [Application service model](https://github.com/gram-ax/gramax/blob/master/app/types/Application.ts): `app/types/Application.ts`
- [Application configuration](https://github.com/gram-ax/gramax/blob/master/app/config/AppConfig.ts): `app/config/AppConfig.ts`
- [Search](https://github.com/gram-ax/gramax/tree/master/app/commands/search): `app/commands/search`
- [Authentication](https://github.com/gram-ax/gramax/blob/master/core/extensions/security/logic/AuthManagerProvider.ts): `core/extensions/security/logic/AuthManagerProvider.ts`
- [Workspace plugins](https://github.com/gram-ax/gramax/blob/master/core/plugins/bootstrap/WorkspacePluginBootstrap.ts): `core/plugins/bootstrap/WorkspacePluginBootstrap.ts`
- [Core runtime modules](https://github.com/gram-ax/gramax/tree/master/core): `core`

### Other components

- **Documentation author**

## Connections

- Documentation author → Workspaces and catalogs: creates workspace
- Workspaces and catalogs → Article editing: contains articles
- Documentation author → Article editing: edits articles
- Article editing → Local Markdown storage: stores Markdown
- Documentation author → Git version control: synchronizes changes
- Documentation author → Reviews and merge requests: collaborates
- Documentation author → Documentation portal: publishes catalog
- Documentation author → Static site generation: builds static site
- Documentation author → Content migration: imports content
- Application initialization → Application configuration: reads configuration (evidence: `app/web/app.ts`)
- Application initialization → Application service model: assembles services (evidence: `app/web/app.ts`)
- Application initialization → Local Markdown storage: initializes provider (evidence: `app/web/app.ts`)
- Application initialization → Search: creates search manager (evidence: `app/web/app.ts`)
- Application initialization → Markdown parsing and rendering: initializes parser (evidence: `app/web/app.ts`)
- Application initialization → Core runtime modules: registers file handlers (evidence: `app/web/app.ts`)
- Application initialization → Authentication: provides auth services (evidence: `app/web/app.ts`)
- Application initialization → Workspace plugins: enables workspace plugins
