#!/bin/bash
# Quick Install Helper
set -e

show_menu() {
    clear
    echo "==================================="
    echo "     QUICK INSTALL HELPER"
    echo "==================================="
    echo "1) Update System"
    echo "2) Install Docker"
    echo "3) Install Docker Compose"
    echo "4) Install Git"
    echo "5) Install Python3 + pip"
    echo "6) Install Node.js (via NodeSource)"
    echo "7) Install Basic Tools (curl, wget, vim, htop)"
    echo "8) Exit"
    echo "==================================="
    read -p "Select option [1-8]: " choice
    
    case $choice in
        1)
            echo "Updating system..."
            sudo apt update && sudo apt upgrade -y
            echo "System updated!"
            ;;
        2)
            echo "Installing Docker..."
            curl -fsSL https://get.docker.com | sudo bash
            sudo usermod -aG docker $USER
            echo "Docker installed! Please re-login for group changes."
            ;;
        3)
            echo "Installing Docker Compose..."
            sudo apt install -y docker-compose
            echo "Docker Compose installed!"
            ;;
        4)
            echo "Installing Git..."
            sudo apt install -y git
            echo "Git installed!"
            ;;
        5)
            echo "Installing Python3 + pip..."
            sudo apt install -y python3 python3-pip python3-venv
            echo "Python3 installed!"
            ;;
        6)
            echo "Installing Node.js..."
            curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
            sudo apt install -y nodejs
            echo "Node.js installed!"
            ;;
        7)
            echo "Installing basic tools..."
            sudo apt install -y curl wget vim htop net-tools
            echo "Basic tools installed!"
            ;;
        8)
            echo "Goodbye!"
            exit 0
            ;;
        *)
            echo "Invalid option!"
            ;;
    esac
    
    read -p "Press Enter to continue..."
}

# Main loop
while true; do
    show_menu
done
