-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·121 lines (100 loc) · 2.93 KB
/
setup.sh
File metadata and controls
executable file
·121 lines (100 loc) · 2.93 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# Avatrix Setup Script
# This script helps you set up Avatrix for local development
set -e
echo "🎨 Avatrix Setup Script"
echo "======================="
echo ""
# Check prerequisites
echo "📋 Checking prerequisites..."
# Check Python
if ! command -v python3 &> /dev/null; then
echo "❌ Python 3 is not installed. Please install Python 3.11 or higher."
exit 1
fi
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2)
echo "✅ Python $PYTHON_VERSION found"
# Check Node.js
if ! command -v node &> /dev/null; then
echo "❌ Node.js is not installed. Please install Node.js 20 or higher."
exit 1
fi
NODE_VERSION=$(node --version)
echo "✅ Node.js $NODE_VERSION found"
# Check npm
if ! command -v npm &> /dev/null; then
echo "❌ npm is not installed. Please install npm."
exit 1
fi
echo "✅ npm found"
echo ""
# Setup backend
echo "🔧 Setting up backend..."
cd backend
if [ ! -f .env ]; then
echo "📝 Creating .env file from template..."
cp .env.example .env
echo "⚠️ Please edit backend/.env and add your HUGGINGFACE_API_KEY"
echo " Get your key from: https://huggingface.co/settings/tokens"
else
echo "✅ .env file already exists"
fi
echo "📦 Creating Python virtual environment..."
if [ ! -d venv ]; then
python3 -m venv venv
echo "✅ Virtual environment created"
else
echo "✅ Virtual environment already exists"
fi
echo "📥 Installing Python dependencies (this may take a few minutes)..."
source venv/bin/activate
pip install --upgrade pip > /dev/null 2>&1
pip install -r requirements.txt
echo "✅ Backend setup complete"
cd ..
# Setup frontend
echo ""
echo "🎨 Setting up frontend..."
cd frontend
if [ ! -f .env ]; then
echo "📝 Creating frontend .env file..."
echo "VITE_API_URL=http://localhost:8000/api" > .env
echo "✅ .env file created"
else
echo "✅ .env file already exists"
fi
echo "📦 Installing Node.js dependencies (this may take a few minutes)..."
npm install
echo "✅ Frontend setup complete"
cd ..
# Create necessary directories
echo ""
echo "📁 Creating necessary directories..."
mkdir -p uploads temp backend/models
touch uploads/.gitkeep temp/.gitkeep backend/models/.gitkeep
echo ""
echo "✅ Setup complete!"
echo ""
echo "🚀 Next steps:"
echo ""
echo "1. Edit backend/.env and add your HUGGINGFACE_API_KEY"
echo " Get your key from: https://huggingface.co/settings/tokens"
echo ""
echo "2. Start the backend (in one terminal):"
echo " cd backend"
echo " source venv/bin/activate"
echo " python -m app.main"
echo ""
echo "3. Start the frontend (in another terminal):"
echo " cd frontend"
echo " npm run dev"
echo ""
echo "4. Open your browser:"
echo " http://localhost:3000"
echo ""
echo "📚 For more information, see:"
echo " - README.md - Full documentation"
echo " - QUICKSTART.md - Quick start guide"
echo " - http://localhost:8000/docs - API documentation"
echo ""
echo "Happy editing! 🎨✨"