Skip to main content

Environments & Infrastructure

Reference for all GCP infrastructure, environment configuration, and service details used across staging and production deployments.

GCP Projects

SettingStagingProduction
GCP Project IDbarto-devbarto-prod
Regionus-central1us-central1
GitHub Environmentstagingproduction
NODE_ENVstagingproduction

Artifact Registry Repositories

All Docker images are stored in GCP Artifact Registry under us-central1-docker.pkg.dev.

RepositoryImageDockerfile
flowpos-backendbackend:<commit-sha>deploy/gcp/backend.Dockerfile
flowpos-web-appweb-app:<commit-sha>deploy/gcp/web-app.Dockerfile
flowpos-landinglanding-page:<commit-sha>deploy/gcp/landing-page.Dockerfile
flowpos-frontend-pwafrontend-pwa:<commit-sha>deploy/gcp/frontend-pwa.Dockerfile
flowpos-docsdocs:<commit-sha>deploy/gcp/docs.Dockerfile

Full image URL pattern:

us-central1-docker.pkg.dev/<PROJECT_ID>/<REPOSITORY>/<IMAGE>:<COMMIT_SHA>

Example:

us-central1-docker.pkg.dev/barto-prod/flowpos-backend/backend:9f2fb9b95e1c

Creating a New Artifact Registry Repository

If a repository doesn't exist yet (e.g., for a new service), create it in both projects:

# Staging
gcloud artifacts repositories create <REPO_NAME> \
--repository-format=docker \
--location=us-central1 \
--project=barto-dev \
--description="<description>"

# Production
gcloud artifacts repositories create <REPO_NAME> \
--repository-format=docker \
--location=us-central1 \
--project=barto-prod \
--description="<description>"

Cloud Run Services

Service NameSource AppPort
flowpos-backendapps/backend/4000
flowpos-web-appapps/web-app/3000
flowpos-landing-pageapps/landing-page/3001
flowpos-frontend-pwaapps/frontend-pwa/5173
flowpos-docsapps/docs/3003
flowpos-metabase-<env>Metabase3002

Database (Cloud SQL)

SettingLocalStagingProduction
PostgreSQL version171717
Port543554335434
Cloud SQL Instancemetabase-db-stagingmetabase-db-production

Supporting Services

ServiceLocal PortDescription
Redis6379BullMQ queues + caching
pgAdmin8080Database admin UI
Metabase3002Analytics dashboards

Change Detection

The CI/CD pipeline uses dorny/paths-filter to detect which services changed and only deploy those:

FilterPaths
backend_changedapps/backend/**, packages/backend/database/**, packages/global/**, deploy/gcp/backend.Dockerfile
web_app_changedapps/web-app/**, packages/global/**, deploy/gcp/web-app.Dockerfile
landing_page_changedapps/landing-page/**, deploy/gcp/landing-page.Dockerfile
frontend_pwa_changedapps/frontend-pwa/**, packages/global/**, deploy/gcp/frontend-pwa.Dockerfile
docs_changedapps/docs/**, deploy/gcp/docs.Dockerfile
tip

Use the deploy_all option in the production workflow to force-deploy all services regardless of changes.

GitHub Secrets

Secrets are configured per GitHub Environment (staging / production).

GCP & Infrastructure

SecretDescription
GCP_PROJECT_IDGCP project ID (barto-dev or barto-prod)
GCP_REGIONGCP region (us-central1)
GCP_WORKLOAD_IDENTITY_PROVIDERWIF provider for authentication
GCP_SERVICE_ACCOUNT_EMAILService account for deployments
DATABASE_URLPostgreSQL connection string
ENCRYPTION_KEY32-byte hex encryption key
PNPM_VERSIONpnpm version (defaults to 10.30.0)

Firebase

SecretDescription
FIREBASE_PROJECT_IDFirebase project identifier
FIREBASE_CLIENT_EMAILFirebase service account email
FIREBASE_PRIVATE_KEYFirebase private key (or FIREBASE_PRIVATE_KEY_B64 for base64)

External Services

SecretDescription
SENDGRID_API_KEYSendGrid email API key
SENDGRID_FROM_EMAILSender email address
SENDGRID_FROM_NAMESender display name
TWILIO_ACCOUNT_SIDTwilio account SID
TWILIO_AUTH_TOKENTwilio auth token
TWILIO_PHONE_NUMBERTwilio SMS number
TWILIO_WHATSAPP_NUMBERTwilio WhatsApp number
SENTRY_DSNSentry DSN (backend)
SENTRY_AUTH_TOKENSentry auth token
SENTRY_ORGSentry organization
SENTRY_PROJECTSentry project

Application URLs

SecretDescription
API_URLBackend API URL
FRONTEND_URLFrontend application URL

Redis

SecretDescription
REDIS_HOSTRedis host
REDIS_PORTRedis port
REDIS_PASSWORDRedis password

Workflow Files

WorkflowFileTrigger
Pre-merge Validation.github/workflows/premerge-validate.ymlPR opened/updated
Deploy to Staging.github/workflows/deploy-staging-from-main.ymlPR merged to main
Deploy to Production.github/workflows/deploy-production.ymlManual (workflow_dispatch)
Deploy Metabase.github/workflows/deploy-metabase.ymlManual

Local Cloud Deploy

Deploy from your local machine without GitHub Actions:

export GCP_PROJECT_ID=barto-dev
DB_POOL_MAX=6 ./scripts/deploy-backend-local.sh staging

Last updated: 2026-03-26