Folder structure
dbt Labs has developed a project structure guide that contains a number of recommendations for how to build the folder structure for your project. Do check out that guide if you want to learn more. Right now we are going to create some folders to organize our files:
- Sources — This is our Formula 1 dataset and it will be defined in a source YAML file.
- Staging models — These models have a 1:1 with their source table.
- Intermediate — This is where we will be joining some Formula staging models.
- Marts models — Here is where we perform our major transformations. It contains these subfolders:
- aggregates
- core
- ml
In your file tree, use your cursor and hover over the
models
subdirectory, click the three dots … that appear to the right of the folder name, then select Create Folder. We're going to add two new folders to the file path,staging
andformula1
(in that order) by typingstaging/formula1
into the file path.Create folder
Set file path
- If you click into your
models
directory now, you should see the newstaging
folder nested withinmodels
and theformula1
folder nested withinstaging
.
- If you click into your
Create two additional folders the same as the last step. Within the
models
subdirectory, create new directoriesmarts/core
.We will need to create a few more folders and subfolders using the UI. After you create all the necessary folders, your folder tree should look like this when it's all done:
File tree of new folders
Remember you can always reference the entire project in GitHub to view the complete folder and file strucutre.