-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·50 lines (41 loc) · 1.37 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·50 lines (41 loc) · 1.37 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
#!/bin/bash
set -e
echo "🚀 Setting up VeriBatch..."
# Check if PostgreSQL is installed
if ! command -v psql &> /dev/null; then
echo "❌ PostgreSQL is not installed. Please install it first:"
echo " sudo apt-get install postgresql postgresql-contrib"
exit 1
fi
echo "✅ PostgreSQL found"
# Create database and user
echo "📦 Creating database and user..."
sudo -u postgres psql << EOF
SELECT 'CREATE DATABASE originstack' WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'originstack')\gexec
SELECT 'CREATE USER originstack WITH PASSWORD ''originstack''' WHERE NOT EXISTS (SELECT FROM pg_user WHERE usename = 'originstack')\gexec
GRANT ALL PRIVILEGES ON DATABASE originstack TO originstack;
EOF
echo "✅ Database created"
# Set up Python virtual environment
echo "🐍 Setting up Python virtual environment..."
cd backend
python3 -m venv venv
source venv/bin/activate
echo "📥 Installing dependencies..."
pip install -r requirements.txt
echo "⚙️ Setting up environment..."
if [ ! -f .env ]; then
cp .env.example .env
echo "✅ Created .env file"
else
echo "⚠️ .env file already exists, skipping..."
fi
echo ""
echo "✨ Setup complete!"
echo ""
echo "To start the backend:"
echo " cd backend"
echo " source venv/bin/activate"
echo " uvicorn app.main:app --reload"
echo ""
echo "Then visit http://localhost:8000/docs for API documentation"