# julianchisco93/supply-chain-shipment-summary-tool architecture

> Architecture diagram of the GitHub repository julianchisco93/supply-chain-shipment-summary-tool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-05-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/julianchisco93/supply-chain-shipment-summary-tool
- Repository: https://github.com/julianchisco93/supply-chain-shipment-summary-tool

## Overview

1. **Project type and runtime**
   This is a small, local Python analytics application, not a service. Its core runtime is a script-based workflow driven by `main.py`, with Jupyter notebooks used for module-level validation and demos.

2. **Primary data boundary**
   The system centers on one source dataset in `data/supply_delivery_history.csv`. That raw file is treated as the input boundary; a cleaned derivative, `data/supply_delivery_history_clean.csv`, is the analysis-ready output boundary.

3. **Ingestion and loading layer**
   `src/data_loader.py` is the entry point for reading the shipment CSV into memory, likely into a pandas DataFrame. This module isolates file access from downstream analysis so the rest of the code can operate on a consistent in-memory dataset.

4. **Cleaning pipeline**
   `src/cleaning.py` prepares the raw shipment records for analysis. Based on the README, it handles inconsistent dates, numeric coercion, missing values, and categorical normalization, then writes the cleaned CSV back to `data/`. This is the main transformation boundary between raw data and reliable analytics.

5. **Shared shipment summary layer**
   `src/shipment_summary.py` provides cross-cutting metrics about shipment activity, such as shipment mode, fulfillment type, delivery year, shipment volume, shipment value, freight cost, and delivery delay. It is the general-purpose operational summary module used to create a broad supply-chain overview.

6. **Country-focused analytics**
   `src/country_analysis.py` groups shipments by destination country and produces measures like quantity, value, count, and top countries by revenue. This module represents a location-based aggregation boundary, separate from product and vendor concerns.

7. **Product-focused analytics**
   `src/product_analysis.py` analyzes shipment behavior by product group, subclassification, and product description. Its role is to convert line-item shipment records into product portfolio insights, such as top products by quantity and category distribution.

8. **Vendor-focused analytics**
   `src/vendor_analysis.py` evaluates supplier performance using shipment record counts, total quantity, total value, and ranking outputs for top and bottom vendors. This module is the vendor-domain boundary and likely feeds the vendor charts and summary tables described in the README.

9. **Integration and orchestration**
   `main.py` is the orchestration layer. It ties together loading, cleaning, saving the cleaned dataset, and then running shipment, country, product, and vendor analyses in one workflow. Conceptually, it is the only place where the full end-to-end execution path is assembled.

10. **Exploration, validation, and outputs**
    The `notebooks/` folder contains demo notebooks for individual subsystems, so they function as a testing and exploration layer rather than production code. Output artifacts include printed tables, charts, and screenshots under `reports/screenshots/`, which suggests the application is primarily a local reporting tool rather than an API or database-backed system.

11. **Dependencies and technology choices**
    The architecture is built around pandas/numpy for data manipulation and matplotlib/seaborn for visualization, with Jupyter for validation. These libraries shape the design: file-based ETL, DataFrame-centric transformations, and chart generation, all without an external database or web framework.

12. **Repository structure as modular boundaries**
    The code is intentionally split by concern: loader, cleaner, shipment summary, country, product, and vendor. That separation makes the architecture easy to diagram as a pipeline: raw CSV in, cleaning in the middle, multiple independent analytical branches out, with `main.py` coordinating the full run.

