Skip to content

Environment Variables

This document provides a complete reference for all environment variables required to run the Merq platform. Each component (merq-backend, merq-web, merq-mobile) has its own environment file.

Create a .env file from env.example in the merq-backend root directory.

VariableDefault ValueRequiredDescription
SERVER_PORT8080NoThe port on which the Gin server will run.
APP_ENVdevelopmentNoThe application environment (development, staging, production).
ADMIN_BASE_URLhttp://localhost:3000NoThe base URL of the web dashboard, used for generating links in emails.
APP_BASE_URLhttp://localhost:3001NoThe base URL of the mobile app’s deep link schema.
JWT_SECRETYesA secret key of at least 32 characters for signing JWT tokens.
JWT_EXPIRY_HOURS24NoThe duration (in hours) for which an access token is valid.
JWT_REFRESH_EXPIRY_DAYS30NoThe duration (in days) for which a refresh token is valid.
RUN_MIGRATIONfalseNoSet to true to auto-run database migrations on startup. Used for first-deploy automation.
RUN_SEEDERfalseNoSet to true to auto-run the database seeder on startup. Requires SU_* and WS_* vars to be set.

Create a .env.local file from .env.example in the merq-web root directory.

VariableDefault ValueRequiredDescription
VITE_API_BASE_URLhttp://localhost:8080/apiYesThe full base URL of the backend API.
VITE_GOOGLE_API_KEYFor MapsYour Google Maps API key, required to render map components.
VITE_SECURE_LOCAL_STORAGE_HASH_KEYYesA 32-character secret key used to encrypt sensitive items in browser storage.
VITE_SECURE_LOCAL_STORAGE_PREFIXmerq_NoKey prefix used for secure local storage entries.
VITE_SECURE_LOCAL_STORAGE_DISABLED_KEYSNoComma-separated list of storage keys to exclude from encryption.
VITE_APP_ENVdevelopmentNoThe application environment (development, staging, production).
VITE_APP_NAMEMerq AdminNoThe application name displayed in the UI.

Create a .env.dev or .env.prod file from .env.example in the merq-mobile root directory. The active env file is selected at runtime via the ENVFILE environment variable (e.g., ENVFILE=.env.dev yarn android).

VariableDefault ValueRequiredDescription
API_BASE_URLhttp://localhost:8080/apiYesThe base URL of the backend API. For physical devices, use your computer’s local network IP (e.g., http://192.168.1.10:8080/api).
STORAGE_ENC_KEYYesA 32-character secret key used to encrypt the local MMKV storage on the device.
GOOGLE_MAPS_API_KEYFor MapsYour Google Maps API key, required for map features on Android.
APP_ENVdevelopmentNoThe application environment (development, staging, production).
APP_NAMEMerq Field ForceNoThe application name.