This is a template for creating new dbt projects with a standardized structure.
project_name/ ├── analyses/ ├── macros/ ├── models/ │ ├── core/ │ ├── metrics/ │ └── staging/ ├── seeds/ ├── snapshots/ ├── tests/ └── dbt_project.yml
- Clone this template repository
- Rename the project:
- Update
name
indbt_project.yml
- Update
profile
indbt_project.yml
- Update the models config section in
dbt_project.yml
to match your project name
- Update
Create a profile in your ~/.dbt/profiles.yml
:
project_name: # Should match the profile name in dbt_project.yml
target: dev
outputs:
dev:
type: [warehouse_type] # snowflake, bigquery, redshift, etc.
models/staging/
: Raw data transformationsmodels/core/
: Business logic transformationsmodels/metrics/
: Metric calculations and aggregationsanalyses/
: Ad-hoc analysesmacros/
: Reusable SQL functionsseeds/
: Static data filessnapshots/
: Type 2 SCD trackingtests/
: Custom data tests
All models are configured to materialize as tables by default. Modify the materialization settings in dbt_project.yml
as needed for your use case.
- Follow dbt best practices
- Use consistent naming conventions
- Document your models using dbt docs
- Write tests for your models
- dbt-core
- (List any additional packages you're using)