# sharptoolbox/ontology-driven-dev architecture

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

- Interactive diagram: https://gitdiagram.com/sharptoolbox/ontology-driven-dev
- Repository: https://github.com/sharptoolbox/ontology-driven-dev

## Overview

This repository is an ontology-driven development skill: it guides an agent from confirmed business requirements, through seven-model YAML, to a runnable browser-based business system. Its included Python and Go techbases provide reusable runtime foundations, while code-app-example demonstrates a generated contract-management product. The README documents the methodology and example capabilities; sampled source confirms selected wiring, but does not expose the skill instructions or most feature implementations, so those links are documented rather than inferred from naming.

Main entry points: [`code-app-example/frontend/src`](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/code-app-example/frontend/src) (Contract management UI), [`techbase`](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/techbase) (Application construction), [`techbase/backend`](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/techbase/backend) (Python techbase), [`references`](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/references) (Requirements exploration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_method["Development method"]
  node_exploration["Requirements exploration"]
  node_modeling["Seven-model YAML"]
  node_construction["Application construction"]
end

subgraph group_foundation["Runtime foundation"]
  node_pythonbase["Python techbase"]
  node_ontology["Ontology registry<br/>[registry.py]"]
  node_pyflow["Python flow engine<br/>[flow_engine.py]"]
  node_godbase["Go techbase"]
  node_storage[("SQLite database<br/>[db.py]")]
end

subgraph group_example["Contract application"]
  node_webapp["Contract management UI"]
  node_contracts["Contract management"]
  node_billing["Invoice and receipt<br/>[invoice_service.py]"]
  node_reports["Business reports<br/>[report_service.py]"]
  node_assistant["AI assistant"]
end

subgraph group_operations["Workflow operations"]
  node_approval["Approval workflows<br/>[flow_engine.py]"]
  node_readonlysql["Read-only SQL<br/>[query.py]"]
end

node_requester(("Business requester"))
node_appuser(("Contract-system user"))

node_requester -->|"describes needs"| node_exploration
node_exploration -->|"confirms requirements"| node_modeling
node_modeling -->|"provides models"| node_construction
node_construction -->|"copies foundation"| node_pythonbase
node_construction -->|"or selects"| node_godbase
node_construction -->|"builds example"| node_webapp
node_appuser -.->|"uses system"| node_webapp
node_webapp -.->|"supports contracts"| node_contracts
node_webapp -.->|"supports billing"| node_billing
node_webapp -.->|"shows reports"| node_reports
node_webapp -.->|"opens assistant"| node_assistant
node_webapp -.->|"manages approvals"| node_approval
node_pythonbase -->|"loads models"| node_ontology
node_pyflow -->|"queries and updates"| node_storage
node_pythonbase -.->|"exposes workflow"| node_pyflow
node_approval -->|"persists workflow"| node_storage
node_assistant -.->|"uses safe queries"| node_readonlysql

click node_exploration "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/references"
click node_modeling "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/references"
click node_construction "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/techbase"
click node_pythonbase "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/techbase/backend"
click node_ontology "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/techbase/backend/ontology/registry.py"
click node_pyflow "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/techbase/backend/engine/flow_engine.py"
click node_godbase "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/go-techbase"
click node_webapp "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/code-app-example/frontend/src"
click node_contracts "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/services/contract_service.py"
click node_billing "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/services/invoice_service.py"
click node_reports "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/services/report_service.py"
click node_assistant "https://github.com/sharptoolbox/ontology-driven-dev/tree/main/code-app-example/backend/ai"
click node_approval "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/engine/flow_engine.py"
click node_storage "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/techbase/backend/db.py"
click node_readonlysql "https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/sql_readonly/query.py"

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_exploration,node_modeling,node_construction,node_appuser toneBlue
class node_pythonbase,node_ontology,node_pyflow,node_godbase,node_storage toneAmber
class node_webapp,node_contracts,node_billing,node_reports,node_assistant,node_requester toneMint
class node_approval,node_readonlysql toneRose
```

## Components

### Development method

- [Requirements exploration](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/references): `references`
- [Seven-model YAML](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/references): `references`
- [Application construction](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/techbase): `techbase`

### Runtime foundation

- [Python techbase](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/techbase/backend): `techbase/backend`
- [Ontology registry](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/techbase/backend/ontology/registry.py): `techbase/backend/ontology/registry.py`
- [Python flow engine](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/techbase/backend/engine/flow_engine.py): `techbase/backend/engine/flow_engine.py`
- [Go techbase](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/go-techbase): `go-techbase`
- [SQLite database](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/techbase/backend/db.py): `techbase/backend/db.py`

### Contract application

- [Contract management UI](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/code-app-example/frontend/src): `code-app-example/frontend/src`
- [Contract management](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/services/contract_service.py): `code-app-example/backend/services/contract_service.py`
- [Invoice and receipt](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/services/invoice_service.py): `code-app-example/backend/services/invoice_service.py`
- [Business reports](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/services/report_service.py): `code-app-example/backend/services/report_service.py`
- [AI assistant](https://github.com/sharptoolbox/ontology-driven-dev/tree/main/code-app-example/backend/ai): `code-app-example/backend/ai`

### Workflow operations

- [Approval workflows](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/engine/flow_engine.py): `code-app-example/backend/engine/flow_engine.py`
- [Read-only SQL](https://github.com/sharptoolbox/ontology-driven-dev/blob/main/code-app-example/backend/sql_readonly/query.py): `code-app-example/backend/sql_readonly/query.py`

### Other components

- **Business requester**
- **Contract-system user**

## Connections

- Business requester → Requirements exploration: describes needs (evidence: `README.md`)
- Requirements exploration → Seven-model YAML: confirms requirements (evidence: `README.md`)
- Seven-model YAML → Application construction: provides models (evidence: `README.md`)
- Application construction → Python techbase: copies foundation (evidence: `README.md`)
- Application construction → Go techbase: or selects (evidence: `README.md`)
- Application construction → Contract management UI: builds example (evidence: `README.md`)
- Contract-system user → Contract management UI: uses system
- Contract management UI → Contract management: supports contracts (evidence: `README.md`)
- Contract management UI → Invoice and receipt: supports billing (evidence: `README.md`)
- Contract management UI → Business reports: shows reports (evidence: `README.md`)
- Contract management UI → AI assistant: opens assistant (evidence: `README.md`)
- Contract management UI → Approval workflows: manages approvals (evidence: `README.md`)
- Python techbase → Ontology registry: loads models (evidence: `techbase/backend/app.py`)
- Python flow engine → SQLite database: queries and updates (evidence: `techbase/backend/engine/flow_engine.py`)
- Python techbase → Python flow engine: exposes workflow (evidence: `techbase/backend/engine/flow_engine.py`)
- Approval workflows → SQLite database: persists workflow (evidence: `code-app-example/backend/engine/flow_engine.py`)
- AI assistant → Read-only SQL: uses safe queries (evidence: `README.md`)
