stock-bot/apps/stock
2025-06-23 21:39:04 -04:00
..
config added logging 2025-06-23 14:36:47 -04:00
data-ingestion removed deprecated code 2025-06-23 21:39:04 -04:00
data-pipeline fixed pipeline handlers 2025-06-23 18:46:22 -04:00
scripts refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
web-api handler to auto register and removed service registry, cleaned up queues and cache naming 2025-06-23 21:23:38 -04:00
web-app fixed lint issues 2025-06-23 17:07:30 -04:00
ecosystem.config.js refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
package.json refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
README.md refactored monorepo for more projects 2025-06-22 23:48:01 -04:00
tsconfig.json refactored monorepo for more projects 2025-06-22 23:48:01 -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.