Skip to content

JDL911/sb1-nsmqjhjg

Repository files navigation

Quantamental Portfolio Dashboard

A comprehensive portfolio management tool for tracking equities and options, analyzing risk, calculating quantamental factors, and generating Markdown reports.

Features

  • 🚀 Real-time market data tracking with multiple data sources
  • 📊 Options chain analysis and Greeks calculations
  • 💼 Portfolio position management across multiple accounts
  • 📈 Risk analytics and exposure monitoring
  • 🔍 Fundamental data analysis
  • 📝 Markdown report generation
  • 🔒 Secure authentication and authorization
  • 📱 Responsive design for all devices

Prerequisites

  • Node.js 18+
  • Supabase account
  • API keys for market data providers:
    • Polygon.io
    • Alpha Vantage
    • Financial Modeling Prep (FMP)
    • FRED
    • Others as needed

Quick Start

  1. Clone the repository
  2. Set up environment variables:
    cp .env.example .env
    # Edit .env with your API keys
  3. Install dependencies:
    npm install
  4. Start development server:
    npm run dev

Configuration

Environment Variables

Required environment variables are documented in .env.example. Each variable must be prefixed with VITE_ to be accessible in the frontend code.

Supabase Setup

  1. Create a new Supabase project
  2. Run migrations from supabase/migrations/
  3. Configure authentication settings
  4. Add environment variables to .env

Architecture

Database Schema

The application uses Supabase (PostgreSQL) with the following main tables:

  • companies: Basic company information
  • positions: Portfolio positions
  • option_positions: Options-specific data
  • transactions: Position transactions
  • market_data: Price and fundamental data
  • metrics: Calculated financial metrics
  • watchlist: Tracked companies
  • reports: Markdown research reports

API Integration

Multiple market data sources are used with automatic fallback:

  1. Yahoo Finance (primary, no API key needed)
  2. Polygon.io (real-time data)
  3. Alpha Vantage (fundamental data)
  4. FMP (company profiles)

Security

  • Row Level Security (RLS) enabled on all tables
  • API key rotation every 24 hours
  • Environment variable protection
  • Secure authentication flow

Development

Available Scripts

  • npm run dev: Start development server
  • npm run build: Build for production
  • npm run test: Run tests
  • npm run test:coverage: Run tests with coverage
  • npm run market-data: Start market data server
  • npm run import-data: Import initial data

Code Structure

src/
├── api/          # API clients and error handling
├── components/   # React components
├── hooks/        # Custom React hooks
├── lib/          # Library configurations
├── types/        # TypeScript type definitions
├── utils/        # Utility functions
└── workers/      # Web Workers for calculations

Next Steps and Improvements

High Priority

  1. Data Management

    • Implement data caching strategy
    • Add data validation layer
    • Implement real-time data synchronization
  2. Error Handling

    • Add global error boundary
    • Implement retry mechanisms for API calls
    • Add error reporting service
  3. Testing

    • Add E2E tests with Cypress
    • Increase unit test coverage
    • Add performance testing

Medium Priority

  1. Features

    • Add portfolio rebalancing tools
    • Implement advanced charting
    • Add technical analysis indicators
  2. Performance

    • Implement code splitting
    • Add service worker for offline support
    • Optimize bundle size
  3. Documentation

    • Add API documentation
    • Create user guide
    • Add contributing guidelines

Low Priority

  1. UI/UX

    • Add dark mode support
    • Implement keyboard shortcuts
    • Add more customization options
  2. Analytics

    • Add performance metrics
    • Implement usage tracking
    • Add user feedback system

Known Limitations

  1. Data Providers

    • Rate limits on free API tiers
    • Delayed market data on some sources
    • Limited historical data
  2. Performance

    • Large option chains may cause slowdown
    • Real-time updates limited by API quotas
  3. Browser Support

    • Modern browsers only
    • No IE11 support

Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

MIT

Support

For support, please open an issue in the GitHub repository.

About

Created with StackBlitz ⚡️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published