# From project root
./build.sh
Output: server/vps_pilot (single executable with UI)
cd server
./vps_pilot
Access: http://localhost:8000
client/)
npm run build
# Creates: client/dist/
cp -r client/dist server/cmd/app/
go build -o vps_pilot .
# Embeds: cmd/app/dist/ into binary
Single vps_pilot binary that serves:
//api/v1/*/api/v1/nodes/ws/system-stat| What | URL |
|---|---|
| UI | http://localhost:8000 |
| API | http://localhost:8000/api/v1 |
| Login | http://localhost:8000/api/v1/auth/login |
Create server/.env:
DB_PATH=./data
TOKEN_LIFESPAN=60
TOKEN_SECRET=your-secret-key
TCP_SERVER_PORT=55001
# Build
./build.sh
# Run
cd server && ./vps_pilot
# Test API
curl http://localhost:8000/api/v1/auth/login
# Test UI (in browser)
open http://localhost:8000
# Backend
cd server && go run main.go
# Frontend (separate terminal)
cd client && npm run dev
./build.sh
cd server && ./vps_pilot
cd server
make migrate # Run migrations
make build # Build server only
make build-full # Build with UI (runs ../build.sh)
make run # Run server
make create-superuser # Create admin user
make clean # Remove build artifacts
server/vps_pilot./vps_pilotBuild fails:
# Check frontend builds
cd client && npm run build
# Check Go compiles
cd server && go build .
UI doesnβt load:
# Verify dist was copied
ls server/cmd/app/dist/
# Rebuild
./build.sh
Binary size too large:
# Strip and compress
cd server
go build -ldflags "-s -w" -o vps_pilot .
upx --best vps_pilot
Done! π