# nagasantoshchavvakula/automated-data-ingestion-pipeline architecture

> Architecture diagram of the GitHub repository nagasantoshchavvakula/automated-data-ingestion-pipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nagasantoshchavvakula/automated-data-ingestion-pipeline
- Repository: https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline

## Overview

This repository implements a multi-source ETL pipeline: CSV customers, JSON products, and REST API orders are extracted, transformed for data quality and relational integrity, and upserted into PostgreSQL. Airflow schedules database initialization and three parallel pipeline tasks, while main.py provides a sequential command-line entry point. The graph emphasizes the Airflow runtime; README documents capabilities such as retries, logging, validation, and idempotent loading. Unshown implementation details are represented only where documented.

Main entry points: [`main.py`](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/main.py) (CLI entry point), [`dags/dag_utils.py`](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/dags/dag_utils.py) (Task pipeline runners), [`pipeline/loaders/db_connection.py`](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/loaders/db_connection.py) (Database schema and sessions), [`pipeline/loaders/db_loader.py`](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/loaders/db_loader.py) (Idempotent loaders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Orchestration"]
  node_cli["CLI entry point<br/>[main.py]"]
  node_dag["Daily ETL DAG"]
  node_dag_runners["Task pipeline runners<br/>[dag_utils.py]"]
end

subgraph group_extraction["Extraction"]
  node_csv["CSV extraction<br/>[csv_extractor.py]"]
  node_json["JSON extraction<br/>[json_extractor.py]"]
  node_api["REST API extraction<br/>[api_extractor.py]"]
end

subgraph group_transformation["Transformation"]
  node_customer_transform["Customer cleaning"]
  node_product_transform["Product validation"]
  node_order_transform["Order mapping"]
end

subgraph group_persistence["Persistence"]
  node_db_loader["Idempotent loaders<br/>[db_loader.py]"]
  node_db_connection["Database schema and sessions<br/>[db_connection.py]"]
  node_db_config["Database configuration<br/>[config.py]"]
end

node_operator(("Pipeline operator"))
node_airflow(("Airflow scheduler"))
node_postgres[("PostgreSQL")]
node_customer_file["Customer CSV<br/>[customers.csv]"]
node_product_file["Product JSON<br/>[products.json]"]
node_orders_api{{"Orders API"}}

node_operator -->|"runs"| node_cli
node_cli -->|"initializes schema"| node_db_connection
node_cli -.->|"runs pipelines"| node_dag_runners
node_airflow -->|"schedules daily"| node_dag
node_dag -->|"initializes schema"| node_db_connection
node_dag -->|"dispatches tasks"| node_dag_runners
node_customer_file -->|"provides rows"| node_csv
node_product_file -->|"provides records"| node_json
node_orders_api -->|"serves records"| node_api
node_dag_runners -->|"extracts"| node_csv
node_dag_runners -->|"extracts"| node_json
node_dag_runners -->|"extracts"| node_api
node_dag_runners -->|"transforms"| node_customer_transform
node_dag_runners -->|"transforms"| node_product_transform
node_dag_runners -->|"transforms"| node_order_transform
node_dag_runners -->|"loads records"| node_db_loader
node_cli -->|"extracts"| node_csv
node_cli -->|"extracts"| node_json
node_cli -->|"extracts"| node_api
node_cli -->|"transforms"| node_customer_transform
node_cli -->|"transforms"| node_product_transform
node_cli -->|"transforms"| node_order_transform
node_cli -->|"loads records"| node_db_loader
node_db_loader -->|"uses models"| node_db_connection
node_db_connection -->|"uses URL"| node_db_config
node_db_connection -->|"creates schema"| node_postgres
node_db_loader -->|"upserts rows"| node_postgres

click node_cli "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/main.py"
click node_dag "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/dags/etl_ingestion_dag.py"
click node_dag_runners "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/dags/dag_utils.py"
click node_csv "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/extractors/csv_extractor.py"
click node_json "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/extractors/json_extractor.py"
click node_api "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/extractors/api_extractor.py"
click node_customer_transform "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/transformers/customer_transformer.py"
click node_product_transform "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/transformers/product_transformer.py"
click node_order_transform "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/transformers/order_transformer.py"
click node_db_loader "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/loaders/db_loader.py"
click node_db_connection "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/loaders/db_connection.py"
click node_db_config "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/config.py"
click node_customer_file "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/data/raw/customers.csv"
click node_product_file "https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/data/raw/products.json"

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_cli,node_dag,node_dag_runners toneBlue
class node_csv,node_json,node_api,node_postgres toneAmber
class node_customer_transform,node_product_transform,node_order_transform,node_orders_api toneMint
class node_db_loader,node_db_connection,node_db_config,node_airflow toneRose
class node_operator toneIndigo
class node_customer_file,node_product_file toneTeal
```

## Components

### Orchestration

- [CLI entry point](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/main.py): `main.py`
- [Daily ETL DAG](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/dags/etl_ingestion_dag.py): `dags/etl_ingestion_dag.py`
- [Task pipeline runners](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/dags/dag_utils.py): `dags/dag_utils.py`

### Extraction

- [CSV extraction](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/extractors/csv_extractor.py): `pipeline/extractors/csv_extractor.py`
- [JSON extraction](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/extractors/json_extractor.py): `pipeline/extractors/json_extractor.py`
- [REST API extraction](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/extractors/api_extractor.py): `pipeline/extractors/api_extractor.py`

### Transformation

- [Customer cleaning](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/transformers/customer_transformer.py): `pipeline/transformers/customer_transformer.py`
- [Product validation](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/transformers/product_transformer.py): `pipeline/transformers/product_transformer.py`
- [Order mapping](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/transformers/order_transformer.py): `pipeline/transformers/order_transformer.py`

### Persistence

- [Idempotent loaders](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/loaders/db_loader.py): `pipeline/loaders/db_loader.py`
- [Database schema and sessions](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/loaders/db_connection.py): `pipeline/loaders/db_connection.py`
- [Database configuration](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/pipeline/config.py): `pipeline/config.py`

### Other components

- **Pipeline operator**
- **Airflow scheduler**
- **PostgreSQL**
- [Customer CSV](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/data/raw/customers.csv): `data/raw/customers.csv`
- [Product JSON](https://github.com/nagasantoshchavvakula/automated-data-ingestion-pipeline/blob/main/data/raw/products.json): `data/raw/products.json`
- **Orders API**

## Connections

- Pipeline operator → CLI entry point: runs (evidence: `main.py`)
- CLI entry point → Database schema and sessions: initializes schema (evidence: `main.py`)
- CLI entry point → Task pipeline runners: runs pipelines
- Airflow scheduler → Daily ETL DAG: schedules daily (evidence: `dags/etl_ingestion_dag.py`)
- Daily ETL DAG → Database schema and sessions: initializes schema (evidence: `dags/etl_ingestion_dag.py`)
- Daily ETL DAG → Task pipeline runners: dispatches tasks (evidence: `dags/etl_ingestion_dag.py`)
- Customer CSV → CSV extraction: provides rows
- Product JSON → JSON extraction: provides records
- Orders API → REST API extraction: serves records (evidence: `README.md`)
- Task pipeline runners → CSV extraction: extracts (evidence: `dags/dag_utils.py`)
- Task pipeline runners → JSON extraction: extracts (evidence: `dags/dag_utils.py`)
- Task pipeline runners → REST API extraction: extracts (evidence: `dags/dag_utils.py`)
- Task pipeline runners → Customer cleaning: transforms (evidence: `dags/dag_utils.py`)
- Task pipeline runners → Product validation: transforms (evidence: `dags/dag_utils.py`)
- Task pipeline runners → Order mapping: transforms (evidence: `dags/dag_utils.py`)
- Task pipeline runners → Idempotent loaders: loads records (evidence: `dags/dag_utils.py`)
- CLI entry point → CSV extraction: extracts (evidence: `main.py`)
- CLI entry point → JSON extraction: extracts (evidence: `main.py`)
- CLI entry point → REST API extraction: extracts (evidence: `main.py`)
- CLI entry point → Customer cleaning: transforms (evidence: `main.py`)
- CLI entry point → Product validation: transforms (evidence: `main.py`)
- CLI entry point → Order mapping: transforms (evidence: `main.py`)
- CLI entry point → Idempotent loaders: loads records (evidence: `main.py`)
- Idempotent loaders → Database schema and sessions: uses models (evidence: `pipeline/loaders/db_loader.py`)
- Database schema and sessions → Database configuration: uses URL (evidence: `pipeline/loaders/db_connection.py`)
- Database schema and sessions → PostgreSQL: creates schema (evidence: `README.md`)
- Idempotent loaders → PostgreSQL: upserts rows (evidence: `README.md`)
