# donbugan/ebitda-dashboard architecture

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

- Interactive diagram: https://gitdiagram.com/donbugan/ebitda-dashboard
- Repository: https://github.com/donbugan/ebitda-dashboard

## Overview

This repository is an early-stage EBITDA Power BI dashboard project, not yet a complete dashboard application. Its documented goal is to present Revenue through EBITDA, but the README lists loading, star-schema measures, and visuals as next steps. The current tree contains SQL schemas, transformations and SEC/DA tag-discovery queries, plus helper scripts and data directories. No source excerpts were provided, so relationships below are limited to data stages and purpose explicitly described in the README; SQL and script interactions are not inferred from filenames.

Main entry points: [`data/raw`](https://github.com/donbugan/ebitda-dashboard/tree/development/data/raw) (Raw data), [`data/interim`](https://github.com/donbugan/ebitda-dashboard/tree/development/data/interim) (Interim data), [`docs/metric_definitions.md`](https://github.com/donbugan/ebitda-dashboard/blob/development/docs/metric_definitions.md) (Metric definitions), [`sql/01_schemas.sql`](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/01_schemas.sql) (Schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data stages"]
  node_raw[("Raw data")]
  node_interim[("Interim data")]
  node_processed[("Processed data")]
end

subgraph group_sql["SQL model"]
  node_schemas["Schemas<br/>[01_schemas.sql]"]
  node_tables["Table creation"]
  node_transforms["Transformations<br/>[02_transforms.sql]"]
  node_rawcountsddl["Raw count DDL"]
  node_rawcountscopy["Raw count copy"]
  node_companycopy["Selected companyfacts copy"]
  node_sectags["SEC tag discovery"]
  node_datags["DA tag discovery"]
  node_selectedtags["Selected tags"]
end

subgraph group_metrics["EBITDA metrics"]
  node_metricdefs["Metric definitions"]
  node_dashboard["EBITDA dashboard"]
end

subgraph group_ops["Data access"]
  node_extract["Companyfacts extraction"]
  node_psql["SQL runner<br/>[20_psql_file.sh]"]
  node_postgres[("PostgreSQL service<br/>[docker-compose.yml]")]
end

node_dataset(("Source dataset"))

node_dataset -->|"stores originals"| node_raw
node_raw -->|"cleaned outputs"| node_interim
node_interim -->|"curated outputs"| node_processed
node_schemas -.->|"supports model"| node_dashboard
node_transforms -.->|"supports metrics"| node_dashboard
node_metricdefs -->|"defines metrics"| node_dashboard
node_dashboard -->|"Revenue to EBITDA"| node_metricdefs

click node_raw "https://github.com/donbugan/ebitda-dashboard/tree/development/data/raw"
click node_interim "https://github.com/donbugan/ebitda-dashboard/tree/development/data/interim"
click node_processed "https://github.com/donbugan/ebitda-dashboard/tree/development/data/processed"
click node_schemas "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/01_schemas.sql"
click node_tables "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/01_create_tables.sql"
click node_transforms "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/02_transforms.sql"
click node_rawcountsddl "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/10_raw_line_item_counts_ddl.sql"
click node_rawcountscopy "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/11_raw_line_item_counts_copy.sql"
click node_companycopy "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/20_copy_companyfact_selected.sql"
click node_sectags "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/discovery/10_sec_tag_discovery.sql"
click node_datags "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/discovery/11_da_tag_discovery.sql"
click node_selectedtags "https://github.com/donbugan/ebitda-dashboard/blob/development/sql/discovery/12_selected_tags.sql"
click node_metricdefs "https://github.com/donbugan/ebitda-dashboard/blob/development/docs/metric_definitions.md"
click node_extract "https://github.com/donbugan/ebitda-dashboard/blob/development/scripts/30_extract_companyfacts_selected.sh"
click node_psql "https://github.com/donbugan/ebitda-dashboard/blob/development/scripts/20_psql_file.sh"
click node_postgres "https://github.com/donbugan/ebitda-dashboard/blob/development/docker/docker-compose.yml"

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_raw,node_interim,node_processed toneBlue
class node_schemas,node_tables,node_transforms,node_rawcountsddl,node_rawcountscopy,node_companycopy,node_sectags,node_datags,node_selectedtags toneAmber
class node_metricdefs,node_dashboard toneMint
class node_extract,node_psql,node_postgres toneRose
class node_dataset toneIndigo
```

## Components

### Data stages

- [Raw data](https://github.com/donbugan/ebitda-dashboard/tree/development/data/raw): `data/raw`
- [Interim data](https://github.com/donbugan/ebitda-dashboard/tree/development/data/interim): `data/interim`
- [Processed data](https://github.com/donbugan/ebitda-dashboard/tree/development/data/processed): `data/processed`

### SQL model

- [Schemas](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/01_schemas.sql): `sql/01_schemas.sql`
- [Table creation](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/01_create_tables.sql): `sql/01_create_tables.sql`
- [Transformations](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/02_transforms.sql): `sql/02_transforms.sql`
- [Raw count DDL](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/10_raw_line_item_counts_ddl.sql): `sql/10_raw_line_item_counts_ddl.sql`
- [Raw count copy](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/11_raw_line_item_counts_copy.sql): `sql/11_raw_line_item_counts_copy.sql`
- [Selected companyfacts copy](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/20_copy_companyfact_selected.sql): `sql/20_copy_companyfact_selected.sql`
- [SEC tag discovery](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/discovery/10_sec_tag_discovery.sql): `sql/discovery/10_sec_tag_discovery.sql`
- [DA tag discovery](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/discovery/11_da_tag_discovery.sql): `sql/discovery/11_da_tag_discovery.sql`
- [Selected tags](https://github.com/donbugan/ebitda-dashboard/blob/development/sql/discovery/12_selected_tags.sql): `sql/discovery/12_selected_tags.sql`

### EBITDA metrics

- [Metric definitions](https://github.com/donbugan/ebitda-dashboard/blob/development/docs/metric_definitions.md): `docs/metric_definitions.md`
- **EBITDA dashboard**

### Data access

- [Companyfacts extraction](https://github.com/donbugan/ebitda-dashboard/blob/development/scripts/30_extract_companyfacts_selected.sh): `scripts/30_extract_companyfacts_selected.sh`
- [SQL runner](https://github.com/donbugan/ebitda-dashboard/blob/development/scripts/20_psql_file.sh): `scripts/20_psql_file.sh`
- [PostgreSQL service](https://github.com/donbugan/ebitda-dashboard/blob/development/docker/docker-compose.yml): `docker/docker-compose.yml`

### Other components

- **Source dataset**

## Connections

- Source dataset → Raw data: stores originals (evidence: `README.md`)
- Raw data → Interim data: cleaned outputs (evidence: `README.md`)
- Interim data → Processed data: curated outputs (evidence: `README.md`)
- Schemas → EBITDA dashboard: supports model
- Transformations → EBITDA dashboard: supports metrics
- Metric definitions → EBITDA dashboard: defines metrics (evidence: `README.md`)
- EBITDA dashboard → Metric definitions: Revenue to EBITDA (evidence: `README.md`)
