A modern Node.js/React implementation of the legacy CryptoBot cryptocurrency trading platform. This project represents a complete migration from the original .NET/C# codebase to a TypeScript-based monorepo architecture, achieved using AI assistance with Claude Code.
This repository is part of an experiment to evaluate AI-assisted code migration capabilities:
- Original Project: CryptoBot - Legacy .NET/C# cryptocurrency trading bot
- Node.js Migration (this repo): Full migration to Node.js/TypeScript/React using Claude Code
- Modern .NET Migration: cryptobot-dotnet-migration - Migration to latest .NET tech stack
The migration successfully transformed a complex .NET trading application into a modern JavaScript ecosystem while maintaining all core functionality and adding new features.
- Multi-Exchange Support: Coinbase Pro, Bittrex, Binance (planned), with simulator mode
- Technical Indicators: RSI, MACD, SMA, EMA, Bollinger Bands, ATR
- Automated Trading Strategies: RSI Oversold/Overbought, MACD Crossover
- Risk Management: Position sizing, stop losses, safety engine
- Paper Trading: Test strategies without real money
- Modern Web Interface: React 18 with shadcn/ui and dark theme support
- Real-time Updates: WebSocket connections for live data streaming
- TypeScript Throughout: Full type safety across the entire codebase
- Monorepo Architecture: Clean separation of concerns with pnpm workspaces
- Modern Database Layer: Prisma ORM replacing Entity Framework
- JWT Authentication: Secure API access
- Responsive Design: Mobile-friendly trading interface
This TypeScript monorepo maintains the logical structure of the original .NET application while adopting modern JavaScript patterns:
cryptobot-nodejs-migration/
βββ frontend/ # React application (replacing WPF/Console UI)
βββ backend/ # Express.js API server (replacing .NET Core API)
βββ packages/
βββ @cryptobot/types # Shared TypeScript types
βββ @cryptobot/database # Prisma ORM (replacing Entity Framework)
βββ @cryptobot/indicators # Technical analysis (ported from C#)
βββ @cryptobot/exchanges # Exchange connectors (ported from C#)
βββ @cryptobot/trading # Trading engine (ported from C#)
| Component | Original (.NET) | Node.js Migration |
|---|---|---|
| Backend Runtime | .NET Core | Node.js + TypeScript |
| API Framework | ASP.NET Core | Express.js |
| Database ORM | Entity Framework | Prisma |
| Database | SQL Server | PostgreSQL (Neon) |
| Frontend | WPF/Console | React 18 + Vite |
| UI Components | Native Windows | shadcn/ui + Tailwind |
| Real-time | SignalR | Socket.io |
| Authentication | Identity | JWT |
| Package Manager | NuGet | pnpm |
| Build System | MSBuild | TypeScript + Vite |
- Node.js 18+
- pnpm (recommended) or npm
- PostgreSQL database (or Neon account)
- Clone the repository:
git clone https://github.com/TonyCasey/cryptobot-nodejs-migration.git
cd cryptobot-nodejs-migration- Install dependencies:
pnpm install
# or
npm install- Set up environment variables:
# Backend
cp backend/.env.example backend/.env
# Edit backend/.env with your configuration- Set up the database:
cd backend
npm run db:generate
npm run db:push
npm run db:seed- Build packages:
npm run build:packagesStart all services in development mode:
npm run devOr start services individually:
# Backend (port 5000)
npm run dev:backend
# Frontend (port 3000)
npm run dev:frontendDirect port of the original technical analysis library:
- Simple Moving Average (SMA)
- Exponential Moving Average (EMA)
- Relative Strength Index (RSI)
- MACD (Moving Average Convergence Divergence)
- Bollinger Bands
- Average True Range (ATR)
Exchange connectors migrated from the original C# implementations:
- Coinbase Pro: Full trading support
- Simulator: Paper trading mode
- Extensible architecture for additional exchanges
Core trading engine functionality ported from C#:
- Strategy framework
- Signal generation
- Order execution
- Risk management
- Performance tracking
Shared TypeScript interfaces ensuring type safety across the monorepo.
Prisma-based database layer replacing Entity Framework with models for users, strategies, orders, and market data.
- β All core trading strategies
- β Technical indicator calculations
- β Exchange integration logic
- β Risk management algorithms
- β Database schema and relationships
- β Business logic and workflows
- π¨ Modern, responsive UI with dark theme
- π Improved real-time data handling
- π¦ Better code organization with monorepo
- π Enhanced type safety with TypeScript
- π Better performance with modern tooling
# Create Heroku app
heroku create your-cryptobot-backend
# Add PostgreSQL addon
heroku addons:create heroku-postgresql:essential-0
# Deploy
git push heroku main- Connect your GitHub repository to Vercel
- Set build command:
npm run build:frontend - Set output directory:
frontend/dist
- Original Codebase: ~15,000 lines of C# code
- Migrated Codebase: ~12,000 lines of TypeScript
- Migration Time: Completed with AI assistance
- Test Coverage: Maintained from original
- Performance: Comparable to original implementation
This software is for educational purposes only. Cryptocurrency trading involves significant risk of loss. This migration project demonstrates AI-assisted code transformation capabilities and should not be used for actual trading without thorough testing and validation.
This migration was accomplished using Claude Code, demonstrating:
- Successful transformation of complex business logic between languages
- Preservation of architectural patterns while adopting new paradigms
- Enhancement of user experience through modern web technologies
- Maintenance of core functionality while improving code organization
MIT License (inherited from original project)