No description
Find a file
2025-06-03 18:02:15 -04:00
.vscode added vscode specifcs to git 2025-06-02 08:52:54 -04:00
apps updated files 2025-06-03 18:02:15 -04:00
database switched to angular 2025-06-02 19:37:33 -04:00
docs changed types around 2025-06-03 17:52:02 -04:00
libs updated files 2025-06-03 18:02:15 -04:00
monitoring no idea- added loki and other stuff to market-data-gateway, also added config lib 2025-06-03 11:37:58 -04:00
scripts changed types around 2025-06-03 17:52:02 -04:00
tools no idea- added loki and other stuff to market-data-gateway, also added config lib 2025-06-03 11:37:58 -04:00
.dockerignore initial setup 2025-06-02 08:15:20 -04:00
.env.complete added LOKI_FLUSH_INTERVAL_MS 2025-06-03 15:29:45 -04:00
.env.docker added working config lib 2025-06-03 14:09:31 -04:00
.env.example no idea- added loki and other stuff to market-data-gateway, also added config lib 2025-06-03 11:37:58 -04:00
.env.prod added LOKI_FLUSH_INTERVAL_MS 2025-06-03 15:29:45 -04:00
.env.production added working config lib 2025-06-03 14:09:31 -04:00
.gitignore fixed refs 2025-06-03 15:53:26 -04:00
.gitlab-ci.yml added gitlab-ci 2025-06-02 17:41:09 -04:00
ARCHITECTURE.md changed types around 2025-06-03 17:52:02 -04:00
bun.lock changed types around 2025-06-03 17:52:02 -04:00
CONTEXT.md changed types around 2025-06-03 17:52:02 -04:00
docker-compose.dev.yml initial setup 2025-06-02 08:15:20 -04:00
docker-compose.yml no idea- added loki and other stuff to market-data-gateway, also added config lib 2025-06-03 11:37:58 -04:00
DOCKER.md initial setup 2025-06-02 08:15:20 -04:00
package-lock.json changed types around 2025-06-03 17:52:02 -04:00
package.json added working config lib 2025-06-03 14:09:31 -04:00
README.md changed types around 2025-06-03 17:52:02 -04:00
REFACTORING.md changed types around 2025-06-03 17:52:02 -04:00
SETUP-COMPLETE.md switched to angular 2025-06-02 19:37:33 -04:00
tsconfig.app.json standardized tsconfigs 2025-06-03 11:49:45 -04:00
tsconfig.json changed types around 2025-06-03 17:52:02 -04:00
tsconfig.lib.json standardized tsconfigs 2025-06-03 11:49:45 -04:00
turbo.json adding data-services 2025-06-03 07:42:48 -04:00

🤖 Stock Bot Trading System

A comprehensive trading bot built with Bun and Turborepo, featuring a service-oriented architecture for real-time market data processing and strategy execution.

🚀 Quick Start

Prerequisites

  • Bun runtime
  • Node.js 18+ (for compatibility)

Installation

# Clone and install dependencies
git clone <your-repo-url>
cd stock-bot
bun install

Running the System

  1. Open the project in VS Code
  2. Press Ctrl+Shift+P (or Cmd+Shift+P on Mac)
  3. Type "Tasks: Run Task" and select it
  4. Choose "Start All Services"

Option 2: Manual Startup

# Terminal 1: Start Market Data Gateway
cd apps/core-services/market-data-gateway
bun run dev

# Terminal 2: Start Trading Dashboard
cd apps/interface-services/trading-dashboard
bun run dev

Access Points

📊 Dashboard Features

Real-time Market Data

  • Live price feeds for AAPL, GOOGL, MSFT, TSLA, AMZN
  • WebSocket connections for real-time updates
  • Service health monitoring

Professional UI Components

  • Built with Tremor UI for financial visualizations
  • Interactive charts and metrics
  • Responsive design for all devices

Dashboard Tabs

  1. Market Data: Live prices, volume, bid/ask spreads
  2. Portfolio: Holdings allocation and performance
  3. Charts: Price and volume analysis
  4. Performance: Trading metrics and statistics

🏗️ Architecture

Service-Oriented Design

apps/
├── core-services/
│   └── market-data-gateway/     # Market data ingestion
├── interface-services/
│   └── trading-dashboard/       # React dashboard
├── data-services/               # (Future) Data processing
├── execution-services/          # (Future) Order management
├── intelligence-services/       # (Future) Strategy engine
├── platform-services/          # (Future) Infrastructure
└── integration-services/        # (Future) External APIs

Shared Packages

packages/
├── types/               # TypeScript definitions
├── config/                     # Configuration management
├── database/                   # (Future) Database utilities
└── trading-core/              # (Future) Core trading logic

🔧 Development

Project Structure

  • Turborepo: Monorepo management
  • Bun: Package manager and runtime
  • TypeScript: Type safety across all services
  • React + Vite: Modern frontend development
  • Tremor UI: Financial dashboard components

Key Technologies

  • Backend: Hono framework, WebSockets, Redis
  • Frontend: React, TypeScript, Tremor UI
  • Data: QuestDB (planned), PostgreSQL (planned)
  • Deployment: Docker, Kubernetes (planned)

📈 Current Status

Completed

  • Monorepo setup with Turborepo
  • Market Data Gateway service
  • Real-time WebSocket connections
  • Professional React dashboard
  • Tremor UI integration
  • TypeScript type system
  • Service health monitoring

🚧 In Progress

  • Strategy execution engine
  • Risk management system
  • Portfolio tracking
  • Real broker integration

🔮 Planned

  • Advanced charting
  • Backtesting framework
  • Machine learning signals
  • Multi-broker support
  • Mobile application

🛠️ API Endpoints

Market Data Gateway (Port 3001)

GET  /health                     # Service health check
GET  /api/market-data/:symbol    # Current market data
GET  /api/ohlcv/:symbol          # Historical OHLCV data
WS   ws://localhost:3001         # Real-time data stream

Data Format

interface MarketData {
  symbol: string;
  price: number;
  bid: number;
  ask: number;
  volume: number;
  timestamp: string;
}

🔧 Configuration

Environment variables are managed in .env:

# Database Configuration
DATABASE_URL=postgresql://...
QUESTDB_URL=http://localhost:9000

# External APIs
ALPHA_VANTAGE_API_KEY=your_key_here
ALPACA_API_KEY=your_key_here

# Service Configuration
NODE_ENV=development
LOG_LEVEL=info

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

📝 License

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

🙏 Acknowledgments

  • Tremor UI for beautiful financial components
  • Bun for fast runtime and package management
  • Turborepo for monorepo tooling