# ohitsmekatie/dbt-sample-project architecture

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

- Interactive diagram: https://gitdiagram.com/ohitsmekatie/dbt-sample-project
- Repository: https://github.com/ohitsmekatie/dbt-sample-project

## Overview

This is a dbt Core sample project that transforms public Google Analytics sample data in BigQuery into staging models and production-facing analytics marts. The documented workflow is to reference raw sources, clean and reshape them in staging, then publish final models. The README also describes schema customization and model documentation/testing configuration; the graph focuses on runtime data modeling. Source excerpts were not provided, so model-to-model dependencies are not asserted where the README does not identify them.

Main entry points: [`models/staging/sessions.sql`](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/staging/sessions.sql) (Session staging), [`models/marts/daily_campaign_metrics.sql`](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_campaign_metrics.sql) (Campaign metrics), [`models/marts/daily_site_metrics.sql`](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_site_metrics.sql) (Site metrics), [`models/marts/daily_top_paths.sql`](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_top_paths.sql) (Top paths)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Data inputs"]
  node_ga_data[("Google Analytics data")]
  node_warehouse[("BigQuery warehouse")]
end

subgraph group_staging["Staging models"]
  node_sessions["Session staging<br/>[sessions.sql]"]
end

subgraph group_marts["Analytics marts"]
  node_campaign_metrics["Campaign metrics"]
  node_site_metrics["Site metrics"]
  node_top_paths["Top paths"]
end

subgraph group_custom["dbt customization"]
  node_schema_macro["Schema naming macro"]
end

node_ga_data -->|"provides source"| node_sessions
node_sessions -->|"writes staging"| node_warehouse
node_campaign_metrics -->|"writes mart"| node_warehouse
node_site_metrics -->|"writes mart"| node_warehouse
node_top_paths -->|"writes mart"| node_warehouse
node_schema_macro -->|"customizes schema"| node_warehouse

click node_sessions "https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/staging/sessions.sql"
click node_campaign_metrics "https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_campaign_metrics.sql"
click node_site_metrics "https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_site_metrics.sql"
click node_top_paths "https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_top_paths.sql"
click node_schema_macro "https://github.com/ohitsmekatie/dbt-sample-project/blob/main/macros/generate_schema_name.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_ga_data,node_warehouse toneBlue
class node_sessions toneAmber
class node_campaign_metrics,node_site_metrics,node_top_paths toneMint
class node_schema_macro toneRose
```

## Components

### Data inputs

- **Google Analytics data**
- **BigQuery warehouse**

### Staging models

- [Session staging](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/staging/sessions.sql): `models/staging/sessions.sql`

### Analytics marts

- [Campaign metrics](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_campaign_metrics.sql): `models/marts/daily_campaign_metrics.sql`
- [Site metrics](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_site_metrics.sql): `models/marts/daily_site_metrics.sql`
- [Top paths](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/models/marts/daily_top_paths.sql): `models/marts/daily_top_paths.sql`

### dbt customization

- [Schema naming macro](https://github.com/ohitsmekatie/dbt-sample-project/blob/main/macros/generate_schema_name.sql): `macros/generate_schema_name.sql`

## Connections

- Google Analytics data → Session staging: provides source (evidence: `README.md`)
- Session staging → BigQuery warehouse: writes staging (evidence: `README.md`)
- Campaign metrics → BigQuery warehouse: writes mart (evidence: `README.md`)
- Site metrics → BigQuery warehouse: writes mart (evidence: `README.md`)
- Top paths → BigQuery warehouse: writes mart (evidence: `README.md`)
- Schema naming macro → BigQuery warehouse: customizes schema (evidence: `README.md`)
