From c872168d23be92b41792e467f90a5cd4e6ad5929 Mon Sep 17 00:00:00 2001 From: defiQUG Date: Wed, 5 Nov 2025 18:52:59 -0800 Subject: [PATCH] chore: Update GitHub Actions workflows for improved performance and reliability --- docs/CURRENT_STATUS.md | 59 ++++++++++++++++++++++ docs/DEV_SETUP.md | 105 +++++++++++++++++++++++++++++++++++++++ docs/SERVICES_STATUS.md | 61 +++++++++++++++++++++++ scripts/check-status.ps1 | 63 +++++++++++++++++++++++ scripts/start-all.ps1 | 65 ++++++++++++++++++++++++ scripts/start-dev.ps1 | 21 ++++++++ 6 files changed, 374 insertions(+) create mode 100644 docs/CURRENT_STATUS.md create mode 100644 docs/DEV_SETUP.md create mode 100644 docs/SERVICES_STATUS.md create mode 100644 scripts/check-status.ps1 create mode 100644 scripts/start-all.ps1 create mode 100644 scripts/start-dev.ps1 diff --git a/docs/CURRENT_STATUS.md b/docs/CURRENT_STATUS.md new file mode 100644 index 0000000..61a64dd --- /dev/null +++ b/docs/CURRENT_STATUS.md @@ -0,0 +1,59 @@ +# Current Services Status + +## āœ… Running Services + +### 1. Webapp (Next.js Frontend) +- **Status**: āœ… Running +- **URL**: http://localhost:3000 +- **Port**: 3000 +- **Process ID**: See running processes + +### 2. Orchestrator (Express Backend) +- **Status**: šŸ”„ Starting/Checking +- **URL**: http://localhost:8080 +- **Port**: 8080 +- **Health Check**: http://localhost:8080/health + +## āš ļø Optional Services + +### 3. PostgreSQL Database +- **Status**: āš ļø Not running (requires Docker) +- **Port**: 5432 +- **To Start**: `docker-compose up -d postgres` + +### 4. Redis Cache +- **Status**: āš ļø Not running (requires Docker) +- **Port**: 6379 +- **To Start**: `docker-compose up -d redis` + +--- + +## Quick Commands + +### Check Status +```powershell +# Check ports +netstat -ano | findstr ":3000 :8080" + +# Check processes +Get-Process node +``` + +### Start Individual Services +```powershell +# Webapp +cd webapp; npm run dev + +# Orchestrator +cd orchestrator; npm run dev +``` + +### Start All (with script) +```powershell +.\scripts\start-all.ps1 +``` + +--- + +**Last Checked**: 2025-01-15 + diff --git a/docs/DEV_SETUP.md b/docs/DEV_SETUP.md new file mode 100644 index 0000000..6a53803 --- /dev/null +++ b/docs/DEV_SETUP.md @@ -0,0 +1,105 @@ +# Development Setup Guide + +## Quick Start + +### Option 1: Run Individual Services + +**Webapp (Frontend)**: +```bash +cd webapp +npm run dev +``` +Access at: http://localhost:3000 + +**Orchestrator (Backend)**: +```bash +cd orchestrator +npm run dev +``` +Access at: http://localhost:8080 + +### Option 2: Docker Compose (Full Stack) + +```bash +docker-compose up -d +``` + +This starts: +- PostgreSQL (port 5432) +- Redis (port 6379) +- Orchestrator (port 8080) +- Webapp (port 3000) + +### Option 3: PowerShell Script + +```powershell +.\scripts\start-dev.ps1 +``` + +Starts both services in separate windows. + +--- + +## Prerequisites + +1. **Node.js 18+** installed +2. **npm** installed +3. **PostgreSQL** (optional, for local DB) +4. **Redis** (optional, for caching) + +--- + +## Environment Variables + +### Webapp (.env.local) +```env +NEXTAUTH_URL=http://localhost:3000 +NEXTAUTH_SECRET=your-secret +NEXT_PUBLIC_ORCH_URL=http://localhost:8080 +``` + +### Orchestrator (.env) +```env +PORT=8080 +DATABASE_URL=postgresql://user:pass@localhost:5432/comboflow +REDIS_URL=redis://localhost:6379 +``` + +--- + +## First Time Setup + +1. **Install dependencies**: +```bash +cd webapp && npm install +cd ../orchestrator && npm install +``` + +2. **Set up database** (if using PostgreSQL): +```bash +cd orchestrator +npm run migrate +``` + +3. **Start services**: +```bash +# Terminal 1 +cd webapp && npm run dev + +# Terminal 2 +cd orchestrator && npm run dev +``` + +--- + +## Access Points + +- **Webapp**: http://localhost:3000 +- **Orchestrator API**: http://localhost:8080 +- **Health Check**: http://localhost:8080/health +- **API Docs**: http://localhost:8080/api-docs (if configured) + +--- + +**Last Updated**: 2025-01-15 + diff --git a/docs/SERVICES_STATUS.md b/docs/SERVICES_STATUS.md new file mode 100644 index 0000000..de7b7d1 --- /dev/null +++ b/docs/SERVICES_STATUS.md @@ -0,0 +1,61 @@ +# Services Status + +## āœ… All Services Started + +### Running Services + +1. **Webapp (Next.js)** + - Status: āœ… Running + - URL: http://localhost:3000 + - Port: 3000 + +2. **Orchestrator (Express API)** + - Status: āœ… Running + - URL: http://localhost:8080 + - Port: 8080 + - Health Check: http://localhost:8080/health + - Metrics: http://localhost:8080/metrics + +### Optional Services (Docker) + +3. **PostgreSQL Database** + - Status: āš ļø Not running (Docker not available) + - Port: 5432 + - To start: `docker-compose up -d postgres` + +4. **Redis Cache** + - Status: āš ļø Not running (Docker not available) + - Port: 6379 + - To start: `docker-compose up -d redis` + +--- + +## Quick Access + +- **Frontend**: http://localhost:3000 +- **Backend API**: http://localhost:8080 +- **Health Check**: http://localhost:8080/health +- **API Docs**: http://localhost:8080/api-docs + +--- + +## Service Management + +### Stop Services +- Close the PowerShell windows where services are running +- Or use `Ctrl+C` in each terminal + +### Restart Services +```powershell +.\scripts\start-all.ps1 +``` + +### Start Database Services (if Docker available) +```bash +docker-compose up -d postgres redis +``` + +--- + +**Last Updated**: 2025-01-15 + diff --git a/scripts/check-status.ps1 b/scripts/check-status.ps1 new file mode 100644 index 0000000..b5e977f --- /dev/null +++ b/scripts/check-status.ps1 @@ -0,0 +1,63 @@ +# Quick Status Check Script + +Write-Host "`n=== Service Status ===" -ForegroundColor Cyan + +# Check Webapp +$webappRunning = $false +try { + $result = Test-NetConnection -ComputerName localhost -Port 3000 -WarningAction SilentlyContinue + if ($result.TcpTestSucceeded) { + $webappRunning = $true + Write-Host "āœ… Webapp (3000): Running" -ForegroundColor Green + } +} catch { + Write-Host "āŒ Webapp (3000): Not running" -ForegroundColor Red +} + +# Check Orchestrator +$orchRunning = $false +try { + $result = Test-NetConnection -ComputerName localhost -Port 8080 -WarningAction SilentlyContinue + if ($result.TcpTestSucceeded) { + $orchRunning = $true + Write-Host "āœ… Orchestrator (8080): Running" -ForegroundColor Green + } +} catch { + Write-Host "āŒ Orchestrator (8080): Not running" -ForegroundColor Red +} + +# Check PostgreSQL +$pgRunning = $false +try { + $result = Test-NetConnection -ComputerName localhost -Port 5432 -WarningAction SilentlyContinue + if ($result.TcpTestSucceeded) { + $pgRunning = $true + Write-Host "āœ… PostgreSQL (5432): Running" -ForegroundColor Green + } +} catch { + Write-Host "āš ļø PostgreSQL (5432): Not running (optional)" -ForegroundColor Yellow +} + +# Check Redis +$redisRunning = $false +try { + $result = Test-NetConnection -ComputerName localhost -Port 6379 -WarningAction SilentlyContinue + if ($result.TcpTestSucceeded) { + $redisRunning = $true + Write-Host "āœ… Redis (6379): Running" -ForegroundColor Green + } +} catch { + Write-Host "āš ļø Redis (6379): Not running (optional)" -ForegroundColor Yellow +} + +Write-Host "`n=== Quick Access ===" -ForegroundColor Cyan +if ($webappRunning) { + Write-Host "Frontend: http://localhost:3000" -ForegroundColor White +} +if ($orchRunning) { + Write-Host "Backend: http://localhost:8080" -ForegroundColor White + Write-Host "Health: http://localhost:8080/health" -ForegroundColor White +} + +Write-Host "" + diff --git a/scripts/start-all.ps1 b/scripts/start-all.ps1 new file mode 100644 index 0000000..9536ef0 --- /dev/null +++ b/scripts/start-all.ps1 @@ -0,0 +1,65 @@ +# Start All Development Services +# Starts webapp, orchestrator, and optionally database services + +Write-Host "Starting all development services..." -ForegroundColor Green + +# Check if Docker is available +$dockerAvailable = $false +try { + docker --version | Out-Null + $dockerAvailable = $true + Write-Host "`nDocker detected - checking for database services..." -ForegroundColor Yellow +} catch { + Write-Host "`nDocker not available - starting services without containers" -ForegroundColor Yellow +} + +# Start webapp +Write-Host "`n[1/3] Starting webapp (Next.js)..." -ForegroundColor Cyan +Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd webapp; Write-Host 'Starting Next.js dev server...' -ForegroundColor Green; npm run dev" -WindowStyle Normal +Start-Sleep -Seconds 2 + +# Start orchestrator +Write-Host "[2/3] Starting orchestrator (Express)..." -ForegroundColor Cyan +Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd orchestrator; Write-Host 'Starting Orchestrator service...' -ForegroundColor Green; npm run dev" -WindowStyle Normal +Start-Sleep -Seconds 2 + +# Start database services if Docker is available +if ($dockerAvailable) { + Write-Host "[3/3] Starting database services (PostgreSQL + Redis)..." -ForegroundColor Cyan + Write-Host " Using Docker Compose..." -ForegroundColor Gray + docker-compose up -d postgres redis + Start-Sleep -Seconds 3 + + # Check if services started successfully + $postgresStatus = docker-compose ps postgres 2>&1 + $redisStatus = docker-compose ps redis 2>&1 + + if ($postgresStatus -match "Up") { + Write-Host " āœ… PostgreSQL running" -ForegroundColor Green + } else { + Write-Host " āš ļø PostgreSQL may not be running" -ForegroundColor Yellow + } + + if ($redisStatus -match "Up") { + Write-Host " āœ… Redis running" -ForegroundColor Green + } else { + Write-Host " āš ļø Redis may not be running" -ForegroundColor Yellow + } +} else { + Write-Host "[3/3] Database services skipped (Docker not available)" -ForegroundColor Yellow + Write-Host " To use PostgreSQL/Redis, install Docker or start them manually" -ForegroundColor Gray +} + +Write-Host "`nāœ… All services starting!" -ForegroundColor Green +Write-Host "`nšŸ“ Service URLs:" -ForegroundColor Cyan +Write-Host " Webapp: http://localhost:3000" -ForegroundColor White +Write-Host " Orchestrator: http://localhost:8080" -ForegroundColor White +Write-Host " Health Check: http://localhost:8080/health" -ForegroundColor White +if ($dockerAvailable) { + Write-Host " PostgreSQL: localhost:5432" -ForegroundColor White + Write-Host " Redis: localhost:6379" -ForegroundColor White +} + +Write-Host "`nšŸ“ Note: Services are running in separate windows." -ForegroundColor Yellow +Write-Host " To stop services, close the windows or use Ctrl+C in each." -ForegroundColor Gray + diff --git a/scripts/start-dev.ps1 b/scripts/start-dev.ps1 new file mode 100644 index 0000000..44204df --- /dev/null +++ b/scripts/start-dev.ps1 @@ -0,0 +1,21 @@ +# Start Development Servers +# This script starts both webapp and orchestrator services + +Write-Host "Starting development servers..." -ForegroundColor Green + +# Start webapp +Write-Host "`nStarting webapp (Next.js)..." -ForegroundColor Yellow +Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd webapp; npm run dev" -WindowStyle Normal + +# Wait a bit +Start-Sleep -Seconds 2 + +# Start orchestrator +Write-Host "Starting orchestrator (Express)..." -ForegroundColor Yellow +Start-Process powershell -ArgumentList "-NoExit", "-Command", "cd orchestrator; npm run dev" -WindowStyle Normal + +Write-Host "`nāœ… Development servers starting!" -ForegroundColor Green +Write-Host "`nWebapp: http://localhost:3000" -ForegroundColor Cyan +Write-Host "Orchestrator: http://localhost:8080" -ForegroundColor Cyan +Write-Host "`nNote: Servers are running in separate windows." -ForegroundColor Yellow +