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
- Create the Snowflake RAW database and load sample data.
- Create Bronze models that standardize source tables.
- Build Silver intermediate models at the correct business grain.
- Build Gold dimensions and facts for reusable analytics.
- Build Mart models for dashboard-specific consumption.
The next pages contain the SQL and verification output for each layer.
Continue with 04. Bronze Layer.