- Added multi-platform deployment architecture details (Web App, PWA, DApp) to README.md. - Included comprehensive troubleshooting guides and fix scripts in README.md. - Enhanced CHANGELOG.md with new features, fixes, and improvements, including TypeScript error resolutions and updated documentation structure. - Revised development setup instructions in DEV_SETUP.md to reflect changes in script usage and environment variable setup.
4.7 KiB
4.7 KiB
WSL/Ubuntu Setup Guide
This project has been migrated to use WSL (Windows Subsystem for Linux) with Ubuntu for development. All scripts have been converted from PowerShell to bash.
Prerequisites
-
Install WSL 2 with Ubuntu
# In PowerShell (as Administrator) wsl --install -d Ubuntu -
Verify WSL Installation
# In WSL/Ubuntu terminal wsl --version -
Install Required Tools in WSL
# Update package list sudo apt update && sudo apt upgrade -y # Install Node.js 18+ curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - sudo apt install -y nodejs # Install Docker (if not already installed) # Follow: https://docs.docker.com/engine/install/ubuntu/ # Install netcat (for port checking) sudo apt install -y netcat-openbsd # Install jq (for JSON parsing in scripts) sudo apt install -y jq # Install bc (for calculations in scripts) sudo apt install -y bc
Script Migration
All PowerShell scripts (.ps1) have been converted to bash scripts (.sh):
| PowerShell Script | Bash Script | Description |
|---|---|---|
start-dev.ps1 |
start-dev.sh |
Start development servers |
start-all.ps1 |
start-all.sh |
Start all services |
check-status.ps1 |
check-status.sh |
Check service status |
test-curl.ps1 |
test-curl.sh |
Test API endpoints |
fix-frontend.ps1 |
fix-frontend.sh |
Fix frontend issues |
setup-database.ps1 |
setup-database.sh |
Setup PostgreSQL database |
verify-services.ps1 |
verify-services.sh |
Verify all services |
complete-todos.ps1 |
complete-todos.sh |
Track todo completion |
consolidate-branches.ps1 |
consolidate-branches.sh |
Consolidate branches |
Making Scripts Executable
After cloning the repository, make all scripts executable:
# In WSL/Ubuntu terminal
cd /mnt/c/Users/intlc/defi_oracle_projects/CurrenciCombo
chmod +x scripts/*.sh
Usage
Start Development Servers
# Start webapp and orchestrator
./scripts/start-dev.sh
# Start all services (including database)
./scripts/start-all.sh
Check Service Status
./scripts/check-status.sh
Test API Endpoints
./scripts/test-curl.sh
Fix Frontend Issues
./scripts/fix-frontend.sh
Setup Database
./scripts/setup-database.sh
Verify Services
./scripts/verify-services.sh
Working with WSL
Accessing Windows Files
WSL mounts Windows drives at /mnt/c/, /mnt/d/, etc. Your project is likely at:
/mnt/c/Users/intlc/defi_oracle_projects/CurrenciCombo
Opening WSL from Windows
You can open WSL from Windows in several ways:
- Type
wslin PowerShell or Command Prompt - Type
ubuntuin Windows Start menu - Use Windows Terminal with WSL profile
Opening Windows Explorer from WSL
# Open current directory in Windows Explorer
explorer.exe .
Running Windows Commands from WSL
# Example: Open a URL in Windows browser
cmd.exe /c start http://localhost:3000
Differences from PowerShell
- Path Separators: Use
/instead of\ - Script Execution: Use
./script.shinstead of.\script.ps1 - Environment Variables: Use
$VARIABLEinstead of$env:VARIABLE - Command Chaining: Use
&∨instead of;in PowerShell - Background Processes: Use
&at end of command instead ofStart-Process
Troubleshooting
Scripts Not Executable
If you get "Permission denied" errors:
chmod +x scripts/*.sh
Port Already in Use
If a port is already in use:
# Find process using port 3000
lsof -ti:3000
# Kill process
kill $(lsof -ti:3000)
Docker Not Accessible
If Docker commands fail:
# Check if Docker daemon is running
sudo service docker status
# Start Docker daemon if needed
sudo service docker start
# Add user to docker group (one-time setup)
sudo usermod -aG docker $USER
# Then log out and back in
Node.js Not Found
If Node.js is not found:
# Check Node.js version
node --version
# If not installed, use nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18
Next Steps
- Make all scripts executable:
chmod +x scripts/*.sh - Set up environment variables (see main README)
- Install dependencies:
npm installin each directory - Start services:
./scripts/start-all.sh - Verify services:
./scripts/check-status.sh