Skip to content

Instantly share code, notes, and snippets.

@montasim
Last active January 28, 2025 08:28
Show Gist options
  • Save montasim/aeda29551b9f483fa4d7c0c4ba9bdd7a to your computer and use it in GitHub Desktop.
Save montasim/aeda29551b9f483fa4d7c0c4ba9bdd7a to your computer and use it in GitHub Desktop.
Defines the various environments used in the application.
/**
* @fileoverview Defines the various environments used in the application.
* This module exports an object that contains the different environments
* the application can run in. These environments are used to configure
* the application behavior based on the current environment.
*
* @module constants/environments
* @version 1.0.0
* @license CC BY-NC-ND 4.0
*
* @contact Mohammad Montasim-Al-Mamun Shuvo
* @created 2025-01-28
* @contactEmail [email protected]
* @contactGithub https://github.com/montasim
*/
/**
* An object representing different environments.
* @enum {string}
*/
const environments = Object.freeze({
/**
* Development environment - Used for active development of the application.
* Example: The application runs locally on a developer's machine with hot-reloading enabled.
* @type {string}
*/
DEVELOPMENT: 'development',
/**
* Test environment - Used for running automated or manual tests.
* Example: The application is deployed in a test server where integration and unit tests are executed.
* @type {string}
*/
TEST: 'test',
/**
* Staging environment - Used for pre-production testing to mimic the production environment.
* Example: The application is tested in a staging server to verify new features before deployment to production.
* @type {string}
*/
STAGING: 'staging',
/**
* User Acceptance Testing (UAT) environment - Used for end-users or stakeholders to validate features before production release.
* Example: Clients or QA teams test the application in a UAT server to confirm it meets their requirements.
* @type {string}
*/
UAT: 'uat',
/**
* Production environment - Used for live deployment of the application.
* Example: The application runs in the production server, serving real users with live data.
* @type {string}
*/
PRODUCTION: 'production',
/**
* Local environment - Used for running the application locally, often for debugging purposes.
* Example: The application is started locally on `localhost` for individual testing.
* @type {string}
*/
LOCAL: 'local',
/**
* QA environment - Used by the QA team to conduct quality assurance tests.
* Example: A QA team runs regression tests on a QA server to ensure the application is stable and bug-free.
* @type {string}
*/
QA: 'qa',
/**
* Integration environment - Used to test integration between different modules or services.
* Example: The application communicates with APIs, databases, or microservices in an integration server to verify end-to-end functionality.
* @type {string}
*/
INTEGRATION: 'integration',
/**
* Pre-production environment - Used for the final validation before the production deployment.
* Example: The application is deployed in a pre-production environment for last-minute verification by developers and stakeholders.
* @type {string}
*/
PRE_PRODUCTION: 'pre-production',
/**
* Demo environment - Used for presenting the application to stakeholders or for training purposes.
* Example: A demo version of the application with mock data is deployed to showcase features to potential clients.
* @type {string}
*/
DEMO: 'demo',
});
export default environments;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment