3.9 KiB
3.9 KiB
Environment Matrix
Last updated: 2026-05-09
This is the canonical launch-time environment contract for the manual single-host deployment path.
Rules:
- Runtime env files live at repo root:
.env.gitgram,.env.gitgram-web,.env.aitm-api, optional.env.aitm-website. - Service-local
.env.examplefiles remain the code-level reference for development. scripts/validate-prod-secrets.shaccepts both unprefixed runtime names andGITGRAM_*/AITM_*aliases for CI-style validation.
Gitgram Backend
Required before first launch:
DATABASE_URLREDIS_URLJWT_SECRETJWT_REFRESH_SECRETFRONTEND_URLCORS_ORIGINGITHUB_CLIENT_IDGITHUB_CLIENT_SECRETPOLAR_ACCESS_TOKENPOLAR_WEBHOOK_SECRETPOLAR_PREMIUM_PRODUCT_IDPOLAR_CREATOR_PRODUCT_IDPOLAR_MODERESEND_API_KEYSENTRY_DSNSTORAGE_TYPE
Conditional requirements:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AWS_S3_BUCKET,AWS_REGIONwhenSTORAGE_TYPE=s3
Optional after launch:
GOOGLE_CLIENT_IDGOOGLE_CLIENT_SECRETGITHUB_WEBHOOK_SECRETGITHUB_TOKENCDN_URLAITM_API_URLAITM_ENCRYPTION_SECRET- analytics and feature-flag keys
Code reference:
gitgram/backend/ENV_MATRIX.mdgitgram/backend/.env.examplegitgram/backend/src/config/env-contract.ts
Gitgram Web
Required before first launch:
NEXT_PUBLIC_API_URLNEXT_PUBLIC_WS_URLor legacyNEXT_PUBLIC_SOCKET_URLNEXT_PUBLIC_GITHUB_CLIENT_ID
Optional after launch:
NEXT_PUBLIC_GOOGLE_CLIENT_IDNEXT_PUBLIC_AITM_API_URLNEXT_PUBLIC_SENTRY_DSNNEXT_PUBLIC_GA_IDNEXT_PUBLIC_MAPBOX_TOKEN
Operational note:
NEXT_PUBLIC_*values are build-time inputs. Rebuild the web app whenever they change.
Code reference:
gitgram/web/.env.examplegitgram/web/next.config.js
AITM API
Required before first launch:
DATABASE_URLINTERNAL_SECRETCORS_ORIGINWEBSITE_URLPOLAR_ACCESS_TOKENPOLAR_WEBHOOK_SECRETPOLAR_PRO_PRODUCT_IDPOLAR_TEAM_PRODUCT_IDRESEND_API_KEYSENTRY_DSN
Optional after launch:
CLERK_WEBHOOK_SECRETREDIS_URLOPENAI_API_KEYANTHROPIC_API_KEYVOYAGE_API_KEYBRAVE_SEARCH_API_KEYSERPAPI_KEYSERPER_API_KEYFIRECRAWL_API_KEYKB_S3_BUCKETAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY- worker toggles and cron expressions
Operational notes:
DATABASE_URLmust be valid before the API starts instagingorproduction.- Without LLM/search keys, AI-heavy routes degrade gracefully instead of blocking startup.
- Worker env vars are only required if you enable the managed scheduler on launch day.
Code reference:
aitimemachine/api-server/.env.exampleaitimemachine/api-server/src/lib/validateEnv.tsaitimemachine/api-server/src/config/env-validation.ts
AITM npm Publish / Release Flow
Manual publish requires:
- authenticated npm session via
npm loginornpm whoami
Optional CI automation:
- GitHub secret
NPM_TOKEN
Operational notes:
- The current CI release job publishes
@gitgram/timemachine. @gitgram/timemachine-mcpstill requires manual publish.
Optional Self-Hosted AITM Website
Only required if you decide to run aitimemachine/website on the launch host.
Required for self-host:
NEXT_PUBLIC_API_URLAPI_URLINTERNAL_SECRETNEXT_PUBLIC_CLERK_PUBLISHABLE_KEYCLERK_SECRET_KEYNEXT_PUBLIC_APP_URLPOLAR_ACCESS_TOKENNEXT_PUBLIC_POLAR_PRO_PRODUCT_IDNEXT_PUBLIC_POLAR_TEAM_PRODUCT_ID
Code reference:
.env.aitm-website.exampleaitimemachine/website/.env.example
Validation Commands
bash scripts/validate-prod-secrets.sh staging
bash scripts/validate-prod-secrets.sh production
These checks:
- validate the launch-critical variable set
- support both prefixed and unprefixed naming
- auto-load the root
.env.*files when present - fail on placeholder values
- enforce
POLAR_MODE=productionfor a production Gitgram launch