Skip to content

henrymchu/sector-view

Repository files navigation

GICS Intelligence

A macOS desktop app for tracking sector performance and detecting statistical outliers across all 11 GICS sectors. Supports both the S&P 500 (large-cap) and Russell 2000 (small-cap) universes. Built with Tauri 2, React 19, and Rust.

Demo

GICS Intelligence Universe Toggle Animation

Switch between S&P 500 (large-cap) and Russell 2000 (small-cap) universes with smooth flip animations and themed UI

Screenshots

Outlier analysis dashboard with Z-score rankings and filters

Features

  • Dual universe support — Toggle between S&P 500 (large-cap) and Russell 2000 (small-cap) with per-universe sector summaries and outlier thresholds
  • Sector overview — Live metrics for all 11 GICS sectors (price change, P/E ratio, market cap, beta)
  • Outlier detection — Z-score analysis to surface undervalued, overvalued, momentum, and other anomalous stocks (1.5σ threshold for S&P 500, 2.0σ for Russell 2000)
  • Real-time refresh — Fetches market data from Yahoo Finance with progress tracking; supports per-sector or full-universe refresh
  • Local storage — SQLite database for offline access and historical data
  • Dark mode — Follows system appearance

Requirements

Tool Version Install
Rust stable (2021 edition) rustup.rs
Node.js 18+ nodejs.org or brew install node
npm 9+ Included with Node.js
Xcode CLT Latest xcode-select --install

Tauri 2 also requires macOS system dependencies. If you haven't built a Tauri app before, install the prerequisites:

xcode-select --install

Getting Started

  1. Clone the repository

    git clone <repo-url>
    cd sector-view
  2. Install frontend dependencies

    npm install
  3. Run in development mode

    npm run tauri dev

    This starts the Vite dev server on localhost:1420 and launches the Tauri window with hot-reload.

  4. Build for production

    npm run tauri build

    The compiled .app bundle will be in src-tauri/target/release/bundle/macos/.

Project Structure

sector-view/
├── src/                        # React/TypeScript frontend
│   ├── components/             # UI components (SectorGrid, Header, etc.)
│   ├── hooks/                  # useDatabase hook for Tauri commands
│   └── types/                  # TypeScript interfaces
├── src-tauri/                  # Rust backend
│   ├── src/
│   │   ├── commands.rs         # Tauri commands exposed to frontend
│   │   ├── database.rs         # SQLite init and migrations
│   │   ├── market_data.rs      # Yahoo Finance API integration
│   │   ├── outlier_detection.rs# Z-score outlier analysis
│   │   ├── stock_discovery.rs  # S&P 500 stock discovery
│   │   └── russell_discovery.rs# Russell 2000 stock discovery (iShares IWM)
│   └── migrations/             # SQLite migrations
├── package.json
└── vite.config.ts

Tech Stack

  • Frontend: React 19, TypeScript 5.8, Vite 7
  • Backend: Rust, Tauri 2, SQLx (SQLite), Tokio, Reqwest
  • Data: Yahoo Finance API, local SQLite database

Testing

GICS Intelligence includes comprehensive unit test coverage for both frontend and backend components, with 145 total tests ensuring code quality and reliability.

Frontend Tests (React/Vitest) — 45 tests

Run all frontend tests:

npm test

Run tests in watch mode (re-runs on file changes):

npm run test:watch

Run tests with coverage report:

npm run test:coverage

What's tested:

  • Component rendering and UI behavior (SectorCard, SectorGrid)
  • User interactions and event handling
  • Snapshot testing for UI consistency
  • Props validation and edge cases

Backend Tests (Rust/Cargo) — 100 tests

Run all backend tests:

cd src-tauri
cargo test

Run tests with detailed output:

cd src-tauri
cargo test -- --nocapture

Run specific test modules:

cd src-tauri
cargo test outlier_detection    # Z-score calculation tests
cargo test market_data         # Yahoo Finance API tests
cargo test stock_discovery     # S&P 500 parsing tests
cargo test russell_discovery   # Russell 2000 integration tests

What's tested:

  • Mathematical accuracy — Z-score calculations, composite scoring, outlier classification
  • Data parsing — Yahoo Finance JSON responses, Wikipedia HTML parsing, IWM CSV processing
  • API integration — URL construction, error handling, data validation
  • Database operations — SQLite queries, migrations, data consistency
  • Edge cases — Missing data handling, malformed responses, boundary conditions

Test Coverage

The test suite validates critical functionality across all major modules:

  • Financial calculations — Ensures mathematical accuracy for investment-grade analysis
  • Data integration — Validates API responses and data parsing reliability
  • User interface — Confirms UI components render correctly across scenarios
  • Database operations — Tests data storage and retrieval consistency
  • Error handling — Verifies graceful degradation under failure conditions

All tests pass consistently, ensuring production-ready code quality.

Important Disclaimer

⚠️ For Educational and Research Purposes Only

GICS Intelligence is an analytical tool designed to help identify statistical anomalies in financial data. The outlier detection and analysis features are intended as starting points for your own research, not as investment recommendations.

Key Points:

  • Not Financial Advice: This app does not provide investment, financial, or trading advice
  • Research Tool: Outlier suggestions should prompt further investigation, not immediate investment decisions
  • Do Your Own Research: Always conduct thorough fundamental analysis, read financial statements, and understand the business before investing
  • Risk Awareness: All investments carry risk, and statistical outliers may indicate both opportunities and risks
  • Data Limitations: Market data may be delayed, incomplete, or subject to errors

Recommended Workflow:

  1. Use the app to identify statistically interesting stocks
  2. Research thoroughly - read annual reports, earnings calls, industry analysis
  3. Understand the business - products, competitive position, management quality
  4. Consider multiple factors - not just statistical metrics
  5. Consult professionals if needed for significant investment decisions

Remember: A stock being a statistical outlier doesn't automatically make it a good or bad investment. Market conditions, company fundamentals, and your personal financial situation should all factor into investment decisions.

Invest responsibly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors