Skip to content

Environment Variables

Complete reference untuk semua environment variables yang dibutuhkan Merq.

VariableDescriptionRequiredDefault
SERVER_PORTServer portYes8080
APP_ENVEnvironment (development/production)Yesdevelopment
ADMIN_BASE_URLWeb dashboard URLNo-
APP_BASE_URLMobile app URLNo-
VariableDescriptionRequiredDefault
DB_HOSTDatabase hostYeslocalhost
DB_PORTDatabase portYes5432
DB_USERDatabase userYes-
DB_PASSWORDDatabase passwordYes-
DB_NAMEDatabase nameYes-
DB_SSLMODESSL mode (disable/require)Nodisable
DB_TIMEZONEDatabase timezoneNoAsia/Jakarta
VariableDescriptionRequiredDefault
REDIS_HOSTRedis hostYeslocalhost
REDIS_PORTRedis portYes6379
REDIS_PASSWORDRedis passwordNo(empty)
REDIS_DBRedis database numberNo0
VariableDescriptionRequiredDefault
JWT_SECRETJWT signing key (min 32 chars)Yes-
JWT_EXPIRY_HOURSAccess token expiryNo24
JWT_REFRESH_EXPIRY_DAYSRefresh token expiryNo30
VariableDescriptionRequiredDefault
TYPESENSE_HOSTTypesense hostNolocalhost
TYPESENSE_PORTTypesense portNo8108
TYPESENSE_API_KEYAPI key for TypesenseNo-
TYPESENSE_PROTOCOLProtocol (http/https)Nohttp
VariableDescriptionRequiredDefault
FIREBASE_CREDENTIALS_FILEPath to service account JSONNo-
VariableDescriptionRequiredDefault
DO_SPACES_KEYSpaces access keyNo-
DO_SPACES_SECRETSpaces secret keyNo-
DO_SPACES_BUCKETBucket nameNo-
DO_SPACES_ENDPOINTSpaces endpoint URLNo-
DO_SPACES_REGIONSpaces regionNosgp1
VariableDescriptionRequiredDefault
RESEND_API_KEYResend API keyNo-
RESEND_SENDER_EMAILSender email addressNo-
VariableDescriptionRequiredDefault
PLUNK_API_KEYPlunk API keyNo-
PLUNK_SENDER_EMAILSender email addressNo-
VariableDescriptionRequiredDefault
MAILERSEND_API_KEYMailersend API keyNo-
MAILERSEND_SENDER_EMAILSender email addressNo-
VariableDescriptionRequiredDefault
MAIL_FROMDefault from emailNo-
VariableDescriptionRequiredDefault
SU_NAMESuper admin nameNo-
SU_EMAILSuper admin emailNo-
SU_PASSWORDSuper admin passwordNo-
SU_PHONESuper admin phoneNo-
WS_NAMEInitial workspace nameNo-
WS_DESCRIPTIONWorkspace descriptionNo-
WS_SLUGWorkspace slugNo-
VariableDescriptionRequiredDefault
RUN_MIGRATIONRun goose SQL migrations on startupNofalse
RUN_SEEDERRun seeder on startupNofalse
RUN_AUTO_MIGRATIONRun GORM AutoMigrate on startup (dev/emergency only — never use in production)Nofalse
VariableDescriptionRequiredDefault
ENV_FILEPath to env file (used by scripts/ and cmd/goose)No.env

VariableDescriptionRequiredDefault
VITE_API_BASE_URLBackend API URLYes-
VITE_GOOGLE_API_KEYGoogle Maps API keyNo-
VITE_SECURE_LOCAL_STORAGE_HASH_KEYEncryption key (32 chars)Yes-
VITE_SECURE_LOCAL_STORAGE_PREFIXStorage key prefixNomerq_
VITE_APP_ENVEnvironmentNodevelopment
VITE_APP_NAMEApplication nameNoMerq Admin

VariableDescriptionRequiredDefault
API_BASE_URLBackend API URLYes-
STORAGE_ENC_KEYMMKV encryption key (32 chars)Yes-
GOOGLE_MAPS_API_KEYGoogle Maps API key (Android)No-
APP_ENVEnvironmentNodevelopment
APP_NAMEApplication nameNoMerq Field Force

Terminal window
# Backend
SERVER_PORT=8080
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=merq_development
REDIS_HOST=localhost
REDIS_PORT=6379
JWT_SECRET=dev-secret-key-min-32-characters
# Web
VITE_API_BASE_URL=http://localhost:8080/api
# Mobile
API_BASE_URL=http://localhost:8080/api
STORAGE_ENC_KEY=dev_storage_key_32_characters
Terminal window
# Backend
SERVER_PORT=8080
APP_ENV=production
DB_HOST=postgres
DB_USER=merq
DB_PASSWORD=<secure-password>
DB_NAME=merq_production
REDIS_HOST=redis
JWT_SECRET=<secure-random-32+-chars>
TYPESENSE_HOST=typesense
TYPESENSE_API_KEY=<api-key>
FIREBASE_CREDENTIALS_FILE=/app/firebase/service-account.json
DO_SPACES_KEY=<key>
DO_SPACES_SECRET=<secret>
RESEND_API_KEY=<key>
# Web
VITE_API_BASE_URL=https://api.yourdomain.com/api
VITE_SECURE_LOCAL_STORAGE_HASH_KEY=<secure-key>
# Mobile
API_BASE_URL=https://api.yourdomain.com/api
STORAGE_ENC_KEY=<secure-key>

  1. Never commit .env files to version control
  2. Rotate secrets regularly, especially after team member changes
  3. Use strong passwords (min 16 characters, mixed case, numbers, symbols)
  4. JWT_SECRET should be at least 32 random characters
  5. Production values should be stored in secure secret management (Notion + Dokploy env vars)