Files
laca-website/scripts/setup.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

84 lines
1.9 KiB
Bash
Executable File

#!/bin/bash
# 🛠️ Smart Parking Finder - Project Setup Script
# This script sets up the complete development environment
set -e
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Navigate to project root
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Function to check if command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
print_status "🚗 Setting up Smart Parking Finder development environment..."
# Check Node.js
if command_exists node; then
NODE_VERSION=$(node --version)
print_success "Node.js is installed: $NODE_VERSION"
else
print_error "Node.js is not installed. Please install Node.js 18+ first."
exit 1
fi
# Check npm
if command_exists npm; then
NPM_VERSION=$(npm --version)
print_success "npm is installed: $NPM_VERSION"
else
print_error "npm is not installed."
exit 1
fi
# Setup Frontend
print_status "📦 Setting up Frontend dependencies..."
cd "$PROJECT_DIR/frontend"
npm install
print_success "Frontend dependencies installed"
# Setup Backend
print_status "📦 Setting up Backend dependencies..."
cd "$PROJECT_DIR/backend"
npm install
print_success "Backend dependencies installed"
# Make scripts executable
print_status "🔧 Making scripts executable..."
chmod +x "$PROJECT_DIR/scripts/"*.sh
print_success "Scripts are now executable"
print_success "🎉 Setup complete!"
echo ""
echo "🚀 To start the application:"
echo " 📱 Frontend only: ./scripts/frontend-only.sh"
echo " 🔄 Full development: ./scripts/full-dev.sh"
echo " 🐳 Docker development: ./scripts/docker-dev.sh"
echo " 🎯 Interactive menu: ./scripts/start.sh"