# darshilparmar/zomato-ai-data-engineering-end-to-end-project architecture

> Architecture diagram of the GitHub repository darshilparmar/zomato-ai-data-engineering-end-to-end-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project
- Repository: https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project

## Overview

This repository implements a batch food-delivery analytics platform: source CSVs land in S3, load into Snowflake, and are transformed by dbt into staging views, dimensions, facts, and business marts. Airflow schedules the load, core transformations, review enrichment, and AI marts. Separate AI applications provide review search/chat and natural-language warehouse queries. The README documents the broad architecture; sampled code confirms the Airflow tasks, enrichment behavior, and text-to-SQL flow. RAG implementation details and some dbt dependencies were not sampled.

Main entry points: [`snowflake/04_raw_tables.sql`](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/04_raw_tables.sql) (Raw Tables), [`airflow/dags/zomato_batch.py`](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/airflow/dags/zomato_batch.py) (Daily DAG), [`ai/enrich_reviews.py`](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/enrich_reviews.py) (Review Enrichment), [`zomato/models/staging`](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/staging) (Silver Staging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingestion"]
  node_s3[("S3 Data Lake")]
  node_snowflake_raw[("Raw Tables<br/>[04_raw_tables.sql]")]
  node_snowflake_setup["Snowflake Setup<br/>[01_setup.sql]"]
  node_s3_integration["Storage Integration"]
  node_stage_format["Stage and Formats"]
  node_copy_sql["Raw Load SQL<br/>[05_copy_into.sql]"]
end

subgraph group_warehouse["Warehouse Modeling"]
  node_staging[("Silver Staging")]
  node_dimensions[("Gold Dimensions")]
  node_facts[("Incremental Facts")]
  node_business_marts[("Business Marts")]
  node_ai_mart[("Review Insights Mart")]
end

subgraph group_orchestration["Orchestration"]
  node_airflow["Daily DAG<br/>[zomato_batch.py]"]
  node_dbt_core["Core dbt Build<br/>[dbt_project.yml]"]
  node_dbt_ai["AI dbt Build<br/>[dbt_project.yml]"]
end

subgraph group_ai["AI Applications"]
  node_enrichment["Review Enrichment<br/>[enrich_reviews.py]"]
  node_review_table[("Enriched Reviews")]
  node_rag["Review RAG Chat<br/>[rag_chat.py]"]
  node_text_sql["Text-to-SQL App<br/>[text_to_sql.py]"]
end

node_dataset["Food CSVs"]
node_openai["OpenAI"]
node_snowflake[("Snowflake")]
node_user(("Analyst"))

node_dataset -->|"uploads CSVs"| node_s3
node_s3 -->|"loads raw data"| node_snowflake_raw
node_s3_integration -->|"configures access"| node_snowflake
node_stage_format -->|"configures stage"| node_snowflake_raw
node_copy_sql -->|"copies into"| node_snowflake_raw
node_snowflake_raw -->|"cleans sources"| node_staging
node_staging -->|"models dimensions"| node_dimensions
node_staging -->|"models facts"| node_facts
node_dimensions -->|"supports marts"| node_business_marts
node_facts -->|"supports marts"| node_business_marts
node_review_table -->|"models insights"| node_ai_mart
node_airflow -->|"runs COPY"| node_snowflake_raw
node_airflow -->|"runs core build"| node_dbt_core
node_airflow -->|"runs enrichment"| node_enrichment
node_airflow -->|"runs AI build"| node_dbt_ai
node_enrichment -->|"reads reviews"| node_snowflake_raw
node_enrichment -->|"classifies reviews"| node_openai
node_enrichment -->|"writes results"| node_review_table
node_rag -->|"embeds and answers"| node_openai
node_rag -->|"retrieves reviews"| node_snowflake
node_user -->|"asks question"| node_text_sql
node_text_sql -->|"generates SQL"| node_openai
node_text_sql -->|"runs query"| node_snowflake

click node_snowflake_raw "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/04_raw_tables.sql"
click node_snowflake_setup "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/01_setup.sql"
click node_s3_integration "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/02_storage_integration.sql"
click node_stage_format "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/03_stage_and_formats.sql"
click node_copy_sql "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/05_copy_into.sql"
click node_staging "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/staging"
click node_dimensions "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/marts"
click node_facts "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/marts"
click node_business_marts "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/marts"
click node_ai_mart "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/zomato/models/marts/mart_review_insights.sql"
click node_airflow "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/airflow/dags/zomato_batch.py"
click node_dbt_core "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/zomato/dbt_project.yml"
click node_dbt_ai "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/zomato/dbt_project.yml"
click node_enrichment "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/enrich_reviews.py"
click node_rag "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/rag_chat.py"
click node_text_sql "https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/text_to_sql.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_s3,node_snowflake_raw,node_snowflake_setup,node_s3_integration,node_stage_format,node_copy_sql toneBlue
class node_staging,node_dimensions,node_facts,node_business_marts,node_ai_mart,node_snowflake toneAmber
class node_airflow,node_dbt_core,node_dbt_ai toneMint
class node_enrichment,node_review_table,node_rag,node_text_sql toneRose
class node_dataset,node_openai,node_user toneIndigo
```

## Components

### Ingestion

- **S3 Data Lake**
- [Raw Tables](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/04_raw_tables.sql): `snowflake/04_raw_tables.sql`
- [Snowflake Setup](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/01_setup.sql): `snowflake/01_setup.sql`
- [Storage Integration](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/02_storage_integration.sql): `snowflake/02_storage_integration.sql`
- [Stage and Formats](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/03_stage_and_formats.sql): `snowflake/03_stage_and_formats.sql`
- [Raw Load SQL](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/snowflake/05_copy_into.sql): `snowflake/05_copy_into.sql`

### Warehouse Modeling

- [Silver Staging](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/staging): `zomato/models/staging`
- [Gold Dimensions](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/marts): `zomato/models/marts`
- [Incremental Facts](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/marts): `zomato/models/marts`
- [Business Marts](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/tree/main/zomato/models/marts): `zomato/models/marts`
- [Review Insights Mart](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/zomato/models/marts/mart_review_insights.sql): `zomato/models/marts/mart_review_insights.sql`

### Orchestration

- [Daily DAG](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/airflow/dags/zomato_batch.py): `airflow/dags/zomato_batch.py`
- [Core dbt Build](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/zomato/dbt_project.yml): `zomato/dbt_project.yml`
- [AI dbt Build](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/zomato/dbt_project.yml): `zomato/dbt_project.yml`

### AI Applications

- [Review Enrichment](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/enrich_reviews.py): `ai/enrich_reviews.py`
- **Enriched Reviews**
- [Review RAG Chat](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/rag_chat.py): `ai/rag_chat.py`
- [Text-to-SQL App](https://github.com/darshilparmar/zomato-ai-data-engineering-end-to-end-project/blob/main/ai/text_to_sql.py): `ai/text_to_sql.py`

### Other components

- **Food CSVs**
- **OpenAI**
- **Snowflake**
- **Analyst**

## Connections

- Food CSVs → S3 Data Lake: uploads CSVs (evidence: `README.md`)
- S3 Data Lake → Raw Tables: loads raw data (evidence: `README.md`)
- Storage Integration → Snowflake: configures access
- Stage and Formats → Raw Tables: configures stage (evidence: `README.md`)
- Raw Load SQL → Raw Tables: copies into
- Raw Tables → Silver Staging: cleans sources (evidence: `README.md`)
- Silver Staging → Gold Dimensions: models dimensions (evidence: `README.md`)
- Silver Staging → Incremental Facts: models facts (evidence: `README.md`)
- Gold Dimensions → Business Marts: supports marts (evidence: `README.md`)
- Incremental Facts → Business Marts: supports marts (evidence: `README.md`)
- Enriched Reviews → Review Insights Mart: models insights (evidence: `README.md`)
- Daily DAG → Raw Tables: runs COPY (evidence: `airflow/dags/zomato_batch.py`)
- Daily DAG → Core dbt Build: runs core build (evidence: `airflow/dags/zomato_batch.py`)
- Daily DAG → Review Enrichment: runs enrichment (evidence: `airflow/dags/zomato_batch.py`)
- Daily DAG → AI dbt Build: runs AI build (evidence: `airflow/dags/zomato_batch.py`)
- Review Enrichment → Raw Tables: reads reviews (evidence: `ai/enrich_reviews.py`)
- Review Enrichment → OpenAI: classifies reviews (evidence: `ai/enrich_reviews.py`)
- Review Enrichment → Enriched Reviews: writes results (evidence: `ai/enrich_reviews.py`)
- Review RAG Chat → OpenAI: embeds and answers (evidence: `README.md`)
- Review RAG Chat → Snowflake: retrieves reviews (evidence: `README.md`)
- Analyst → Text-to-SQL App: asks question (evidence: `ai/text_to_sql.py`)
- Text-to-SQL App → OpenAI: generates SQL (evidence: `ai/text_to_sql.py`)
- Text-to-SQL App → Snowflake: runs query (evidence: `ai/text_to_sql.py`)
