# roenbaeck/anchor architecture

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

- Interactive diagram: https://gitdiagram.com/roenbaeck/anchor
- Repository: https://github.com/roenbaeck/anchor

## Overview

Anchor Modeler is a browser-based tool for authoring database models that represent temporal data in sixth normal form. The repository combines client-side model and layout modules with SQL templates for several database platforms, indicating a path from model authoring to database-specific SQL output. The README also describes optional Cloud model loading and saving. The supplied excerpts do not expose the UI entry point or generation orchestration, so those connections are shown as unverified; SQL template relationships are grouped by capability rather than presented as a call sequence.

Main entry points: [`SQL/Helpers.js`](https://github.com/roenbaeck/anchor/blob/master/SQL/Helpers.js) (SQL helpers and naming), [`modules/sisula.js`](https://github.com/roenbaeck/anchor/blob/master/modules/sisula.js) (Model data), [`SQL/PostgreSQL`](https://github.com/roenbaeck/anchor/tree/master/SQL/PostgreSQL) (PostgreSQL templates), [`SQL/BigQuery`](https://github.com/roenbaeck/anchor/tree/master/SQL/BigQuery) (BigQuery templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Model authoring"]
  node_modeler["Anchor Modeler"]
  node_model["Model data<br/>[sisula.js]"]
  node_dom["DOM interface<br/>[DomFacade.js]"]
  node_xml["XML model<br/>[XmlTree.js]"]
end

subgraph group_services["Model services"]
  node_layout["Graph layout<br/>[LayoutEngine.js]"]
  node_resolve["Model resolution<br/>[Resolver.js]"]
  node_inherit["Inheritance<br/>[Inheritance.js]"]
  node_types["Type conversion"]
  node_defaults["Defaults<br/>[Defaults.js]"]
  node_simulation["Model simulation<br/>[Sisulator.js]"]
end

subgraph group_sql["SQL generation"]
  node_sqlcommon["SQL helpers and naming<br/>[Helpers.js]"]
  node_sqlpg["PostgreSQL templates"]
  node_sqlbigquery["BigQuery templates"]
  node_sqloracle["Oracle templates"]
  node_sqlvertica["Vertica templates"]
  node_sqlsnowflake["Snowflake templates"]
  node_sqlserver["SQL Server support"]
end

subgraph group_integrations["External services"]
  node_cloud["Optional Cloud"]
end

node_user(("Modeler user"))

node_user -->|"authors models"| node_modeler
node_modeler -.->|"edits model"| node_model
node_modeler -.->|"loads or saves"| node_cloud
node_modeler -.->|"generates SQL"| node_sqlcommon
node_sqlcommon -.->|"supports dialect"| node_sqlpg
node_sqlcommon -.->|"supports dialect"| node_sqlbigquery
node_sqlcommon -.->|"supports dialect"| node_sqloracle
node_sqlcommon -.->|"supports dialect"| node_sqlvertica
node_sqlcommon -.->|"supports dialect"| node_sqlsnowflake
node_sqlcommon -.->|"supports dialect"| node_sqlserver

click node_model "https://github.com/roenbaeck/anchor/blob/master/modules/sisula.js"
click node_dom "https://github.com/roenbaeck/anchor/blob/master/modules/DomFacade.js"
click node_xml "https://github.com/roenbaeck/anchor/blob/master/modules/XmlTree.js"
click node_layout "https://github.com/roenbaeck/anchor/blob/master/modules/LayoutEngine.js"
click node_resolve "https://github.com/roenbaeck/anchor/blob/master/modules/Resolver.js"
click node_inherit "https://github.com/roenbaeck/anchor/blob/master/modules/Inheritance.js"
click node_types "https://github.com/roenbaeck/anchor/blob/master/modules/DataTypeConverter.js"
click node_defaults "https://github.com/roenbaeck/anchor/blob/master/modules/Defaults.js"
click node_simulation "https://github.com/roenbaeck/anchor/blob/master/modules/Sisulator.js"
click node_sqlcommon "https://github.com/roenbaeck/anchor/blob/master/SQL/Helpers.js"
click node_sqlpg "https://github.com/roenbaeck/anchor/tree/master/SQL/PostgreSQL"
click node_sqlbigquery "https://github.com/roenbaeck/anchor/tree/master/SQL/BigQuery"
click node_sqloracle "https://github.com/roenbaeck/anchor/tree/master/SQL/Oracle"
click node_sqlvertica "https://github.com/roenbaeck/anchor/tree/master/SQL/Vertica"
click node_sqlsnowflake "https://github.com/roenbaeck/anchor/tree/master/SQL/Snowflake"
click node_sqlserver "https://github.com/roenbaeck/anchor/tree/master/SQL/SQLServer"

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_modeler,node_model,node_dom,node_xml,node_user toneBlue
class node_layout,node_resolve,node_inherit,node_types,node_defaults,node_simulation toneAmber
class node_sqlcommon,node_sqlpg,node_sqlbigquery,node_sqloracle,node_sqlvertica,node_sqlsnowflake,node_sqlserver toneMint
class node_cloud toneRose
```

## Components

### Model authoring

- **Anchor Modeler**
- [Model data](https://github.com/roenbaeck/anchor/blob/master/modules/sisula.js): `modules/sisula.js`
- [DOM interface](https://github.com/roenbaeck/anchor/blob/master/modules/DomFacade.js): `modules/DomFacade.js`
- [XML model](https://github.com/roenbaeck/anchor/blob/master/modules/XmlTree.js): `modules/XmlTree.js`

### Model services

- [Graph layout](https://github.com/roenbaeck/anchor/blob/master/modules/LayoutEngine.js): `modules/LayoutEngine.js`
- [Model resolution](https://github.com/roenbaeck/anchor/blob/master/modules/Resolver.js): `modules/Resolver.js`
- [Inheritance](https://github.com/roenbaeck/anchor/blob/master/modules/Inheritance.js): `modules/Inheritance.js`
- [Type conversion](https://github.com/roenbaeck/anchor/blob/master/modules/DataTypeConverter.js): `modules/DataTypeConverter.js`
- [Defaults](https://github.com/roenbaeck/anchor/blob/master/modules/Defaults.js): `modules/Defaults.js`
- [Model simulation](https://github.com/roenbaeck/anchor/blob/master/modules/Sisulator.js): `modules/Sisulator.js`

### SQL generation

- [SQL helpers and naming](https://github.com/roenbaeck/anchor/blob/master/SQL/Helpers.js): `SQL/Helpers.js`
- [PostgreSQL templates](https://github.com/roenbaeck/anchor/tree/master/SQL/PostgreSQL): `SQL/PostgreSQL`
- [BigQuery templates](https://github.com/roenbaeck/anchor/tree/master/SQL/BigQuery): `SQL/BigQuery`
- [Oracle templates](https://github.com/roenbaeck/anchor/tree/master/SQL/Oracle): `SQL/Oracle`
- [Vertica templates](https://github.com/roenbaeck/anchor/tree/master/SQL/Vertica): `SQL/Vertica`
- [Snowflake templates](https://github.com/roenbaeck/anchor/tree/master/SQL/Snowflake): `SQL/Snowflake`
- [SQL Server support](https://github.com/roenbaeck/anchor/tree/master/SQL/SQLServer): `SQL/SQLServer`

### External services

- **Optional Cloud**

### Other components

- **Modeler user**

## Connections

- Modeler user → Anchor Modeler: authors models
- Anchor Modeler → Model data: edits model
- Anchor Modeler → Optional Cloud: loads or saves
- Anchor Modeler → SQL helpers and naming: generates SQL
- SQL helpers and naming → PostgreSQL templates: supports dialect
- SQL helpers and naming → BigQuery templates: supports dialect
- SQL helpers and naming → Oracle templates: supports dialect
- SQL helpers and naming → Vertica templates: supports dialect
- SQL helpers and naming → Snowflake templates: supports dialect
- SQL helpers and naming → SQL Server support: supports dialect
