generated from jphacks/JP_sample
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
36 lines (28 loc) · 896 Bytes
/
setup.sh
File metadata and controls
36 lines (28 loc) · 896 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
35
36
#!/bin/bash
set -eu
# --- Python Backend Setup ---
echo "--- Setting up Python backend ---"
# 1. Create and activate virtual environment
if [ ! -d "backend/.venv" ]; then
python3 -m venv backend/.venv
echo "Virtual environment created at backend/.venv"
fi
source backend/.venv/bin/activate
echo "Virtual environment activated"
# 2. Install dependencies
pip install -r backend/requirements.txt
echo "Backend dependencies installed"
# --- Node Frontend Setup ---
echo ""
echo "--- Setting up Node frontend ---"
(cd frontend && npm install)
echo "Frontend dependencies installed"
# --- Husky Setup ---
echo ""
echo "--- Setting up Husky ---"
(cd frontend && npx husky init)
(echo "npx lint-staged" > frontend/.husky/pre-commit)
echo "Husky pre-commit hook created"
echo ""
echo "✅ Setup complete!"
echo "To activate the virtual environment, run: source backend/.venv/bin/activate"