stock-bot/apps/stock
2025-07-03 22:55:23 -04:00
..
analytics added initial py analytics / rust core / ts orchestrator services 2025-07-01 11:16:25 -04:00
config messy work. backtests / mock-data 2025-07-03 08:37:23 -04:00
core added trade-tracking and example rust strats 2025-07-03 22:55:23 -04:00
data-ingestion finished intra-day crawl 2025-07-02 18:26:30 -04:00
data-pipeline fixed up qm and added types to BaseHandler for typesafety 2025-06-28 21:49:33 -04:00
orchestrator added trade-tracking and example rust strats 2025-07-03 22:55:23 -04:00
scripts refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
web-api work on backtest 2025-07-03 09:55:13 -04:00
web-app added rust engine and adapter pattern 2025-07-03 22:28:31 -04:00
package.json cleanup 2025-06-26 18:28:38 -04:00
README.md refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
TRADING_SYSTEM_README.md added initial py analytics / rust core / ts orchestrator services 2025-07-01 11:16:25 -04:00
tsconfig.json cleanup 2025-06-26 18:28:38 -04:00

Stock Trading Bot Application

A comprehensive stock trading bot application with multiple microservices for data ingestion, processing, and API access.

Architecture

The stock bot consists of the following services:

  • Config: Centralized configuration management
  • Data Ingestion: Handles real-time and historical data collection
  • Data Pipeline: Processes and transforms market data
  • Web API: RESTful API for accessing stock data
  • Web App: Frontend user interface

Quick Start

Prerequisites

  • Node.js >= 18.0.0
  • Bun >= 1.1.0
  • Turbo
  • PostgreSQL, MongoDB, QuestDB, and Redis/Dragonfly running locally

Installation

# Install all dependencies
bun install

# Build the configuration package first
bun run build:config

Development

# Run all services in development mode (using Turbo)
bun run dev

# Run only backend services
bun run dev:backend

# Run only frontend
bun run dev:frontend

# Run specific service
bun run dev:ingestion
bun run dev:pipeline
bun run dev:api
bun run dev:web

Production

# Build all services (using Turbo)
bun run build

# Start with PM2
bun run pm2:start

# Check status
bun run pm2:status

# View logs
bun run pm2:logs

Configuration

Configuration is managed centrally in the config package.

  • Default config: config/config/default.json
  • Environment-specific: config/config/[environment].json
  • Environment variables: Can override any config value

Health Checks

# Check all services health
bun run health:check

Database Management

# Run migrations
bun run db:migrate

# Seed database
bun run db:seed

Available Scripts

Script Description
dev Run all services in development mode
build Build all services
start Start all backend services
test Run tests for all services
lint Lint all services
clean Clean build artifacts and dependencies
docker:build Build Docker images
pm2:start Start services with PM2
health:check Check health of all services

Service Ports

  • Data Ingestion: 2001
  • Data Pipeline: 2002
  • Web API: 2003
  • Web App: 3000 (or next available)

Environment Variables

Key environment variables:

  • NODE_ENV: development, test, or production
  • PORT: Override default service port
  • Database connection strings
  • API keys for data providers

See config/config/default.json for full configuration options.