🚒 Frontend Deploy

Service: funday-frontend.service runs Node SSR on the production host (server.js on :3000). Ingress is Nginx β†’ Traefik β†’ :3000. This is a host-level systemd service, not a Kubernetes Deployment.

Use the atomic deploy script from the Funday repository root. Never run raw vite build, npm run build:vite, npm run build --no-restart, or any build while vite dev :5173 is active on the production host.

Preconditions

CheckCommand / action
Local Git onlyEnsure you are on a committed branch; the platform is never pushed to GitHub or any external remote.
Memory gategrep MemAvailable /proc/meminfo must show β‰₯ 5 GB before starting.
No dev server orphanspgrep -af 'vite dev.*5173' must be empty. If an orphan is present and no active dev session owns it, terminate it.
Top RSS offendersAudit `ps -eo rss,comm,pid β€”sort=-rss

Steps

  1. Run the atomic deploy script. The supported entry point is from the frontend directory:

    cd /home/usr/funday/frontend
    npm run deploy

    This invokes scripts/build-atomic.sh, which performs: backup of the current build/ to .build-backup/, vite build, artifact verification, atomic service restart, and rollback on failure.

  2. Verify the artifact gate. Before the restart is accepted, confirm both exist:

    ls -l /home/usr/funday/frontend/build/server/index.js
    ls -l /home/usr/funday/frontend/build/client/_app/immutable/
  3. Confirm service readiness.

    curl -sf http://127.0.0.1:3000/health
    sudo systemctl status funday-frontend.service
  4. If health fails, inspect logs:

    sudo journalctl -u funday-frontend.service -n 100 --no-pager

Flags and edge cases

ScenarioCorrect action
Stage a build without restarting the servicecd /home/usr/funday/frontend && bash ../scripts/build-atomic.sh --no-restart
Memory below 5 GB availableDo not pass --force. Free memory or wait; an OOM during vite build can destroy build/client/_app/ and leave the site unstyled.
CSS/assets 404 after an OOM killRoll back the client assets without a full redeploy: cp -a /home/usr/funday/frontend/.build-backup/client/_app /home/usr/funday/frontend/build/client/
Stale backup directoriesPrune build.bak.*, build-backup-*, and frontend-deploy/ after a successful deploy; keep only build/ and .build-backup/.

Prohibited

  • Raw vite build
  • npm run build:vite
  • npm run build or npm run build --no-restart against production while the service is active
  • Passing --force below the memory gate
  • Running vite dev :5173 on the production host during or alongside a deploy

Sources

  • funday/AGENTS.md Β§01.2 Frontend Production Deploy Manifest
  • funday/frontend/package.json deploy script
  • funday/scripts/build-atomic.sh
  • funday/funday-codex.yml services.frontend
  • funday/funday-bible.md services quick reference

Ask Docs

AI assistant to help answer questions about the documentation. Answers are read-only and cite docs/source.

Hi! How can I help you with the documentation today? Answers are read-only and cite docs/source.

Ctrl+Enter to send