Skip to main content

๐Ÿ› ๏ธ Development Setup Guide

Complete guide to setting up your BLGV development environment.

๐ŸŽฏ Prerequisitesโ€‹

Required Softwareโ€‹

  • Node.js 20+ - JavaScript runtime
  • Docker & Docker Compose - Containerization
  • Git - Version control
  • Python 3.11+ - For pool and AI components
  • PostgreSQL Client - Database access

Development Toolsโ€‹

  • Cursor AI - Primary IDE with MCP integration
  • VS Code - Alternative IDE
  • Bruno/Postman - API testing
  • DBeaver - Database management

๐Ÿณ Regtest Environment Setupโ€‹

Start Full Ecosystemโ€‹

cd regtest-ecosystem
./start-regtest.sh

Individual Componentsโ€‹

# Start specific platform
docker-compose up treasury -d
docker-compose up dex -d
docker-compose up pool -d
docker-compose up lsp -d

# Check status
docker-compose ps

Environment Variablesโ€‹

# Development
DATABASE_URL=postgresql://postgres:password@localhost:5432/blgv_dev
NODE_ENV=development
DEBUG=true

# Regtest
DATABASE_URL=postgresql://postgres:password@localhost:5433/blgv_regtest
BITCOIN_NETWORK=regtest
BTCPAY_SERVER_URL=http://localhost:14142

๐Ÿ“ฑ Mobile Developmentโ€‹

Expo Setupโ€‹

cd platforms/blgv-wallet-app
npm install
npx expo install

# Start for iOS
npx expo run:ios

# Start for Android
npx expo run:android

Device Configurationโ€‹

# Get your local IP
ipconfig getifaddr en0 # macOS
ip route get 1 | awk '{print $7}' # Linux

# Update mobile .env
EXPO_PUBLIC_API_BASE_URL=http://YOUR_IP:3004

๐ŸŒ Web Developmentโ€‹

Treasury Platformโ€‹

cd platforms/treasury
npm install
npm run dev # http://localhost:3001

DEX Platformโ€‹

cd platforms/dex
npm install
npm run dev # http://localhost:3002

Mining Poolโ€‹

cd platforms/pool
pip install -r requirements.txt
python app.py # http://localhost:3003

๐Ÿ”Œ Unified API Serverโ€‹

cd server
npm install
npm run build
npm run dev # http://localhost:3004

๐Ÿงช Testing Setupโ€‹

Unit Testsโ€‹

# JavaScript/TypeScript
npm test

# Python
pytest

Integration Testsโ€‹

# Full ecosystem test
./regtest-ecosystem/test-ecosystem.sh

๐Ÿ”ง IDE Configurationโ€‹

Cursor AI Settingsโ€‹

{
"typescript.preferences.packageJsonAutoImports": "on",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}
  • TypeScript and JavaScript Language Features
  • Tailwind CSS IntelliSense
  • Bitcoin Development Pack
  • Docker
  • GitLens

๐Ÿ› Common Issuesโ€‹

Docker Issuesโ€‹

# Reset everything
docker-compose down -v
docker system prune -f
./start-regtest.sh

Node.js Issuesโ€‹

# Clear cache
npm cache clean --force
rm -rf node_modules package-lock.json
npm install

Database Issuesโ€‹

# Reset database
docker-compose down postgres
docker volume prune
docker-compose up postgres -d

๐Ÿ“š Next Stepsโ€‹

  1. Testing Strategy - Learn testing approaches
  2. Best Practices - Follow development standards
  3. Deployment Guide - Deploy to production
  4. SDK Documentation - Use the unified SDK

๐Ÿ†˜ Getting Helpโ€‹

  • Documentation: Check platform-specific docs in /platforms
  • Issues: Create GitHub issues for bugs
  • Discord: Join the BLGV developer channel
  • Email: [email protected]