Skip to main content

03. dbt Project Structure

Project Structure​

Use this structure for beems_techne_ecomm_dbt:

beems_techne_ecomm_dbt/
│
├── dbt_project.yml
├── packages.yml
├── README.md
├── profiles.yml
│
├── models/
│ │
│ ├── bronze/
│ │ ├── customers/
│ │ │ ├── stg_customers.sql
│ │ │ ├── stg_customer_addresses.sql
│ │ │ └── schema.yml
│ │ │
│ │ ├── orders/
│ │ │ ├── stg_orders.sql
│ │ │ ├── stg_order_items.sql
│ │ │ ├── stg_shipments.sql
│ │ │ ├── stg_returns.sql
│ │ │ ├── stg_promotions.sql
│ │ │ └── schema.yml
│ │ │
│ │ ├── products/
│ │ │ ├── stg_products.sql
│ │ │ ├── stg_categories.sql
│ │ │ ├── stg_inventory_snapshots.sql
│ │ │ ├── stg_product_reviews.sql
│ │ │ └── schema.yml
│ │ │
│ │ └── payments/
│ │ ├── stg_payments.sql
│ │ └── schema.yml
│ │
│ ├── silver/
│ │ ├── int_customer_orders.sql
│ │ ├── int_order_details.sql
│ │ ├── int_payment_details.sql
│ │ └── schema.yml
│ │
│ ├── gold/
│ │ ├── dimensions/
│ │ │ ├── dim_customers.sql
│ │ │ ├── dim_products.sql
│ │ │ ├── dim_sellers.sql
│ │ │ └── dim_date.sql
│ │ ├── facts/
│ │ │ ├── fct_orders.sql
│ │ │ ├── fct_order_items.sql
│ │ │ ├── fct_payments.sql
│ │ │ ├── fct_deliveries.sql
│ │ │ └── fct_returns.sql
│ │ └── schema.yml
│ │
│ └── mart/
│ ├── customer_360.sql
│ ├── sales_performance.sql
│ ├── product_performance.sql
│ ├── seller_performance.sql
│ ├── daily_ecommerce_kpi.sql
│ └── schema.yml
│
├── snapshots/
│ ├── customers_snapshot.sql
│ ├── products_snapshot.sql
│ └── orders_snapshot.sql
│
├── macros/
│ ├── calculate_age.sql
│ ├── safe_divide.sql
│ └── generate_surrogate_key.sql
│
├── seeds/
│ ├── state_region_mapping.csv
│ ├── category_mapping.csv
│ └── payment_method_mapping.csv
│
├── tests/
│ ├── assert_positive_order_amount.sql
│ ├── assert_valid_order_dates.sql
│ └── assert_no_duplicate_orders.sql
│
└── analyses/
└── monthly_sales_analysis.sql

How to Work Through the Project​

  1. Create the Snowflake RAW database and load sample data.
  2. Create Bronze models that standardize source tables.
  3. Build Silver intermediate models at the correct business grain.
  4. Build Gold dimensions and facts for reusable analytics.
  5. Build Mart models for dashboard-specific consumption.

The next pages contain the SQL and verification output for each layer.

Continue with 04. Bronze Layer.