#!/bin/bash

echo "Starting Strapi backend on port 1337..."
cd /Users/saleem/Desktop/TEST/my-ecommerce
npm run dev &
STRAPI_PID=$!

echo "Waiting for Strapi to start..."
sleep 8

echo "Starting Next.js frontend on port 3000..."
cd /Users/saleem/Desktop/TEST/my-ecommerce/frontend
npm run dev &
NEXT_PID=$!

echo ""
echo "=========================================="
echo "🚀 Servers are starting up!"
echo ""
echo "  Frontend:  http://localhost:3000"
echo "  Strapi:    http://localhost:1337"
echo "  Admin:     http://localhost:1337/admin"
echo ""
echo "Press Ctrl+C to stop both servers"
echo "=========================================="

wait