normalize project structure: src/client + src/server + src/shared
- restructure from src/ + server/ to src/client/ + src/server/ + src/shared/ - switch backend runtime from Node (tsx) to Bun - merge server/package.json into root, remove @hono/node-server + tsx - convert server @/ imports to relative paths - standardize biome config (lineWidth 80, quoteStyle double) - add CLAUDE.md, .env.example at root - update vite.config, tsconfig, deploy.sh for new structure Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
15
deploy.sh
15
deploy.sh
@@ -3,7 +3,7 @@
|
||||
# Usage: ./deploy.sh [uberspace-user@host] (default: serve)
|
||||
set -euo pipefail
|
||||
|
||||
# activate mise so tool versions (bun, node, etc.) from .mise.toml are on $PATH
|
||||
# activate mise so tool versions (bun, etc.) from .mise.toml are on $PATH
|
||||
eval "$(mise activate bash --shims)"
|
||||
|
||||
REMOTE="${1:-serve}"
|
||||
@@ -38,18 +38,21 @@ rsync -avz --delete -e "ssh -S $SSH_SOCK" \
|
||||
echo "==> Deploying backend to $REMOTE:$REMOTE_SERVICE_DIR"
|
||||
r "mkdir -p $REMOTE_SERVICE_DIR"
|
||||
rsync -avz --delete -e "ssh -S $SSH_SOCK" \
|
||||
--exclude='node_modules/' \
|
||||
--exclude='.git/' \
|
||||
--exclude='.env' \
|
||||
"$LOCAL_DIR/server/" "$REMOTE:$REMOTE_SERVICE_DIR/"
|
||||
--exclude='dist/' \
|
||||
--exclude='node_modules/' \
|
||||
--exclude='.DS_Store' \
|
||||
"$LOCAL_DIR/" "$REMOTE:$REMOTE_SERVICE_DIR/"
|
||||
|
||||
echo "==> Installing backend dependencies"
|
||||
r "cd $REMOTE_SERVICE_DIR && npm install"
|
||||
r "cd $REMOTE_SERVICE_DIR && bun install"
|
||||
|
||||
echo "==> Checking .env exists"
|
||||
r "test -f $REMOTE_SERVICE_DIR/.env || { echo 'ERROR: $REMOTE_SERVICE_DIR/.env not found — create it first'; exit 1; }"
|
||||
|
||||
echo "==> Running database migrations"
|
||||
r "cd $REMOTE_SERVICE_DIR && set -a && source .env && set +a && npx drizzle-kit migrate"
|
||||
r "cd $REMOTE_SERVICE_DIR && set -a && source .env && set +a && bunx drizzle-kit migrate"
|
||||
|
||||
# --- systemd user service (Uberspace 8) ---
|
||||
|
||||
@@ -63,7 +66,7 @@ After=network.target postgresql.service
|
||||
Type=simple
|
||||
WorkingDirectory=$REMOTE_SERVICE_DIR
|
||||
EnvironmentFile=$REMOTE_SERVICE_DIR/.env
|
||||
ExecStart=$REMOTE_SERVICE_DIR/node_modules/.bin/tsx src/index.ts
|
||||
ExecStart=/usr/bin/bun run src/server/index.ts
|
||||
Restart=on-failure
|
||||
RestartSec=5
|
||||
|
||||
|
||||
Reference in New Issue
Block a user