Stacks Wars

Environment variables

Required and optional env vars for backend and frontend.

Backend (backend/.env)

VariableRequiredPurposeExample
DATABASE_URLyesPostgrespostgres://postgres:postgres@localhost:5432/stacks_wars
REDIS_URLyesRedisredis://127.0.0.1:6379
HIRO_API_KEYyesHiro APIfrom Hiro
NEON_AUTH_BASE_URLyesAuth JWKS baseNeon Auth URL
SW_VAULT_CONTRACTyesVault principalSP….sw-vault-v1
INTERNAL_API_SECRETyesShared secret for server-to-server callslong random
HOSTnoBind host0.0.0.0
PORTnoBind port8080
FRONTEND_URLnoPublic web originhttps://stackswars.com
MIGRATIONS_DIRnoSQL migrations path./migrations
TELEGRAM_BOT_TOKENno*Telegram companion
TELEGRAM_CHAT_IDno*Telegram companion
ADMINnoComma-separated admin emails
HIRO_API_URLnoHiro basehttps://api.hiro.so
STACKS_NETWORKnoNetwork namemainnet
RUST_LOGnoTracing filterinfo,sw_server=debug

*Telegram enables only when both token and chat id are set.

Frontend (frontend/.env.local)

VariableRequiredPurposeExample
NEON_AUTH_BASE_URLyesNeon Authsame family as backend
NEON_AUTH_COOKIE_SECRETyesCookie signing (≥32 chars)openssl rand -base64 32
NEXT_PUBLIC_APP_URLyesCanonical originhttp://localhost:3000
NEXT_PUBLIC_API_URLyesRust APIhttp://127.0.0.1:8080
NEXT_PUBLIC_WS_URLyesWS endpointws://127.0.0.1:8080/app
HIRO_API_KEYyesServer-side Hiro
SW_VAULT_CONTRACTyesVault contractsame as backend
STACKS_WARS_KEYyesOracle/sponsor mnemonic24 words
NEXT_PUBLIC_NETWORKyesStacks networkmainnet
CUSTODIAL_DEV_SECRETyes (local)Encrypts custodial mnemonics locally (≥16 chars)openssl rand -base64 32
INTERNAL_API_SECRETyesMust match backend (S2S / cron)same value as backend
DISABLE_VERIFICATIONyes (local)Skip signup email OTP UI + disposable-email checkstrue / unset / false

Production encrypts custodial mnemonics with Google Cloud KMS instead of CUSTODIAL_DEV_SECRET

On this page