Files
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
..

📂 Scripts Directory

This directory contains all the deployment and development scripts for Smart Parking Finder.

📋 Available Scripts

🚀 Development Scripts

Script Purpose Usage
start.sh 🎯 Interactive menu with all options ./scripts/start.sh
frontend-only.sh 🎨 Start frontend only (fastest) ./scripts/frontend-only.sh
full-dev.sh 🔄 Full development environment ./scripts/full-dev.sh
docker-dev.sh 🐳 Docker development with all services ./scripts/docker-dev.sh
setup.sh 🛠️ Initial project setup ./scripts/setup.sh

🚀 Production Deployment Scripts

Script Purpose Usage
deploy-production.sh 🌐 Full production deployment to VPS ./scripts/deploy-production.sh
deploy-update.sh 🔄 Quick updates (frontend/backend/static) ./scripts/deploy-update.sh
deploy-docker.sh 🐳 Docker-based production deployment ./scripts/deploy-docker.sh
setup-vps.sh 🛠️ Initial VPS server setup Run on VPS as root

📖 Documentation

File Purpose
DEPLOYMENT_GUIDE.md 📘 Complete deployment guide
.env.example 🔧 Environment configuration template

🎯 Quick Access from Root

From the project root directory, you can use:

# Interactive launcher with quick options
./launch.sh

# Direct script access
./scripts/start.sh
./scripts/frontend-only.sh
./scripts/full-dev.sh
./scripts/docker-dev.sh
./scripts/setup.sh

📖 Script Details

1. start.sh - Interactive Menu

Purpose: Provides a colorful interactive menu with all deployment options.

Features:

  • Frontend only deployment
  • Network access (other devices on WiFi)
  • Global access (via ngrok)
  • Full development environment
  • Docker development environment

Usage:

./scripts/start.sh
# Follow the interactive menu (options 1-6)

2. frontend-only.sh - Quick Demo

Purpose: Fastest way to see the application interface.

What it does:

  • Installs frontend dependencies (if needed)
  • Starts Next.js development server on http://localhost:3000
  • No backend required

Usage:

./scripts/frontend-only.sh

Note: Some features may not work without backend.

3. full-dev.sh - Complete Development

Purpose: Start both frontend and backend for full functionality.

What it does:

Usage:

./scripts/full-dev.sh

Requirements: Node.js 18+

4. docker-dev.sh - Full Environment

Purpose: Complete development environment with all services.

What it includes:

Usage:

./scripts/docker-dev.sh

Requirements: Docker Desktop

5. setup.sh - Initial Setup

Purpose: One-time setup for new developers.

What it does:

  • Checks Node.js and npm installation
  • Installs frontend dependencies
  • Installs backend dependencies
  • Makes all scripts executable
  • Provides next steps

Usage:

./scripts/setup.sh

🔧 Script Features

Error Handling

All scripts include:

  • Prerequisite checking (Node.js, Docker, etc.)
  • Graceful error messages
  • Cleanup on exit (Ctrl+C)
  • Colored output for better readability

Auto-Installation

Scripts automatically:

  • 📦 Install npm dependencies if not present
  • 🔧 Make scripts executable
  • Start services in the correct order

Cross-Platform Support

Scripts are designed for:

  • 🍎 macOS (primary)
  • 🐧 Linux
  • 🪟 Windows (via Git Bash/WSL)

🎨 Color Coding

Scripts use consistent color coding:

  • 🔵 Blue: Information and headers
  • 🟢 Green: Success messages and URLs
  • 🟡 Yellow: Warnings and tips
  • 🔴 Red: Errors and problems
  • 🟦 Cyan: Special highlights

🚀 Getting Started

First Time Setup

# 1. Run initial setup
./scripts/setup.sh

# 2. Choose your development style:
# Quick demo
./scripts/frontend-only.sh

# Full development
./scripts/full-dev.sh

# Complete environment
./scripts/docker-dev.sh

# Interactive menu
./scripts/start.sh

Daily Development

# Most common: Start frontend only for quick testing
./scripts/frontend-only.sh

# When working on backend: Full development
./scripts/full-dev.sh

# When testing integrations: Docker environment
./scripts/docker-dev.sh

🔄 Migration from Old Scripts

The old scripts have been reorganized:

Old Script New Script Status
start.sh scripts/start.sh Enhanced with better UI
start-frontend-only.sh scripts/frontend-only.sh Renamed and improved
start-dev.sh scripts/docker-dev.sh Moved and enhanced
start-local.sh scripts/full-dev.sh Renamed for clarity
start-global.sh Part of scripts/start.sh Integrated into menu
start-network.sh Part of scripts/start.sh Integrated into menu
setup.sh scripts/setup.sh Moved and enhanced

📞 Support

If you encounter issues with any script:

  1. Check the colored error messages
  2. Ensure prerequisites are installed
  3. Run the setup script: ./scripts/setup.sh
  4. Check the main documentation in Documents/README.md

All scripts are located in the scripts/ directory for better organization.