# aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms architecture

> Architecture diagram of the GitHub repository aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms
- Repository: https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms

## Overview

Creative Ledger is a Flask demonstration application backed by a PostgreSQL schema for heterogeneous creative-business income. Users enter typed transactions or settlements; PostgreSQL stores the normalized core and subtype details and enforces integrity, while a materialized view supports dashboard reads. The app also exposes integrity and benchmark pages. The schema’s major design capabilities are represented as distinct components, though their detailed implementation is not sampled. Edges are limited to calls visible in the app excerpt or relationships explicitly described in the README.

Main entry points: [`code/sql/schema.sql`](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql) (Integrity constraints), [`code/app/app.py`](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py) (Flask application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Application workflows"]
  node_flask_app["Flask application<br/>[app.py]"]
  node_transaction_entry["Transaction entry<br/>[app.py]"]
  node_settlement_workflow["Settlement allocation<br/>[app.py]"]
  node_integrity_page["Integrity tests<br/>[app.py]"]
  node_benchmark_page["Benchmark page<br/>[app.py]"]
end

subgraph group_model["Transaction model"]
  node_transaction_core["Transaction core<br/>[schema.sql]"]
  node_typed_subtypes["Typed subtypes<br/>[schema.sql]"]
  node_json_metadata["Constrained JSONB<br/>[schema.sql]"]
  node_custom_fields["Runtime fields<br/>[schema.sql]"]
  node_settlement_model["Settlement model<br/>[schema.sql]"]
end

subgraph group_integrity["Database integrity"]
  node_postgres[("PostgreSQL")]
  node_integrity_rules["Integrity constraints<br/>[schema.sql]"]
  node_allocation_safety["Allocation locking<br/>[schema.sql]"]
end

subgraph group_reads["Read and evaluation"]
  node_read_model[("Materialized read model<br/>[schema.sql]")]
end

node_creative_user(("Creative business user"))

node_creative_user -->|"uses"| node_flask_app
node_flask_app -->|"queries and writes"| node_postgres
node_transaction_entry -->|"inserts transaction"| node_transaction_core
node_transaction_entry -->|"inserts subtype"| node_typed_subtypes
node_settlement_workflow -->|"records allocation"| node_settlement_model
node_integrity_page -->|"tests constraints"| node_integrity_rules
node_integrity_rules -->|"constrains"| node_transaction_core
node_integrity_rules -->|"guards subtype rows"| node_typed_subtypes
node_integrity_rules -->|"constrains metadata"| node_json_metadata
node_integrity_rules -->|"validates fields"| node_custom_fields
node_integrity_rules -->|"checks allocations"| node_settlement_model
node_allocation_safety -->|"locks allocations"| node_settlement_model
node_flask_app -->|"refreshes view"| node_read_model
node_benchmark_page -.->|"compares schema performance"| node_postgres

click node_flask_app "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py"
click node_transaction_entry "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py"
click node_settlement_workflow "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py"
click node_integrity_page "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py"
click node_benchmark_page "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py"
click node_transaction_core "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_typed_subtypes "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_json_metadata "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_custom_fields "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_settlement_model "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_integrity_rules "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_allocation_safety "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"
click node_read_model "https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql"

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_flask_app,node_transaction_entry,node_settlement_workflow,node_integrity_page,node_benchmark_page,node_creative_user toneBlue
class node_transaction_core,node_typed_subtypes,node_json_metadata,node_custom_fields,node_settlement_model toneAmber
class node_postgres,node_integrity_rules,node_allocation_safety toneMint
class node_read_model toneRose
```

## Components

### Application workflows

- [Flask application](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py): `code/app/app.py`
- [Transaction entry](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py): `code/app/app.py`
- [Settlement allocation](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py): `code/app/app.py`
- [Integrity tests](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py): `code/app/app.py`
- [Benchmark page](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/app/app.py): `code/app/app.py`

### Transaction model

- [Transaction core](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`
- [Typed subtypes](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`
- [Constrained JSONB](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`
- [Runtime fields](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`
- [Settlement model](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`

### Database integrity

- **PostgreSQL**
- [Integrity constraints](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`
- [Allocation locking](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`

### Read and evaluation

- [Materialized read model](https://github.com/aswin0603/domain-specific-relational-schema-framework-for-heterogeneous-transactions-in-small-creative-firms/blob/main/code/sql/schema.sql): `code/sql/schema.sql`

### Other components

- **Creative business user**

## Connections

- Creative business user → Flask application: uses (evidence: `README.md`)
- Flask application → PostgreSQL: queries and writes (evidence: `code/app/app.py`)
- Transaction entry → Transaction core: inserts transaction (evidence: `code/app/app.py`)
- Transaction entry → Typed subtypes: inserts subtype (evidence: `code/app/app.py`)
- Settlement allocation → Settlement model: records allocation (evidence: `code/app/app.py`)
- Integrity tests → Integrity constraints: tests constraints (evidence: `README.md`)
- Integrity constraints → Transaction core: constrains (evidence: `README.md`)
- Integrity constraints → Typed subtypes: guards subtype rows (evidence: `README.md`)
- Integrity constraints → Constrained JSONB: constrains metadata (evidence: `README.md`)
- Integrity constraints → Runtime fields: validates fields (evidence: `README.md`)
- Integrity constraints → Settlement model: checks allocations (evidence: `README.md`)
- Allocation locking → Settlement model: locks allocations (evidence: `README.md`)
- Flask application → Materialized read model: refreshes view (evidence: `code/app/app.py`)
- Benchmark page → PostgreSQL: compares schema performance (evidence: `README.md`)
