Files
laca-website/scripts/full-dev.sh
PhongPham 51f2505839 🚀 Complete Laca City Website with VPS Deployment
- Added complete Next.js frontend with responsive design
- Added NestJS backend with PostgreSQL and Redis
- Added comprehensive VPS deployment script (vps-deploy.sh)
- Added deployment guide and documentation
- Added all assets and static files
- Configured SSL, Nginx, PM2, and monitoring
- Ready for production deployment on any VPS
2025-08-12 07:06:15 +07:00

59 lines
1.3 KiB
Bash
Executable File

``#!/bin/bash
# 🔄 Full Development Environment (Frontend + Backend)
echo "🔄 Starting Full Development Environment..."
# Navigate to project root
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Check Node.js
if ! command_exists node; then
echo "❌ Node.js is not installed. Please install Node.js first."
exit 1
fi
echo "✅ Node.js is ready"
# Start backend in background
echo "🔧 Starting Backend on http://localhost:3001..."
cd "$PROJECT_DIR/backend"
if [ ! -d "node_modules" ]; then
echo "📦 Installing backend dependencies..."
npm install
fi
npm run start:dev &
BACKEND_PID=$!
# Start frontend
echo "🎨 Starting Frontend on http://localhost:3000..."
cd "$PROJECT_DIR/frontend"
if [ ! -d "node_modules" ]; then
echo "📦 Installing frontend dependencies..."
npm install
fi
# Wait a bit for backend to start
sleep 3
npm run dev &
FRONTEND_PID=$!
echo "🎉 Full development environment started!"
echo "Frontend: http://localhost:3000"
echo "Backend: http://localhost:3001"
# Wait for user to exit
echo "Press Ctrl+C to stop all services..."
# Cleanup on exit
trap "kill $BACKEND_PID $FRONTEND_PID 2>/dev/null" EXIT
wait