Skip to content

nathaliedpuc/hackathon-macrodata

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Š MacroData Intelligence Platform

A sophisticated web application that analyzes financial data against FRED (Federal Reserve Economic Data) indicators with AI-powered insights. Upload your long-range financial plan and gain deep insights into how macroeconomic trends correlate with your business metrics.

โœจ Features

๐ŸŽฏ Core Capabilities

  • Automatic Time Period Detection: Intelligently detects date ranges from uploaded data (quarterly, monthly, annual)
  • Industry-Specific Analysis: Pre-configured FRED indicators for 6 industries:
    • Gaming
    • Technology
    • Manufacturing
    • Retail
    • Healthcare
    • Finance

๐Ÿ“ˆ Advanced Analytics

  • Real FRED API Integration: Pulls live economic data including:
    • Corporate Profits After Tax
    • Industrial Production Index (by industry)
    • Producer Price Index (by industry)
    • Real GDP (industry breakdown)
    • Employment & Wages (by sector)
    • Financial indices (Nasdaq, S&P sector data)

๐Ÿ’ก Margin Pressure Analysis

Combines three key indicators to calculate margin pressure:

Margin Pressure = (Corporate Profits ร— Industrial Production) / PPI

This unique metric helps identify when rising costs are squeezing margins.

๐Ÿค– AI-Powered Insights

  • Leverages Deepseek API for intelligent analysis
  • Identifies key trends and risk factors
  • Provides strategic recommendations
  • Generates market outlook projections

๐Ÿ“Š Beautiful Visualizations

  • Interactive dual-axis charts for correlation analysis
  • Margin pressure trend visualization
  • Top correlations bar chart
  • Real-time economic indicator dashboard
  • Modern, gradient-based UI design

๐Ÿš€ Quick Start

Prerequisites

Installation & Setup

Follow these steps to get the application running from scratch:

1. Clone and Navigate

git clone <repository-url>
cd hackathon-macrodata

2. Install Root Dependencies

Install the development tools (concurrently) for running both services:

npm install

3. Install Server Dependencies

cd server
npm install
cd ..

4. Install Client Dependencies

cd client
npm install
cd ..

Or install all at once:

npm run install:all

5. Configure Environment Variables

Create a .env file in the root directory with your API keys:

# In the root directory (hackathon-macrodata/)
touch .env

Add the following to .env:

DEEPSEEK_API_KEY=your_deepseek_api_key_here
FRED_API_KEY=your_fred_api_key_here

Get your API keys:

Running the Application

Quick Start (Recommended)

From the root directory, run:

npm run dev

This starts both the backend (port 5001) and frontend (port 3000) concurrently.

You should see:

โœจ Server running on port 5001
๐Ÿ“Š FRED API: โœ“ Configured
๐Ÿค– Deepseek API: โœ“ Configured
Compiled successfully!

Open your browser to http://localhost:3000

Alternative: Run Separately

Terminal 1 - Backend:

npm run server
# or: cd server && npm run dev

Terminal 2 - Frontend:

npm run client
# or: cd client && npm start

Production Build

  1. Build the React app:
cd client
npm run build
  1. Start the production server:
cd server
npm start

The app will be available at http://localhost:5001

๐Ÿš€ Deployment

Deploy to Vercel

This project is configured for easy deployment to Vercel as a full-stack application.

