Skip to content

A comprehensive data analytics platform that processes NYC taxi trip data from Google BigQuery and visualizes insights through an interactive React dashboard. Features real-time heatmaps, temporal analysis, and geographic intelligence across 263 NYC taxi zones.

Notifications You must be signed in to change notification settings

amirrezaskh/NYC-taxi-dashboard

Repository files navigation

NYC Taxi Analytics Dashboard

React TypeScript Material-UI Vite License: MIT

A comprehensive end-to-end data analytics platform that processes NYC taxi trip data from Google BigQuery and presents actionable insights through an interactive React dashboard. This project combines big data processing with modern web visualization to explore transportation patterns, revenue metrics, and geographic distributions across New York City's 263 taxi zones.

Live Demo

πŸš€ View Live Dashboard

🌟 Key Features

πŸ“Š Interactive Analytics

  • Dynamic Heatmaps - Color-coded zones with real-time metric switching
  • Temporal Analysis - Trip patterns across 30-minute intervals
  • Flow Visualization - Sankey diagrams showing pickup-dropoff relationships
  • Revenue Insights - Financial metrics and tipping patterns

πŸ—ΊοΈ Geographic Intelligence

  • 263 NYC Taxi Zones - Complete coverage across all five boroughs
  • Interactive Maps - Powered by React Leaflet with custom styling
  • Zone-based Metrics - Neighborhood-level granular analysis
  • Coordinate Precision - Proper WGS84 projection handling

🎨 Modern UI/UX

  • Material-UI v7 - Professional design system
  • Dark/Light Themes - Automatic mode switching
  • Responsive Design - Mobile-first approach
  • Performance Optimized - Lazy loading and efficient rendering

πŸ—οΈ Architecture Overview

graph LR
    A[Google BigQuery] --> B[Python Processing]
    B --> C[CSV/GeoJSON Files]
    C --> D[React Dashboard]
    D --> E[Interactive Visualizations]
    
    subgraph "Data Sources"
        A1[NYC TLC Yellow Trips]
        A2[NYC TLC Green Trips]
        A3[Taxi Zone Shapefiles]
    end
    
    subgraph "Processing Pipeline"
        B1[Data Cleaning]
        B2[Metric Calculation]
        B3[Geographic Merging]
    end
    
    subgraph "Frontend Components"
        D1[Revenue Analytics]
        D2[Demand Analysis]
        D3[Trip Characteristics]
        D4[Interactive Maps]
    end
Loading

πŸ“Š Data Pipeline

Data Sources

  • Primary: Google BigQuery public dataset (bigquery-public-data.new_york_taxi_trips)
  • Geographic: NYC TLC official taxi zone shapefiles (263 zones)
  • Temporal Coverage: Configurable date ranges (default: Jan-Feb 2025)
  • Trip Types: Yellow and Green taxi services

Generated Metrics

Metric Description Use Case
avg_tip_amount.csv Average tip amounts by zone Revenue optimization
avg_total_amount.csv Average trip costs Price analysis
revenue_per_pickup.csv Total revenue by zone Business intelligence
trips_by_time_of_day.csv Temporal trip patterns Demand forecasting
duration_by_time_of_day.csv Trip duration analysis Traffic insights
dropoff_by_pickup_*.csv Origin-destination flows Route optimization
merged.geojson Geographic boundaries + metrics Map visualization

Processing Features

  • βœ… BigQuery Integration - Serverless SQL processing at scale
  • βœ… Automated Data Cleaning - Missing value handling and validation
  • βœ… Coordinate Transformation - EPSG:2263 to WGS84 conversion
  • βœ… Performance Optimization - Partitioned queries and efficient aggregation

πŸ–₯️ Frontend Technology Stack

Core Framework

{
  "react": "^19.1.1",
  "typescript": "~5.8.3",
  "vite": "^7.1.2"
}

UI & Visualization

{
  "@mui/material": "^7.3.2",
  "plotly.js": "^3.1.0",
  "react-leaflet": "^5.0.0",
  "chroma-js": "^3.1.2"
}

Development & Build

{
  "eslint": "^9.33.0",
  "typescript-eslint": "^8.39.1",
  "@vitejs/plugin-react-swc": "^4.0.0"
}

πŸš€ Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • npm >= 9.0.0
  • Python >= 3.8 (for data processing)
  • Google Cloud Account (for BigQuery access)

1. Clone & Install

# Clone the repository
git clone https://github.com/amirrezaskh/nyc-taxi-dashboard.git
cd nyc-taxi-dashboard

# Install dependencies
npm install

3. Data Processing (Optional)

If you want to regenerate the data from BigQuery:

# Install Python dependencies
pip install pandas numpy matplotlib folium geopandas google-cloud-bigquery

# Set up Google Cloud authentication
export GOOGLE_APPLICATION_CREDENTIALS="path/to/service-account-key.json"

# Run data processing
jupyter notebook processing/main.ipynb

4. Development Server

# Start development server
npm run dev

# Open browser at http://localhost:5173

πŸ“ Project Structure

