#!/usr/bin/env bash # Secure Video & File Sharing Management System - Linux Launcher # Compatible with Ubuntu, Debian, CentOS, Fedora, and Arch Linux set -e echo "======================================================================" echo " Secure Video & File Sharing Management System (Linux)" echo "======================================================================" echo "" # Check Node.js if ! command -v node &> /dev/null; then echo "[ERROR] Node.js is not installed! Please install Node.js 20+." exit 1 fi # Check FFmpeg if ! command -v ffmpeg &> /dev/null; then echo "[WARN] FFmpeg is not found in system PATH. Video transcoding requires FFmpeg." echo " Install with: sudo apt-get install -y ffmpeg (Ubuntu/Debian)" fi echo "[1/4] Generating Prisma Client and Shared Types..." npm run prisma:generate --workspace=apps/backend npm run build --workspace=@fileshare/shared echo "[2/4] Ensuring storage directory exists on Linux filesystem..." mkdir -p storage chmod 755 storage echo "[3/4] Applying database migrations..." npm run prisma:migrate:deploy --workspace=apps/backend echo "[4/4] Starting Full-Stack Services (Backend on :4000, Frontend on :3000)..." echo "" echo "======================================================================" echo " Backend API: http://localhost:4000/api/v1" echo " Swagger Docs: http://localhost:4000/api/docs" echo " Frontend UI: http://localhost:3000" echo "======================================================================" echo "" npx concurrently --kill-others -n "BACKEND,FRONTEND" -c "cyan,magenta" \ "npm run start:dev --workspace=apps/backend" \ "npm run dev --workspace=apps/frontend"