Prerequisites

  • Vercel account (free at https://vercel.com)
  • Git repository (GitHub, GitLab, or Bitbucket)

Deployment Steps

  1. Push your code to a Git repository:
git init
git add .
git commit -m "Initial commit"
git remote add origin <your-repo-url>
git push -u origin main
  1. Import project to Vercel:

    • Go to https://vercel.com/new
    • Import your repository
    • Vercel will auto-detect the configuration from vercel.json
  2. Add Environment Variables in Vercel:

    • Go to Project Settings โ†’ Environment Variables
    • Add the following:
      DEEPSEEK_API_KEY=your_deepseek_api_key
      FRED_API_KEY=your_fred_api_key
      
  3. Deploy:

    • Click "Deploy"
    • Vercel will build and deploy both frontend and backend

Build Configuration

The vercel.json file configures:

  • Backend: server/server.js runs as a serverless function
  • Frontend: client/ builds as a static site
  • Routes: API calls to /api/* route to the backend, everything else to the frontend

Environment Variables

For Production (Vercel):

  • DEEPSEEK_API_KEY: Your Deepseek API key
  • FRED_API_KEY: Your FRED API key

For Frontend (optional):

  • REACT_APP_API_URL: Leave empty when deploying to Vercel (uses same domain)

Alternative: Split Deployment

You can also deploy frontend and backend separately:

Frontend (Vercel):

  • Root Directory: client
  • Build Command: npm run build
  • Output Directory: build
  • Framework: Create React App
  • Environment Variable: REACT_APP_API_URL=https://your-backend-url.com

Backend (Render/Railway/Heroku):

  • Root Directory: server
  • Start Command: npm start
  • Add environment variables: DEEPSEEK_API_KEY, FRED_API_KEY

๐Ÿ“ Project Structure

hackathon-macrodata/
โ”œโ”€โ”€ server/                      # Backend server
โ”‚   โ”œโ”€โ”€ server.js               # Main Express server
โ”‚   โ”œโ”€โ”€ fred-api.js             # FRED API integration
โ”‚   โ”œโ”€โ”€ data-processing.js      # Data processing utilities
โ”‚   โ”œโ”€โ”€ deepseek-api.js         # AI insights integration
โ”‚   โ”œโ”€โ”€ .env                    # API keys configuration
โ”‚   โ”œโ”€โ”€ nexus_gaming_financials.csv # Sample data
โ”‚   โ””โ”€โ”€ package.json            # Server dependencies
โ”œโ”€โ”€ client/                      # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ App.js              # Main React component
โ”‚   โ”‚   โ”œโ”€โ”€ App.css             # Modern styling
โ”‚   โ”‚   โ””โ”€โ”€ index.js            # Entry point
โ”‚   โ”œโ”€โ”€ public/
โ”‚   โ””โ”€โ”€ package.json            # Client dependencies
โ”œโ”€โ”€ package.json                 # Root scripts for running both
โ”œโ”€โ”€ .gitignore                   # Git ignore rules
โ””โ”€โ”€ README.md                    # This file

๐ŸŽฎ How to Use

Step 1: Upload Your Data

  • Supports Excel (.xlsx, .xls) and CSV files
  • Automatic date detection from column headers (Q1-2021, FY-2022, etc.)
  • Extracts financial metrics automatically

Step 2: Select Your Industry

Choose from 6 pre-configured industries. Each has relevant FRED indicators:

  • Gaming: Entertainment sector indicators
  • Technology: Tech-specific production and employment data
  • Manufacturing: Industrial production and PPI
  • Retail: Consumer goods and retail trade data
  • Healthcare: Healthcare expenditures and employment
  • Finance: Financial sector profits and indices

Step 3: Select Metrics to Analyze

  • Choose which financial metrics to correlate with FRED data
  • Multiple metrics can be analyzed simultaneously

Step 4: View Results

  • AI Insights: Strategic analysis powered by Deepseek
  • Margin Pressure Chart: Visualize cost pressure trends
  • Correlation Charts: See how your metrics align with economic indicators
  • FRED Dashboard: Track current economic indicator values

๐Ÿ”ง API Endpoints

GET /api/industries

Returns available industries and their configuration

GET /api/indicators/:industry

Returns FRED indicators for a specific industry

POST /api/upload

Upload and parse financial data file

  • Accepts: Excel, CSV
  • Returns: Detected metrics, time period, preview

POST /api/analyze

Run correlation analysis

  • Body: { industry, startDate, endDate, selectedMetrics }
  • Returns: FRED data, correlations, margin pressure, AI insights

GET /api/health

Health check and API key status

๐ŸŽจ Features Highlight

Automatic Time Detection

The system intelligently parses various date formats:

  • Quarterly: Q1-2021, Q2 2021
  • Fiscal Year: FY-2021, FY2021
  • Standard dates: 2021-01-01, 01/01/2021

Margin Pressure Index

A proprietary metric that combines:

  1. Corporate Profits: Overall profitability trends
  2. Industrial Production: Efficiency and output
  3. Producer Price Index: Input cost inflation

Higher values indicate healthier margins; lower values signal cost pressures.

Correlation Analysis

Pearson correlation coefficients between your financial metrics and economic indicators:

  • > 0.7: Strong positive correlation
  • 0.4 - 0.7: Moderate positive correlation
  • -0.4 - 0.4: Weak/no correlation
  • < -0.7: Strong negative correlation

๐ŸŒ FRED Data Sources

All economic data is sourced from the Federal Reserve Economic Data (FRED) API:

๐Ÿค– AI Integration

The platform uses Deepseek's latest language model to:

  • Analyze correlation patterns
  • Identify market trends
  • Highlight risk factors
  • Provide actionable recommendations
  • Generate forward-looking insights

๐Ÿ“Š Sample Data

The server/nexus_gaming_financials.csv file contains:

  • Quarterly financial data (Q1-2021 through Q4-2026)
  • Revenue, costs, profits, and other metrics
  • Perfect for testing the gaming industry analysis

๐Ÿ› ๏ธ Technologies Used

Backend:

  • Node.js & Express
  • Axios (API calls)
  • XLSX (Excel parsing)
  • CSV-Parse

Frontend:

  • React 18
  • Chart.js & react-chartjs-2
  • Axios
  • Modern CSS with gradients

APIs:

  • FRED (Federal Reserve Economic Data)
  • Deepseek (AI insights)

๐Ÿ“ License

MIT License - Feel free to use and modify for your needs.

๐Ÿ™ Credits

Built for analyzing business financials against macroeconomic trends.

  • FRED API by Federal Reserve Bank of St. Louis
  • Deepseek AI for intelligent insights

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published