nyc-taxi-dashboard/
β”œβ”€β”€ πŸ“‚ public/                     # Static assets and processed data
β”‚   β”œβ”€β”€ πŸ“Š data/                   # CSV files and GeoJSON
β”‚   β”‚   β”œβ”€β”€ avg_tip_amount.csv
β”‚   β”‚   β”œβ”€β”€ trips_by_time_of_day.csv
β”‚   β”‚   β”œβ”€β”€ merged.geojson
β”‚   β”‚   └── ...
β”‚   └── πŸ–ΌοΈ favicon.ico
β”œβ”€β”€ πŸ“‚ src/
β”‚   β”œβ”€β”€ πŸ“‚ app/                    # Application core
β”‚   β”‚   β”œβ”€β”€ layout/               # Layout components
β”‚   β”‚   β”‚   β”œβ”€β”€ App.tsx          # Main app wrapper
β”‚   β”‚   β”‚   β”œβ”€β”€ Navbar.tsx       # Navigation
β”‚   β”‚   β”‚   └── styles.css       # Global styles
β”‚   β”‚   └── router/              # Routing configuration
β”‚   β”‚       └── routes.tsx       # Route definitions
β”‚   β”œβ”€β”€ πŸ“‚ features/              # Feature-based architecture
β”‚   β”‚   β”œβ”€β”€ about/               # About page
β”‚   β”‚   β”œβ”€β”€ revenue/             # Revenue analytics
β”‚   β”‚   β”‚   └── RevenueTips.tsx
β”‚   β”‚   β”œβ”€β”€ demand/              # Trip demand analysis
β”‚   β”‚   β”‚   β”œβ”€β”€ Demand.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ TripsByTime.tsx
β”‚   β”‚   β”‚   └── TaxiSankey.tsx
β”‚   β”‚   β”œβ”€β”€ characteristic/      # Trip characteristics
β”‚   β”‚   β”‚   β”œβ”€β”€ TripCharacteristic.tsx
β”‚   β”‚   β”‚   └── DurationByTime.tsx
β”‚   β”‚   └── map/                 # Interactive mapping
β”‚   β”‚       └── NYCMap.tsx
β”‚   β”œβ”€β”€ πŸ“‚ theme/                 # Design system
β”‚   β”‚   β”œβ”€β”€ AppTheme.tsx         # Theme provider
β”‚   β”‚   β”œβ”€β”€ palettes.ts          # Color schemes
β”‚   β”‚   β”œβ”€β”€ themePrimitives.ts   # Design tokens
β”‚   β”‚   └── customizations/      # Component overrides
β”‚   β”œβ”€β”€ πŸ“‚ lib/                   # Utilities and types
β”‚   β”‚   β”œβ”€β”€ types/
β”‚   β”‚   └── util/
β”‚   └── main.tsx                 # Application entry point
β”œβ”€β”€ πŸ“‚ processing/                # Data analysis pipeline
β”‚   β”œβ”€β”€ main.ipynb              # Primary analysis notebook
β”‚   β”œβ”€β”€ preprocess.ipynb        # Data preprocessing
β”‚   β”œβ”€β”€ process.py              # Zone processing script
β”‚   └── merge.py                # Data merging script
β”œβ”€β”€ πŸ“„ package.json             # Dependencies and scripts
β”œβ”€β”€ πŸ“„ tsconfig.json            # TypeScript configuration
β”œβ”€β”€ πŸ“„ vite.config.ts           # Vite build configuration
└── πŸ“„ README.md                # This file

🎨 Dashboard Sections

1. Revenue & Tips Analysis

Explore the financial landscape of NYC's taxi ecosystem:

  • Manhattan Premium - Higher tips in business districts
  • Airport Revenue - JFK/LaGuardia pickup patterns
  • Tip Percentage Trends - Business vs entertainment zones
  • Economic Geography - Revenue concentration analysis

Key Metrics: Average tip amount, total revenue, tip percentages

2. Trip Demand Analysis

Understand dynamic patterns of taxi utilization:

  • Rush Hour Peaks - Morning (7-9 AM) and evening (5-7 PM) patterns
  • Weekend Shifts - Late-night entertainment district activity
  • Commuter Flows - Directional pickup/dropoff relationships
  • Seasonal Variations - Weather and event impact analysis

Visualizations: Time series charts, Sankey flow diagrams, demand heatmaps

3. Trip Characteristics

Analyze fundamental trip attributes:

  • Passenger Patterns - Business (1.2-1.4) vs entertainment (1.6-2.0) occupancy
  • Distance Variations - Airport vs intra-Manhattan comparisons
  • Duration Dynamics - Traffic impact (40-60% longer in rush hour)
  • Geographic Influence - Bridge/tunnel access effects

Components: Duration analysis, distance distributions, passenger metrics

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A comprehensive data analytics platform that processes NYC taxi trip data from Google BigQuery and visualizes insights through an interactive React dashboard. Features real-time heatmaps, temporal analysis, and geographic intelligence across 263 NYC taxi zones.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published