Main entry points: [`main.py`](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/main.py) (Main), [`notebooks`](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/tree/main/notebooks) (Notebooks), [`data/supply_delivery_history_clean.csv`](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/data/supply_delivery_history_clean.csv) (Clean CSV), [`src/data_loader.py`](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/data_loader.py) (Loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data boundary"]
  node_raw_csv["Raw CSV<br/>source data"]
  node_clean_csv["Clean CSV<br/>derived data"]
end

subgraph group_core["Core workflow"]
  node_main["Main<br/>orchestrator<br/>[main.py]"]
  node_loader["Loader<br/>ingestion<br/>[data_loader.py]"]
  node_cleaning["Cleaning<br/>transform<br/>[cleaning.py]"]
end

subgraph group_analytics["Analytics modules"]
  node_summary["Shipment summary<br/>shared metrics"]
  node_country["Country analysis<br/>location analytics"]
  node_product["Product analysis<br/>product analytics"]
  node_vendor["Vendor analysis<br/>supplier analytics<br/>[vendor_analysis.py]"]
end

subgraph group_validation["Exploration and reports"]
  node_notebooks(("Notebooks"))
  node_reports(("Reports<br/>output artifacts"))
end

node_raw_csv -->|"read"| node_loader
node_loader -->|"dataframe"| node_cleaning
node_cleaning -->|"write"| node_clean_csv
node_clean_csv -->|"analyze"| node_summary
node_clean_csv -->|"analyze"| node_country
node_clean_csv -->|"analyze"| node_product
node_clean_csv -->|"analyze"| node_vendor
node_main -->|"runs"| node_loader
node_main -->|"runs"| node_cleaning
node_main -->|"runs"| node_summary
node_main -->|"runs"| node_country
node_main -->|"runs"| node_product
node_main -->|"runs"| node_vendor
node_notebooks -.->|"validate"| node_loader
node_notebooks -.->|"validate"| node_cleaning
node_notebooks -.->|"validate"| node_summary
node_notebooks -.->|"validate"| node_country
node_notebooks -.->|"validate"| node_product
node_notebooks -.->|"validate"| node_vendor
node_summary -.->|"visualize"| node_reports
node_country -.->|"visualize"| node_reports
node_product -.->|"visualize"| node_reports
node_vendor -.->|"visualize"| node_reports

click node_raw_csv "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/data/supply_delivery_history.csv"
click node_clean_csv "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/data/supply_delivery_history_clean.csv"
click node_main "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/main.py"
click node_loader "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/data_loader.py"
click node_cleaning "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/cleaning.py"
click node_summary "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/shipment_summary.py"
click node_country "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/country_analysis.py"
click node_product "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/product_analysis.py"
click node_vendor "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/vendor_analysis.py"
click node_notebooks "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/tree/main/notebooks"
click node_reports "https://github.com/julianchisco93/supply-chain-shipment-summary-tool/tree/main/reports/screenshots"

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_raw_csv,node_clean_csv toneBlue
class node_main,node_loader,node_cleaning toneAmber
class node_summary,node_country,node_product,node_vendor toneMint
class node_notebooks,node_reports toneRose
```

## Components

### Data boundary

Raw input and cleaned analysis-ready output

- [Raw CSV](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/data/supply_delivery_history.csv): source data · Primary shipment history input dataset · `data/supply_delivery_history.csv`
- [Clean CSV](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/data/supply_delivery_history_clean.csv): derived data · Analysis-ready cleaned shipment dataset · `data/supply_delivery_history_clean.csv`

### Core workflow

Script-driven load, clean, and orchestration path

- [Main](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/main.py): orchestrator · End-to-end script that ties loading, cleaning, saving, and analysis together · `main.py`
- [Loader](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/data_loader.py): ingestion · Reads shipment CSV into memory for downstream processing · `src/data_loader.py`
- [Cleaning](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/cleaning.py): transform · Cleans dates, numeric fields, missing values, and categorical values · `src/cleaning.py`

### Analytics modules

Domain-specific shipment, country, product, and vendor analysis

- [Shipment summary](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/shipment_summary.py): shared metrics · Cross-cutting shipment activity metrics and operational summaries · `src/shipment_summary.py`
- [Country analysis](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/country_analysis.py): location analytics · Aggregates shipments by destination country and revenue · `src/country_analysis.py`
- [Product analysis](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/product_analysis.py): product analytics · Analyzes shipment behavior by product group and description · `src/product_analysis.py`
- [Vendor analysis](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/blob/main/src/vendor_analysis.py): supplier analytics · Evaluates supplier performance and vendor rankings · `src/vendor_analysis.py`

### Exploration and reports

Notebooks and generated report artifacts

- [Notebooks](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/tree/main/notebooks): validation notebooks · Demo notebooks for module-level exploration and validation · `notebooks`
- [Reports](https://github.com/julianchisco93/supply-chain-shipment-summary-tool/tree/main/reports/screenshots): output artifacts · Generated screenshots and visual report artifacts · `reports/screenshots`

## Connections

- Raw CSV → Loader: read · Load raw shipment data into memory
- Loader → Cleaning: dataframe · Pass loaded records into the cleaning stage
- Cleaning → Clean CSV: write · Persist cleaned shipment dataset
- Clean CSV → Shipment summary: analyze · Use cleaned data for shared shipment metrics
- Clean CSV → Country analysis: analyze · Use cleaned data for country aggregation
- Clean CSV → Product analysis: analyze · Use cleaned data for product analysis
- Clean CSV → Vendor analysis: analyze · Use cleaned data for vendor analysis
- Main → Loader: runs · Main script invokes the loading step
- Main → Cleaning: runs · Main script invokes the cleaning step
- Main → Shipment summary: runs · Main script executes shipment summary analysis
- Main → Country analysis: runs · Main script executes country analysis
- Main → Product analysis: runs · Main script executes product analysis
- Main → Vendor analysis: runs · Main script executes vendor analysis
- Notebooks → Loader: validate · Notebook demos exercise the loader module
- Notebooks → Cleaning: validate · Notebook demos exercise cleaning behavior
- Notebooks → Shipment summary: validate · Notebook demos validate shared shipment metrics
- Notebooks → Country analysis: validate · Notebook demos validate country analytics
- Notebooks → Product analysis: validate · Notebook demos validate product analytics
- Notebooks → Vendor analysis: validate · Notebook demos validate vendor analytics
- Shipment summary → Reports: visualize · Metrics and charts are captured as report artifacts
- Country analysis → Reports: visualize · Country results feed report outputs
- Product analysis → Reports: visualize · Product results feed report outputs
- Vendor analysis → Reports: visualize · Vendor results feed report outputs
