AshutoshRudraksh/tradewithjarvis
If you are the rightful owner of tradewithjarvis and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
AI Trading Dashboard is a sophisticated real-time trading platform built as a Model Context Protocol (MCP) server, offering enterprise-grade features for market data integration and user management.
AI Trading Dashboard - MCP Server
A sophisticated real-time AI trading dashboard built as a Model Context Protocol (MCP) server with enterprise-grade authentication, database persistence, and institutional-quality market data integration.
š Features
- Real-time Market Data: Dual-provider integration (Polygon.io + Alpha Vantage) with intelligent failover
- AI Trading Agents: Live monitoring of AI agents with performance metrics and trading activity
- User Authentication: Secure Replit Auth integration with session management
- Portfolio Management: Complete user portfolio tracking with buy/sell functionality
- Database Persistence: PostgreSQL with Drizzle ORM for reliable data storage
- WebSocket Streaming: Real-time market updates with sub-100ms latency
- Responsive UI: Modern cyberpunk-themed interface with shadcn/ui components
š Tech Stack
Frontend
- React + TypeScript: Component-based architecture with strict typing
- Vite: Fast development server with HMR
- shadcn/ui: Modern UI components built on Radix primitives
- TanStack Query: Robust data fetching and caching
- Wouter: Lightweight client-side routing
- Tailwind CSS: Utility-first CSS with custom cyberpunk theme
Backend
- Express.js: RESTful API server with TypeScript
- PostgreSQL: Production-ready database with Neon serverless
- Drizzle ORM: Type-safe database operations
- WebSocket: Real-time data streaming
- Replit Auth: OpenID Connect authentication
External Services
- Polygon.io: Primary market data provider (institutional-grade)
- Alpha Vantage: Fallback market data provider
- Neon Database: Serverless PostgreSQL hosting
š Project Structure
āāā client/ # React frontend application
ā āāā src/
ā ā āāā components/ # Reusable UI components
ā ā āāā hooks/ # Custom React hooks
ā ā āāā lib/ # Utility libraries
ā ā āāā pages/ # Application pages
āāā server/ # Express.js backend
ā āāā services/ # Business logic services
āāā shared/ # Shared TypeScript types
āāā docs/ # Project documentation
āāā README.md # This file
š Quick Start
Prerequisites
- Node.js 18+
- PostgreSQL database (or use provided Neon setup)
- Alpha Vantage API key
- Polygon.io API key (optional)
Installation
- Clone the repository
git clone <repository-url>
cd ai-trading-dashboard
- Install dependencies
npm install
- Set up environment variables
# Database will be auto-provisioned if using Replit
# Add your API keys:
ALPHA_VANTAGE_API_KEY=your_alpha_vantage_key
POLYGON_API_KEY=your_polygon_key (optional)
- Start the development server
npm run dev
The application will be available at http://localhost:5000
š Development Phases
This project was built in three progressive phases:
Phase 1: Core Foundation
- Basic dashboard with real-time market data
- AI agent monitoring system
- WebSocket integration for live updates
- Initial UI with cyberpunk theme
Phase 2: Enhanced Analytics
- Advanced market analysis panels
- Company search and fundamentals
- Sector performance tracking
- Dual-provider market data integration
Phase 3: MVP Authentication System
- Replit Auth integration with OpenID Connect
- PostgreSQL database with user portfolios
- Complete authentication flow (login/logout)
- User-specific portfolio management
- Trading functionality with database persistence
šÆ Key Features Breakdown
Market Data Integration
- Primary Provider: Polygon.io for institutional-grade real-time data
- Fallback Provider: Alpha Vantage for reliable secondary data
- Intelligent Routing: Automatic failover between providers
- Caching Strategy: Enterprise-level caching with LRU/TTL eviction
Authentication System
- Replit Auth: Secure OpenID Connect integration
- Session Management: PostgreSQL-backed session storage
- User Portfolios: Individual portfolio tracking per user
- Trading System: Complete buy/sell functionality with balance management
Real-time Features
- WebSocket Streaming: Live market data updates
- AI Agent Monitoring: Real-time agent performance tracking
- Portfolio Updates: Live portfolio value calculations
- System Metrics: Real-time system health monitoring
š§ API Endpoints
Authentication
GET /api/login
- Initiate login flowGET /api/logout
- Logout and clear sessionGET /api/auth/user
- Get current user information
Market Data
GET /api/market-data
- Get all market dataGET /api/companies/search
- Search companiesGET /api/sectors/performance
- Sector performance data
Portfolio Management
GET /api/user/portfolio
- Get user portfolioGET /api/user/portfolio/holdings
- Get portfolio holdingsPOST /api/user/portfolio/trade
- Execute buy/sell trades
šØ UI Theme
The application features a cyberpunk-inspired dark theme with:
- Primary Colors: Purple and blue gradients
- Typography: Clean, futuristic fonts
- Animation: Subtle hover effects and transitions
- Responsive Design: Mobile-first approach
š Performance Metrics
- Market Data Updates: 10,000+ updates per minute
- Trading Operations: Sub-100ms execution time
- WebSocket Latency: <50ms real-time updates
- Database Operations: Optimized with connection pooling
š”ļø Security Features
- Authentication: Secure OpenID Connect with Replit
- Session Management: Server-side session validation
- API Protection: Protected routes with authentication middleware
- Data Validation: Request validation with Zod schemas
š¤ Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
š License
This project is licensed under the MIT License - see the file for details.
š Acknowledgments
- Polygon.io for providing institutional-grade market data
- Alpha Vantage for reliable financial data APIs
- Replit for authentication infrastructure and development platform
- shadcn/ui for beautiful, accessible UI components
Built with ā¤ļø for the future of trading technology