-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·34 lines (27 loc) · 913 Bytes
/
start.sh
File metadata and controls
executable file
·34 lines (27 loc) · 913 Bytes
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
#!/bin/bash
# LearningSteps API Startup Script
echo "🚀 Starting LearningSteps API..."
# Check if we're in the right directory
if [ ! -f "api/main.py" ]; then
echo "❌ Please run this script from the project root directory"
exit 1
fi
# Check if virtual environment exists
if [ ! -d "venv" ]; then
echo "📦 Creating virtual environment..."
python3 -m venv venv
fi
# Activate virtual environment
echo "🔧 Activating virtual environment..."
source venv/bin/activate
# Install dependencies
echo "📥 Installing dependencies..."
pip install -r api/requirements.txt
# Check if .env file exists
if [ ! -f ".env" ]; then
echo "⚠️ Warning: .env file not found. Make sure to set DATABASE_URL"
fi
# Start the API
echo "🎉 Starting FastAPI server..."
echo "📖 API docs will be available at: http://localhost:8000/docs"
cd api && uvicorn main:app --reload --host 0.0.0.0 --port 8000