-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·31 lines (24 loc) · 823 Bytes
/
Copy pathstart.sh
File metadata and controls
executable file
·31 lines (24 loc) · 823 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
#!/usr/bin/env bash
set -euo pipefail
echo "Starting BedFlow..."
if [ ! -f "server/node_modules/.bin/prisma" ] || [ ! -f "server/node_modules/.bin/prisma_schema_build_bg.wasm" ]; then
echo "Installing server dependencies..."
rm -rf server/node_modules
npm --prefix server install
fi
if [ ! -d "client/node_modules" ] || [ ! -f "client/node_modules/vite/dist/node/cli.js" ]; then
echo "Installing client dependencies..."
rm -rf client/node_modules
npm --prefix client install
fi
echo "Preparing database..."
npm --prefix server run -s prisma:push
npm --prefix server run -s prisma:seed
echo "Starting backend (http://localhost:1893)..."
npm --prefix server run start:dev &
SERVER_PID=$!
echo "Starting frontend..."
npm --prefix client run dev &
CLIENT_PID=$!
trap 'kill $SERVER_PID $CLIENT_PID' EXIT
wait