|
7 | 7 | # Create the diagram |
8 | 8 | with Diagram("Snowflake Data Pipeline", show=True, direction="LR"): |
9 | 9 | # GitHub Actions for scheduling |
10 | | - github_actions = PredefinedProcess("GitHub Actions (Scheduler)") |
| 10 | + github_actions = Custom("GitHub Actions (Scheduler)", "./services/diagrams/src/github-actions.png") |
11 | 11 |
|
12 | 12 | # Fred Website Cluster (Frontend) |
13 | 13 | with Cluster("Fred Website"): |
14 | | - frontend = Custom("Fred Website", "./services/diagrams/src/fred-logo.png") |
| 14 | + fred = Custom("Fred Website", "./services/diagrams/src/fred-logo.png") |
15 | 15 |
|
16 | 16 | # AWS S3 Bucket for storing data |
17 | 17 | with Cluster("AWS"): |
18 | 18 | s3_bucket = S3("AWS S3 Bucket") |
19 | 19 |
|
20 | 20 | # Snowflake environment |
21 | | - with Cluster("Snowflake"): |
| 21 | + with Cluster("Snowflake", direction="TB"): |
22 | 22 | raw_table = Snowflake("Raw Table") |
23 | 23 | harmonized_table = Snowflake("Harmonized Table") |
24 | | - snowflake_task = Snowflake("Snowflake Task (ETL Processing)") |
| 24 | + snowflake_task = Snowflake("Snowflake Task \n(ETL Processing)") |
25 | 25 | analytics_table = Snowflake("Analytics Table") |
26 | 26 |
|
27 | 27 | # Streamlit Dashboard Cluster (Frontend) |
28 | 28 | with Cluster("Frontend (Streamlit)") as frontend_cluster: |
29 | 29 | streamlit_app = Custom("Streamlit UI", "./services/diagrams/src/streamlit.png") |
30 | 30 |
|
31 | 31 | # Data pipeline flow |
32 | | - github_actions >> Edge(label="Extract FRED API Data (Daily)") >> s3_bucket |
33 | | - s3_bucket >> Edge(label="Load to Raw Tables") >> raw_table |
34 | | - raw_table >> Edge(label="Transform to Harmonized Schema") >> harmonized_table |
35 | | - harmonized_table >> Edge(label="Trigger Snowflake Task") >> snowflake_task |
36 | | - snowflake_task >> Edge(label="Load to Analytics") >> analytics_table |
37 | | - analytics_table >> Edge(label="Visualize Data") >> streamlit_app |
| 32 | + fred >> Edge(label="Extract Data from Fred API")>> github_actions |
| 33 | + github_actions >> Edge(label="Stage Data in S3") >> s3_bucket |
| 34 | + s3_bucket >> Edge(label="Load Raw Tables") >> raw_table |
| 35 | + raw_table >> Edge(label="Harmonized Schema") >> harmonized_table |
| 36 | + analytics_table >> Edge(label="Orchestrate Jobs") >> snowflake_task |
| 37 | + harmonized_table >> Edge(label="Load to Analytics") >> analytics_table |
| 38 | + analytics_table >> streamlit_app |
| 39 | + streamlit_app >> analytics_table |
38 | 40 |
|
0 commit comments