app
JLCPCB Parts Library
Public Made by Adomby adom
Check the JLCPCB / LCSC parts library before you fab — Basic vs Extended tier, LCSC stock and assembly pricing, so you avoid surprise feeder-setup fees. CLI, a Hydrogen app, and a shared backend.
#!/bin/bash
# Start the JLCPCB search server if not already running
# Also triggers the daily DB update check via run-parts
JLCPCB_DIR="/home/adom/gallia/services/jlcpcb"
LOG_FILE="${JLCPCB_DIR}/server.log"
# Check if already running
if curl -sf --max-time 2 http://127.0.0.1:8774/health > /dev/null 2>&1; then
echo "[jlcpcb] Server already running on port 8774"
exit 0
fi
# Set up database if missing
if [ ! -f "$JLCPCB_DIR/jlcpcb-components.sqlite3" ]; then
echo "[jlcpcb] Database missing, running setup..."
cd "$JLCPCB_DIR"
/usr/bin/node setup-db.js >> "$LOG_FILE" 2>&1
fi
# Start the server
cd "$JLCPCB_DIR"
nohup /usr/bin/node server.js >> "$LOG_FILE" 2>&1 &
echo "[jlcpcb] Server started (PID $!), logging to $LOG_FILE"