crmfrontend/run.sh
vickytechkey 308a5ab9f5
All checks were successful
Production CI/CD Pipeline / build-and-test (push) Successful in 14s
Production CI/CD Pipeline / deploy-prod (push) Successful in 6s
Initial commit
2026-08-15 18:36:20 +05:30

42 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# DigiHox CRM Service Launcher
# Runs both the React frontend and Django backend concurrently
FRONTEND_DIR="/home/vignesh/github/crmfrontend"
BACKEND_DIR="/home/vignesh/github/crmbackend"
echo "=========================================="
echo "🚀 Starting DigiHox CRM Local Dev Servers..."
echo "=========================================="
# Function to handle exit cleanup
cleanup() {
echo ""
echo "=========================================="
echo "🛑 Shutting down servers gracefully..."
echo "=========================================="
kill "$BACKEND_PID" "$FRONTEND_PID" 2>/dev/null
exit 0
}
# Trap SIGINT (Ctrl+C) and SIGTERM
trap cleanup SIGINT SIGTERM
# 1. Start Django Backend
echo "Starting Django REST Backend on Port 8002..."
cd "$BACKEND_DIR" || exit 1
.venv/bin/python manage.py runserver 8002 &
BACKEND_PID=$!
# Wait a second for Django setup log lines
sleep 1.5
# 2. Start Vite Frontend
echo "Starting Vite React Frontend..."
cd "$FRONTEND_DIR" || exit 1
npm run dev -- --port 3000 &
FRONTEND_PID=$!
# Wait for background tasks
wait