Updated Jun 1, 2026
Maintain environments and deployment state
Environment evidence for local, preview/staging, and intended production API/auth targets, including the recorded production reachability and Worker-account blockers.
Dates
- Created
- Jun 1, 2026
- Last updated
- Jun 1, 2026
Document Metadata
- title: Environments
- description: Ownership and configuration model for local, staging, and production
- status: evolving
- lastUpdated: "2026-04-27 09:18 ET (America/New_York)"
- owner: Engineering
Environments ## Local - Root convenience env: . env - App config: `ios/Config/Local.
Environments
Local
- Root convenience env:
.env - App config:
ios/Config/Local.xcconfig - iOS signing overrides:
ios/Config/SigningOverrides.xcconfig - Backend config:
backend/.dev.vars - Default API target:
http://127.0.0.1:8787 - Root
.envis a supported convenience layer for shell imports and repo-owned Make targets; backend commands sourcebackend/.dev.varsfirst and then.env - Local iOS overrides apply to
Debugonly; Preview and Release must not inherit local API/auth overrides - Local Apple signing overrides apply across Debug, Preview, and Release through
ios/Config/SigningOverrides.xcconfig - Secrets owner: active developer
- Primary use: day-to-day development and smoke testing
Staging
- iOS Preview configuration points to the staging Worker and must not inherit
Local.xcconfig - iOS Preview auth target:
https://ep-rapid-smoke-anvqs0i6.neonauth.c-6.us-east-1.aws.neon.tech/neondb/auth - Backend target: Cloudflare Worker
maintain-api-staging - Staging API URL:
https://maintain-api-staging.maggie.workers.dev - Neon project:
maintain-ios-staging(square-surf-79861700) - Neon branch:
main(br-old-rice-anrbxg4q) - Staging auth mode: live bearer-token validation with
DEMO_MODE=false - Data store: staging Neon database
- Storage and async infrastructure:
maintain-exports-staging,maintain-jobs-staging,maintain-jobs-staging-dlq - Secrets owner: repo maintainers
- Primary use: internal preview, internal TestFlight, and integration verification
Production
- iOS Release configuration now points to the intended production API and Neon Auth targets
- iOS Release API target:
https://api.maintain.app - iOS Release auth target:
https://ep-quiet-wildflower-am3spcpf.neonauth.c-5.us-east-1.aws.neon.tech/maintain/auth - Backend target: Cloudflare Worker
maintain-api-production - Production Neon project:
maintain-ios(dark-union-16830974) - Production Neon branch:
main(br-wild-cake-am1jf4fb) - Data store: production Neon database
- Secrets owner: repo maintainers
- Primary use: App Store builds and live traffic
Current Production Blockers
- As of
2026-04-13 08:30 ET,api.maintain.appdoes not resolve from this machine, so the intended production API hostname is not currently reachable. - As of
2026-04-13 08:30 ET,wrangler secret list --env productionreports that Workermaintain-api-productionis not found for the current account context. - Treat the production config as an intended contract that is now explicit in repo config, but treat live production reachability as blocked until Cloudflare Worker and DNS validation succeeds.
Source Of Truth
- Root variable index:
.env.example - Root local convenience sync:
scripts/sync_root_env.sh - Local Worker example:
backend/.dev.vars.example - Local iOS example:
ios/Config/Local.example.xcconfig - Local iOS signing example:
ios/Config/SigningOverrides.example.xcconfig
Rotation And Consumption
- Local secrets are developer-managed and must never be committed
- Root
.envis ignored by git and should be regenerated locally instead of hand-copied across worktrees when possible - Staging and production secrets should live in platform secret stores, not in repo files
- GitHub Actions should consume staging/production secrets only from repository or environment secrets
- Preview/staging preflight should use
STAGING_DATABASE_URL=... make backend-staging-preflightwhen direct database access is available; the command verifies staging schema drift first and then runs the deployed Preview auth/API contract smoke
GitHub Actions Secrets
- Current required repo secret for CI-backed staging smoke checks:
STAGING_DATABASE_URL - Current platform-managed Worker secret for staging deploys:
DATABASE_URLon thestagingWrangler environment - Current platform-managed Worker auth secrets for staging live auth:
NEON_AUTH_JWKS_URL,NEON_AUTH_ISSUER,NEON_AUTH_AUDIENCE - Current staging auth contract: Neon Auth Better Auth
baseUrlfor native sign-in or sign-up, JWT retrieval via the auth token endpoint using the session cookie, and Worker bearer validation via the staged JWKS or issuer or audience values above - Current staging auth verification result:
GET /v1/mereturnsmode: "live"when called with a JWT from the staging Neon Auth deployment - Future release automation will need separate App Store Connect and signing secrets; those are intentionally not configured yet
Provenance
- Source file:
DOCS/deployment/environments.md - Source URL: https://github.com/maggielerman/maintain-ios/blob/main/DOCS/deployment/environments.md