InstaFuel_Chatbot_public/run.sh
2026-04-21 11:57:37 +05:30

26 lines
825 B
Bash

#!/bin/bash
SESSION="instafuel"
# Kill existing session if it exists
tmux has-session -t $SESSION 2>/dev/null
if [ $? -eq 0 ]; then
tmux kill-session -t $SESSION
fi
# 1. Start Qdrant (Docker)
tmux new-session -d -s $SESSION -n "services"
tmux send-keys -t $SESSION "docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant" C-m
# 2. Start Backend (with venv activation)
# We wait 2 seconds for Docker to spin up
tmux split-window -h -t $SESSION
tmux send-keys -t $SESSION "sleep 2 && source .venv/bin/activate && uvicorn src.api.server:app --host 0.0.0.0 --port 8000 --reload" C-m
# 3. Start Frontend (Bun)
tmux split-window -v -t $SESSION.1
tmux send-keys -t $SESSION "cd frontend && bun run dev" C-m
# Select the backend pane as the default focus and attach
tmux select-pane -t $SESSION.1
tmux attach-session -t $SESSION