#!/bin/bash

echo "🚀 Starting BMAD Task Manager..."
echo ""
echo "📦 Installing dependencies..."
npm install

echo ""
echo "🔧 Building TypeScript..."
cd server && npm run build && cd ..

echo ""
echo "🎯 Starting services..."
echo "  - Web API Server on http://localhost:3001"
echo "  - Web UI on http://localhost:3001"
echo "  - MCP Server available via stdio"
echo ""

# Start web server (includes API) and web UI in parallel
npx concurrently \
  --names "API,WEB" \
  --prefix-colors "bgBlue.bold,bgGreen.bold" \
  "cd server && npm run dev:web" \
  "cd web && npm run dev"