-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·55 lines (41 loc) · 1.44 KB
/
setup.sh
File metadata and controls
executable file
·55 lines (41 loc) · 1.44 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
#!/bin/bash
set -e
GREEN="\033[32m"
BLUE="\033[34m"
YELLOW="\033[33m"
RESET="\033[0m"
echo -e "${BLUE}<==> Starting installation... <==>${RESET}"
# Update package lists
echo -e "${YELLOW}==> Updating package lists...${RESET}"
sudo apt-get update
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
# Install essential packages (optional if already present in Codespaces)
echo -e "${YELLOW}==> Installing Essential Packages...${RESET}"
sudo apt-get install -y nodejs python3 python3-pip
# Verify installations
echo -e "${GREEN}==> Checking Node.js version:${RESET}"
node -v
npm -v
npx -v
echo -e "${YELLOW}==> Installing PNPM packages...${RESET}"
sudo npm install -g pnpm
pnpm install
echo -e "${GREEN}==> Python version:${RESET}"
python3 -V
# Upgrade pip
echo -e "${YELLOW}==> Upgrading pip...${RESET}"
python3 -m pip install --upgrade pip
# Install Python packages
echo -e "${YELLOW}==> Installing Python packages...${RESET}"
pip install -r python/python_txt_file/requirements.txt
echo -e "${BLUE}<==> Building Next.js app... <==>${RESET}"
echo -e "${YELLOW}==> Running lint...${RESET}"
pnpm run lint
echo -e "${YELLOW}==> Running build...${RESET}"
pnpm run build
# Start FastAPI in background
echo -e "${GREEN}==> Starting FastAPI server...${RESET}"
nohup python3 python/main.py >> /tmp/fastapi.log 2>&1 & disown
# Start Next.js server (this will block)
echo -e "${GREEN}==> Starting Next.js at http://localhost:3000...${RESET}"
pnpm run start