# mhaln3mi/nyc-flights-eda architecture

> Architecture diagram of the GitHub repository mhaln3mi/nyc-flights-eda, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-22). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mhaln3mi/nyc-flights-eda
- Repository: https://github.com/mhaln3mi/nyc-flights-eda

## Overview

##### Project type and purpose
- This is an Exploratory Data Analysis (EDA) pipeline built in R.
- Purpose: ingest raw flight/demographics data → perform data munging and visualization → produce a static HTML report, then host it as a GitHub Pages site.

##### File structure
- Top-level:
- data/ → raw CSV inputs
- src/ → R scripts and RMarkdown for analysis & report generation
- report.html (the generated output)
- NYC_Flights_Delays_EDA.Rproj → RStudio project file
- No separate “frontend” or “backend” folders—this is a single analytical pipeline.

##### README for additional insights
- Libraries: tidyverse, plotly, ggplot2, nycflights13, etc.
- Workflow: data munging → EDA → data viz → HTML report.

##### Main components & interactions
a. Data Layer
- airports_per_state.csv
- flights_data.csv
b. Processing Layer
1) Data Ingestion & Cleaning (src/EDA.R)
2) Exploratory Analysis & Visualization (src/report.Rmd invoking plotly, ggplot2, janitor, etc.)
3) Report Rendering (knitr renders .Rmd → report.html)
c. Hosting Layer
- GitHub Pages or static web server that serves report.html
d. User Layer
- Web browser that fetches report.html

- Raw CSV → Data Cleaning script
- Cleaning → EDA Visualizations
- Visualizations + Analysis → HTML Report
- HTML Report → Web Server
- User Browser ← HTML Report

##### Architectural patterns & tech
- “Pipeline” pattern: linear ETL (Extract, Transform, Load) + Reporting
- R packages as components: tidyverse for data wrangling, plotly/ggplot2 for viz, knitr for report
- Static-site hosting (GitHub Pages)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Layer
    A1["airports_per_state.csv"]:::data
    A2["flights_data.csv"]:::data

    %% Processing Layer
    B["Data Ingestion & Cleaning\n(src/EDA.R)"]:::processing
    C["Exploratory Analysis & Visualization\n(src/report.Rmd)"]:::processing

    %% Report Outputs
    Dnb["Notebook Preview\n(src/report.nb.html)"]:::report
    D["Static HTML Report\n(report.html)"]:::report

    %% Hosting & User
    E["GitHub Pages\n(Static Hosting)"]:::hosting
    F["End-User Browser"]:::user

    %% Orchestration & Documentation
    G["RStudio Project\n(NYC_Flights_Delays_EDA.Rproj)"]:::orchestration
    H["Project Documentation\n(README.md)"]:::docs

    %% Data Flow
    A1 -->|"raw data"| B
    A2 -->|"raw data"| B
    B -->|"cleaned data"| C
    C -->|"analysis & viz"| Dnb
    C -->|"knit to HTML"| D
    D -->|"served static"| E
    E -->|"HTTP GET"| F

    %% Orchestration Links
    G -.-> B
    G -.-> C
    G -.-> D

    %% Documentation Link
    H -.-> G

    %% Click Events
    click A1 "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/data/airports_per_state.csv"
    click A2 "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/data/flights_data.csv"
    click B "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/src/EDA.R"
    click C "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/src/report.Rmd"
    click Dnb "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/src/report.nb.html"
    click D "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/report.html"
    click G "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/NYC_Flights_Delays_EDA.Rproj"
    click H "https://github.com/mhaln3mi/nyc-flights-eda/blob/main/README.md"

    %% Styles
    classDef data fill:#add8e6,stroke:#000,stroke-width:1px
    classDef processing fill:#90ee90,stroke:#000,stroke-width:1px
    classDef report fill:#ffa500,stroke:#000,stroke-width:1px
    classDef hosting fill:#d3d3d3,stroke:#000,stroke-width:1px
    classDef user fill:#ffffff,stroke:#000,stroke-width:1px,stroke-dasharray: 5 5
    classDef orchestration fill:#dda0dd,stroke:#000,stroke-width:1px
    classDef docs fill:#ffffe0,stroke:#000,stroke-width:1px
```
