Hallo Stroke

Environment Variables

All configuration variables for frontend and backend.

Backend (Hallo-Stroke-Backend)

config.GetEnv(key) fatals if a required variable is empty — the app refuses to start without all of these.

VariableRequiredDescription
DATABASE_URIyesPostgres DSN (GORM, PreferSimpleProtocol: true)
SERVER_PORTyese.g. :3001
JWT_ACCESS_SECRETyes64-byte hex recommended
JWT_REFRESH_SECRETyes64-byte hex recommended
GOOGLE_MAPS_API_KEYyesPlaces Nearby + Details
YOUTUBE_API_KEYyesYouTube Data API v3
WHATSAPP_API_ENDPOINTyesExternal gateway URL
WHATSAPP_API_USERNAMEyesBasic auth
WHATSAPP_API_PASSWORDyesBasic auth
FRONTEND_URLyesUsed in WhatsApp deep-links (forum, article, video, reset password)
SUPER_ADMIN_USERNAMEyesSuper-admin credentials
SUPER_ADMIN_PASSWORDyesSuper-admin credentials
AES_ENCRYPTION_KEYyes32-byte AES-GCM key for NIK encryption
VAPID_PUBLIC_KEYyesWeb push
VAPID_PRIVATE_KEYyesWeb push
VAPID_SUBJECTyesWeb push (mailto: or URL)

Templates: .env.example, .env.production.example.

Frontend (hallo-stroke-bunny)

VariableDevProdDescription
REACT_APP_API_BASE_URLhttp://localhost:3001/apihttps://caef.cs.ui.ac.id/backend/apiAPI base
REACT_APP_MEDIA_BASEhttp://localhost:3001/https://caef.cs.ui.ac.id/backendMedia/image prefix
REACT_APP_VAPID_PUBLIC_KEYBCAULCVpfZgxn...sameWeb Push public key

Templates: .env, .env.development, .env.production, nginx.env.example.

Secret committed in frontend repo

VAPID_PRIVATE_KEY is committed in the frontend .env. It must not live in the frontend repo — move it to the backend environment only. The frontend only needs the public key.

CORS

The backend allowlist (in cmd/main.go): https://hallostroke.org, http://localhost:3000, http://localhost:3003, http://localhost:5173. Credentials allowed, max age 86400. Add your frontend origin here if it differs.

On this page