1. Generally, each web app project will have three or four permanent hosting environments on cloud
  2. There will be dedicated branches in every project that will be mapped to these 3-4 environments
  3. For each environment, we will have a dedicated env file for storing the environment variable. There will be a global env file that will have all variables the web app needs and the corresponding env files for each environment will override the variables that change between each environment (Eg: backend URL).
Env Name Branch name Env file name in ReactJS
Local .env
Develop develop .env.development
QA qa .env.qa
Staging staging .env.staging
Production master .env.production

Variables that are present in all web apps are -

  1. REACT_APP_ENV_NAME: The name of the environment name. It should match the “Env Name” column in the above table
  2. REACT_APP_ENV_VERSION: The version number of the web app. Described here in detail.
  3. REACT_APP_CORE_API_URL: The API URL of the backend
  4. REACT_APP_HOSTING_ROOT: The root URL on which the web client is hosted.
  5. REACT_APP_SENTRY_DSN: The DSN of Sentry. More about in Art of Logging