forked from RiyaluxInnovates/PaksaFinancialSystem
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart-dev.sh
More file actions
executable file
·90 lines (70 loc) · 2.08 KB
/
Copy pathstart-dev.sh
File metadata and controls
executable file
·90 lines (70 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/bash
# Paksa Financial System Development Startup Script
echo "🚀 Starting Paksa Financial System Development Environment"
echo "========================================================="
# Check if Python is installed
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.9+ to continue."
exit 1
fi
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 16+ to continue."
exit 1
fi
echo "✅ Prerequisites check passed"
# Backend setup
echo ""
echo "🔧 Setting up Backend..."
cd backend
# Create virtual environment if it doesn't exist
if [ ! -d "venv" ]; then
echo "📦 Creating Python virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔄 Activating virtual environment..."
source venv/bin/activate
# Install Python dependencies
echo "📦 Installing Python dependencies..."
pip install -r requirements.txt
# Run database migrations
echo "🗄️ Running database migrations..."
alembic upgrade head
# Start backend server in background
echo "🚀 Starting FastAPI backend server..."
uvicorn main:app --reload --host 0.0.0.0 --port 8000 &
BACKEND_PID=$!
cd ..
# Frontend setup
echo ""
echo "🔧 Setting up Frontend..."
cd frontend
# Install Node.js dependencies
echo "📦 Installing Node.js dependencies..."
npm install
# Start frontend development server
echo "🚀 Starting Vue.js frontend server..."
npm run dev &
FRONTEND_PID=$!
cd ..
echo ""
echo "✅ Development environment started successfully!"
echo "📊 Backend API: http://localhost:8000"
echo "🌐 Frontend App: http://localhost:3000"
echo "📚 API Documentation: http://localhost:8000/docs"
echo ""
echo "Press Ctrl+C to stop all servers"
# Function to cleanup on exit
cleanup() {
echo ""
echo "🛑 Stopping servers..."
kill $BACKEND_PID 2>/dev/null
kill $FRONTEND_PID 2>/dev/null
echo "✅ All servers stopped"
exit 0
}
# Set trap to cleanup on script exit
trap cleanup SIGINT SIGTERM
# Wait for user to stop
wait