Skip to content

Commit da7b07f

Browse files
authored
Merge pull request #11 from Shanabunga/add-docs
Add Project, Repo & Architecture Documentation
2 parents becd5c0 + 1984798 commit da7b07f

4 files changed

Lines changed: 86 additions & 7 deletions

File tree

README.md

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,58 @@
1-
Welcome to your new dbt project!
1+
## Our dbt Project
2+
This repository consists of a [dbt](https://www.getdbt.com/) project that transforms raw data sources into clear, formatted models for Analytics.
23

3-
### Using the starter project
4+
To learn more about the overall architecture design & strategy can be found in our centralized handbook:
5+
- [Data Architecture Handbook](https://docs.google.com/document/d/1WmOnx_5QaGmo-kNWitd9jSEwvEnwqxiS0ZA1jmMV-v0/edit?usp=sharing)
46

5-
Try running the following commands:
6-
- dbt run
7-
- dbt test
7+
### Sources:
8+
Raw, unformatted data loaded directly from source systems using various data tools.
9+
- `nba_data` - The primary source of NBA statistics data captured from an API & loaded via Sling/Airbyte.
10+
- Schema: `analytics.raw_nba_data`
11+
- `google_sheets` - Internally maintained reference sheets related to the project & loaded via Sling/Airbyte.
12+
- Schema: `analytics.raw_google_sheets`
813

914

15+
### Environments:
16+
Transformed data models built via dbt with 3 distinct environments to enable a sustainable development workflow.
17+
- **Development**
18+
- Schema: `analytics.dev_[your-name]`
19+
- One per developer to avoid conflicts or overriding changes during development.
20+
- **CI**
21+
- Schema: `analytics.ci`
22+
- An isolated schema created specifically for testing Pull Request changes to ensure quality.
23+
- **Production**
24+
- Schemas:
25+
- `analytics.staging`
26+
- `analytics.warehouse`
27+
- `analytics.marts`
28+
- Separation by layer for easier navigation and permission management.
29+
30+
### How to Get Started?
31+
1. Create your local development environment
32+
- Use a local IDE (ex. VS Code), dbt Cloud or GitHub Codespaces
33+
2. Clone the current repo (or create a new one)
34+
- Checkout the `main` branch and run `git pull` to sync changes
35+
3. Create a New Branch for your new changes
36+
- First, run `git branch your_branch_name` to create a new branch
37+
- Then run `git checkout your_branch_name` to switch to it
38+
4. Start developing!
39+
- Commit & Sync all changes to your branch during development
40+
- *IMPORTANT* - All changes should follow the team [Style Guide](_project_docs/style_guide.md)
41+
5. Create Pull Request
42+
- When development is complete, Push your branch to GitHub & create a request
43+
- Request peer reviews & confirm automated CI jobs succeed
44+
6. Merge changes to the `main` branch
45+
- Confirm automated post-merge jobs succeed
46+
7. Get latest changes in your local environment
47+
- Checkout the `main` branch in your local terminal
48+
- Run "git pull" to sync the latest version of the code
49+
8. Continue to develop & repeat the process
50+
51+
### Notes
52+
- Provide any other important call-outs of platform-specific information here.
53+
1054
### Resources:
1155
- Learn more about dbt [in the docs](https://docs.getdbt.com/docs/introduction)
1256
- Check out [Discourse](https://discourse.getdbt.com/) for commonly asked questions and answers
1357
- Join the [chat](https://community.getdbt.com/) on Slack for live discussions and support
14-
- Find [dbt events](https://events.getdbt.com) near you
15-
- Check out [the blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices
58+
- Check out [the blog](https://blog.getdbt.com/) for the latest news on dbt's development and best practices

macros/_macros__definitions.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 2
2+
3+
macros:
4+
- name: generate_schema_name
5+
description: '{{ doc("generate_schema_name_description") }}'

macros/_macros__docs.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{% docs generate_schema_name_description %}
2+
This is a built-in dbt macro that changes the dataset name based on `target` and `+schema` config.
3+
4+
* If `target` == `prod`, then models will deploy to separate datasets based on `+schema` config set in `dbt_project.yml`. For example:
5+
* `staging`
6+
* `warehouse`
7+
* For any non-`prod` deployment, all models will deploy to the default dataset as indicated in `profiles.yml`. For example:
8+
* `dev_mkahan`
9+
* `dev_jdoe`
10+
11+
More information can be found at the dbt docs site [here](https://docs.getdbt.com/docs/building-a-dbt-project/building-models/using-custom-schemas#how-does-dbt-generate-a-models-schema-name)
12+
13+
{% enddocs %}

models/marts/_marts__docs.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{% docs nba_games_detail_description %}
2+
A breakdown of metrics & other context related to individual `games`.
3+
4+
This model is presented on a `game`-level granularity and built with reusability in mind. The expectations is that the data will be aggregated in various ways but access to the underlying data points will still be desired. Example aggregations include by date, team, conference, coach, etc.
5+
6+
The metrics in this model include (but not limited to):
7+
* Total games played
8+
* Home/away scores
9+
* Point differentials
10+
* Home vs Away wins
11+
12+
Other game & team related detail inslude (but not limited to):
13+
* Team Names
14+
* Head Coaches
15+
* General Managers
16+
* Day Info (Date, Weekday, Month)
17+
* Game Status (Regulation, Overtime)
18+
{% enddocs %}

0 commit comments

Comments
 (0)