Skip to main content

๐Ÿš€ Deployment Guide

Build and deploy each non-GPU service from the repository that owns it.

:::warning Scope GPU backend deployment is intentionally excluded. Follow the GPU repository's own runbook when that service is explicitly in scope. :::

Before every deployโ€‹

firebase login
firebase use acesense-prod

Use an explicit --project acesense-prod on production commands. Run the repository's lint/tests/build before deploying.

Flutter web appโ€‹

cd acesense-frontend
flutter analyze --no-fatal-infos
flutter test --coverage
./deploy.sh

deploy.sh builds release web and deploys hosting:app, Firestore rules, and Storage rules.

Cloud Functionsโ€‹

cd acesense-auth-function
pnpm install --frozen-lockfile
pnpm lint
pnpm test
pnpm build
firebase deploy --only functions --project acesense-prod

The Firebase predeploy hook also runs lint and build. To limit blast radius:

firebase deploy --only functions:requestUploadPath --project acesense-prod

Admin panelโ€‹

cd acesense-admin
pnpm install --frozen-lockfile
pnpm lint
pnpm test:coverage
pnpm build
firebase deploy --only hosting:admin --project acesense-prod

Landing siteโ€‹

cd acesense-landing
pnpm install --frozen-lockfile
pnpm lint
pnpm test:coverage
pnpm build
firebase deploy --only hosting:landing --project acesense-prod

The build includes prerendering; do not deploy a plain Vite build that skipped it.

Public API hostingโ€‹

Functions and Hosting are separate deploy boundaries. Deploy function code from acesense-auth-function; deploy rewrite changes from acesense-api-hosting:

cd acesense-api-hosting
firebase deploy --only hosting:api --project acesense-prod --dry-run
firebase deploy --only hosting:api --project acesense-prod

Smoke-check https://api.acesense.io/v1/healthz after either boundary changes.

Private docsโ€‹

Docs are served by docsServer, so a complete release must copy the current Docusaurus build into the function and deploy both Function and Hosting.

cd acesense-docs/website
pnpm install --frozen-lockfile
pnpm test
rm -rf ../functions/site
cp -R build ../functions/site
cd ..
firebase deploy --only functions:docs:docsServer,hosting:docs --project acesense-prod

Private launchpadโ€‹

The Hosting predeploy hook runs build:hosting, which builds and copies dist into functions/site.

cd acesense-launchpad
pnpm install --frozen-lockfile
pnpm lint
pnpm test:coverage
firebase deploy --only functions:launchpad:launchpadServer,hosting:launchpad --project acesense-prod

Rollbackโ€‹

  • Hosting: select the site in Firebase Hosting release history and roll back.
  • Functions: deploy the known-good Git revision after rerunning its checks.
  • Rules: restore a known-good rules release or redeploy the reviewed files.

Never use a working tree with unrelated changes as a rollback artifact.

GPU Backend (RunPod)โ€‹

GPU image/provider deployment is excluded from this audit. The non-GPU control plane hands accepted jobs to the configured provider through the task dispatch layer. Reverify the provider repository and current console settings before following any historical Docker or RunPod procedure.