Skip to content

Instantly share code, notes, and snippets.

@montasim
Created January 27, 2025 10:35
Show Gist options
  • Save montasim/63337b21fde9596afdb34254efe39142 to your computer and use it in GitHub Desktop.
Save montasim/63337b21fde9596afdb34254efe39142 to your computer and use it in GitHub Desktop.
This file serves as a template for configuring environment variables essential for the development environment.
####################################################
# .env.production Configuration File
####################################################
# This file serves as a template for configuring environment variables essential for the development environment.
# Adjust these settings to align with your specific development needs and infrastructure requirements.
####################################################
# APPLICATION ENVIRONMENT
# Purpose: Defines the operating mode of the application (development, test, production).
# Use: Toggle features or behaviors based on the application environment.
####################################################
# NODE_ENV: Specifies the environment in which the application runs.
# Typical values:
# - 'development': Enables detailed error logging and debugging features.
# - 'test': Used for running automated tests with test-specific configurations.
# - 'production': Optimizes the application for performance and security.
# Example: Set this to 'production' for a live deployment.
NODE_ENV='production'
####################################################
# SERVER CONFIGURATION
# Purpose: Contains settings pertinent to the application server, such as port and API version.
# Use: Facilitate running the server with environment-specific configurations.
####################################################
# PORT: Specifies the port on which the server will run.
# Example: Setting this to '3000' means the application will be accessible at http://localhost:3000.
# Adjust this value based on your deployment or local development requirements.
PORT='<YOUR_SERVER_PORT>'
####################################################
# TIMEOUT CONFIGURATION
# Purpose: Defines the timeout settings for various operations in the application.
# Use: Configure timeout settings for operations that require a specific time limit.
####################################################
# TIMEOUT_IN_SECONDS: Specifies the default timeout value (in seconds) for application operations.
# Example: Setting this to '60' means operations that exceed 60 seconds will timeout.
# Use this setting to prevent long-running operations from consuming too many resources.
TIMEOUT_IN_SECONDS='60'
####################################################
# JSON PAYLOAD CONFIGURATION
# Purpose: Defines settings for JSON payload limits and other related configurations.
# Use: Configure the maximum payload size for JSON requests and other related settings.
####################################################
# JSON_PAYLOAD_LIMIT_IN_KB: Defines the maximum allowed size (in KB) for JSON payloads in requests.
# Example: Setting this to '20' means the JSON payload size must not exceed 20 KB.
# Use this setting to safeguard the application against large payloads that can cause performance issues or abuse.
JSON_PAYLOAD_LIMIT_IN_KB='20'
####################################################
# CORS CONFIGURATION
# Purpose: Defines settings for Cross-Origin Resource Sharing (CORS) in the application.
# Use: Configure CORS settings to allow or restrict access to the application from different domains.
####################################################
# CORS_ALLOWED_METHODS: Specifies the HTTP methods allowed for Cross-Origin Resource Sharing (CORS).
# Example: 'OPTIONS, POST, GET, PATCH, DELETE' allows the listed HTTP methods for cross-origin requests.
CORS_ALLOWED_METHODS='OPTIONS, POST, GET, PATCH, DELETE'
# CORS_ALLOWED_ORIGIN: Specifies the origins allowed for making CORS requests.
# Example: Specify multiple origins using a comma-separated list (e.g., 'http://localhost:5000, http://localhost:3000').
# Use '*' to allow all origins, but this is not recommended for production due to security concerns.
CORS_ALLOWED_ORIGIN='http://localhost:5000, http://localhost:3000'
####################################################
# DATABASE CONFIGURATION
# Purpose: Configuration settings for the application's database connection.
# Use: Establish and manage the connection to different database.
####################################################
# MONGODB_DATABASE_PROTOCOL: Protocol for connecting to the MongoDB database.
# Example: 'mongodb+srv' is used for connecting to a MongoDB Atlas cluster.
MONGODB_DATABASE_PROTOCOL='mongodb+srv'
# MONGODB_DATABASE_USERNAME: The username for authenticating with the MongoDB database.
# Example: This is the database user with appropriate permissions for the application.
MONGODB_DATABASE_USERNAME='<YOUR_DATABASE_USERNAME>'
# MONGODB_DATABASE_PASSWORD: The password for authenticating with the MongoDB database.
# Example: Use a strong password to enhance database security.
MONGODB_DATABASE_PASSWORD='<YOUR_DATABASE_PASSWORD>'
# MONGODB_DATABASE_CLUSTER_HOST: The cluster host for the MongoDB database connection.
# Example: Specifies the MongoDB Atlas cluster host (e.g., 'cluster0.50yg5.mongodb.net').
MONGODB_DATABASE_CLUSTER_HOST='<YOUR_CLUSTER_HOST>'
# MONGODB_DATABASE_DATABASE_NAME: The name of the MongoDB database.
# Example: The specific database within the cluster to store and retrieve data for the application.
MONGODB_DATABASE_DATABASE_NAME='school-portfolio'
# MONGODB_DATABASE_OPTIONS: Additional options for the MongoDB connection string.
# Example: 'retryWrites=true&w=majority&appName=Cluster0' enables retryable writes and sets a custom app name.
MONGODB_DATABASE_OPTIONS='retryWrites=true&w=majority&appName=Cluster0'
####################################################
# PRISMA CONFIGURATION
# Purpose: Define Prisma-specific settings for database operations.
# Use: Configure Prisma provider and connection details for the database.
####################################################
# DATABASE_PROVIDER: Specifies the database provider used by Prisma.
# Values: 'postgresql', 'mysql', 'mongodb', 'sqlite', etc.
# Example: 'mongodb' indicates Prisma is configured for MongoDB as the database provider.
DATABASE_PROVIDER='mongodb'
# DATABASE_URL: Connection string for the database. Used by Prisma for migrations and queries.
# Example: This string combines protocol, username, password, host, database name, and additional options.
DATABASE_URL='<YOUR_DATABASE_URL>'
####################################################
# AUTH CONFIGURATION
# Purpose: Contains settings related to user authentication and authorization.
# Use: Configure settings for user roles, permissions, and other authentication-related features.
####################################################
# AUTH_X_SITE_IDENTIFIER: Unique identifier for site authentication.
# Example: Used to ensure cross-site authentication consistency. Ensure this value is securely stored.
AUTH_X_SITE_IDENTIFIER='<YOUR_X_SITE_IDENTIFIER>'
# AUTH_MAXIMUM_LOGIN_ATTEMPTS: Maximum login attempts allowed before the account is locked.
# Example: Set to '5' to lock the account after 5 failed login attempts.
AUTH_MAXIMUM_LOGIN_ATTEMPTS='5'
# AUTH_MAXIMUM_RESET_PASSWORD_ATTEMPTS: Maximum password reset attempts allowed.
# Example: Limits the number of password reset attempts to '5'.
AUTH_MAXIMUM_RESET_PASSWORD_ATTEMPTS='5'
# AUTH_MAXIMUM_VERIFY_EMAIL_ATTEMPTS: Maximum email verification attempts allowed.
# Example: Set to '5' to restrict verification attempts for enhanced security.
AUTH_MAXIMUM_VERIFY_EMAIL_ATTEMPTS='5'
# AUTH_MAXIMUM_CHANGE_EMAIL_ATTEMPTS: Maximum email change attempts allowed.
# Example: Allows users to attempt email changes up to '5' times.
AUTH_MAXIMUM_CHANGE_EMAIL_ATTEMPTS='5'
# AUTH_MAXIMUM_CHANGE_MOBILE_ATTEMPTS: Maximum mobile number change attempts allowed.
# Example: Limits the number of mobile number change attempts to '5'.
AUTH_MAXIMUM_CHANGE_MOBILE_ATTEMPTS='5'
# AUTH_MAXIMUM_CHANGE_PASSWORD_ATTEMPTS: Maximum password change attempts allowed.
# Example: Restricts users to '5' password change attempts.
AUTH_MAXIMUM_CHANGE_PASSWORD_ATTEMPTS='5'
# AUTH_MAXIMUM_ACTIVE_SESSIONS: Maximum number of concurrent active sessions allowed per user.
# Example: Set to '3' to limit each user to three active sessions simultaneously.
AUTH_MAXIMUM_ACTIVE_SESSIONS='3'
# AUTH_ACCOUNT_LOCK_DURATION_HOUR: Duration (in hours) for which an account is locked after exceeding maximum attempts.
# Example: An account remains locked for '1' hour after reaching the login attempt limit.
AUTH_ACCOUNT_LOCK_DURATION_HOUR='1'
####################################################
# JWT CONFIGURATION
# Purpose: Settings related to JSON Web Tokens for secure authentication and authorization.
# Use: Configure secret keys and token expiration times for various authentication flows.
####################################################
# JWT_ACCESS_TOKEN_SECRET: Secret key for access token encryption.
# Example: Used to sign and verify access tokens. Store this securely to prevent unauthorized access.
JWT_ACCESS_TOKEN_SECRET='exampleSecretKey'
# JWT_ACCESS_TOKEN_EXPIRATION_IN_MINUTES: Access token validity period.
# Example: Access tokens are valid for '40' minutes.
JWT_ACCESS_TOKEN_EXPIRATION_IN_MINUTES='40'
# JWT_REFRESH_TOKEN_SECRET: Secret key for refresh token encryption.
# Example: Used to sign and verify refresh tokens. Refresh tokens provide extended session duration.
JWT_REFRESH_TOKEN_SECRET='exampleRefreshKey'
# JWT_REFRESH_TOKEN_EXPIRATION_IN_MINUTES: Refresh token validity period.
# Example: Refresh tokens are valid for '10' minutes. Adjust based on application requirements.
JWT_REFRESH_TOKEN_EXPIRATION_IN_MINUTES='10'
# JWT_RESET_PASSWORD_TOKEN_SECRET: Secret key for reset password tokens.
# Example: Used to sign and verify password reset tokens for secure password recovery.
JWT_RESET_PASSWORD_TOKEN_SECRET='exampleResetPasswordKey'
# JWT_RESET_PASSWORD_TOKEN_EXPIRATION_IN_MINUTES: Reset password token expiration time.
# Example: Reset password tokens expire in '10' minutes.
JWT_RESET_PASSWORD_TOKEN_EXPIRATION_IN_MINUTES='10'
# JWT_VERIFY_EMAIL_TOKEN_SECRET: Secret key for email verification tokens.
# Example: Used to sign and verify email verification tokens during user onboarding or email changes.
JWT_VERIFY_EMAIL_TOKEN_SECRET='exampleVerifyEmailKey'
# JWT_VERIFY_EMAIL_TOKEN_EXPIRATION_IN_MINUTES: Email verification token expiration time.
# Example: Email verification tokens are valid for '10' minutes.
JWT_VERIFY_EMAIL_TOKEN_EXPIRATION_IN_MINUTES='10'
####################################################
# RATE LIMIT CONFIGURATION
# Purpose: Contains settings related to rate limiting for API endpoints.
# Use: Configure rate limits to prevent abuse or excessive usage of API endpoints.
####################################################
# RATE_LIMIT_TOTAL_REQUESTS: Maximum number of requests allowed in the time window.
# Example: If set to '100', users can make up to 100 requests within the defined time window.
RATE_LIMIT_TOTAL_REQUESTS='100'
# RATE_LIMIT_WINDOW_IN_MS: Time window duration in milliseconds for rate limiting.
# Example: '15 * 60 * 1000;' represents a 15-minute window (15 minutes x 60 seconds x 1000 milliseconds).
RATE_LIMIT_WINDOW_IN_MS='15 * 60 * 1000;'
# RATE_LIMIT_MESSAGE: Message displayed when the rate limit is exceeded.
# Example: The user sees this message if they exceed the allowed number of requests.
RATE_LIMIT_MESSAGE='Too many requests, please try again later.'
# RATE_LIMIT_HEADERS: Whether to include rate limit headers in the response.
# Example: Set to 'true' to provide rate limit information (e.g., remaining requests) in response headers.
RATE_LIMIT_HEADERS='true'
####################################################
# COOKIES CONFIGURATION
# Purpose: Contains settings related to cookies used for session management.
# Use: Configure cookie settings for secure session management and user authentication.
####################################################
# COOKIE_SECURE: Enforces secure cookies (HTTPS only).
# Example: 'true' ensures cookies are only transmitted over secure HTTPS connections.
COOKIE_SECURE='true'
# COOKIE_SAME_SITE: Restricts cookies to same-site or cross-site scenarios.
# Example: 'true' enforces strict same-site policies, enhancing security against CSRF attacks.
COOKIE_SAME_SITE='true'
# COOKIE_HTTP_ONLY: Ensures cookies are not accessible via JavaScript.
# Example: 'true' prevents client-side scripts from accessing the cookie, mitigating XSS attacks.
COOKIE_HTTP_ONLY='true'
# COOKIE_MAX_AGE_IN_SECONDS: Maximum age (in seconds) for cookies.
# Example: '86400' sets the cookie to expire in 24 hours (24 hours x 60 minutes x 60 seconds).
COOKIE_MAX_AGE_IN_SECONDS='86400'
# COOKIE_USER_TOKEN_NAME: Name of the cookie storing the user token.
# Example: 'user-token' is the key used to identify the user's session token.
COOKIE_USER_TOKEN_NAME='user-token'
####################################################
# CACHE CONFIGURATION
# Purpose: Defines settings for caching mechanisms used in the application.
# Use: Configure caching settings for various cache stores (e.g., Redis, Memcached).
####################################################
# CACHE_TTL_IN_SECONDS: Time-to-live (TTL) for cached data in seconds.
# Example: '864000' sets the cached data to expire in 10 days (10 days x 24 hours x 60 minutes x 60 seconds).
CACHE_TTL_IN_SECONDS='864000'
####################################################
# EMAIL SERVICE CONFIGURATION
# Purpose: Defines settings for SMTP-based email service used for sending emails from the application.
# Use: Configure connection and authentication details for the email service provider.
####################################################
# EMAIL_SMTP_HOST: SMTP host for sending emails.
# Example: 'smtp.gmail.com' is used for Gmail SMTP servers.
EMAIL_SMTP_HOST='smtp.gmail.com'
# EMAIL_SMTP_PORT: SMTP port number.
# Example: '587' is typically used for secure connections with STARTTLS.
EMAIL_SMTP_PORT='587'
# EMAIL_SMTP_USERNAME: Username for authenticating with the email service.
# Example: Typically the email address used to send outgoing emails.
EMAIL_SMTP_USERNAME='<YOUR_EMAIL_SMTP_USERNAME>'
# EMAIL_SMTP_PASSWORD: Password for authenticating with the email service.
# Example: Use an app-specific password for Gmail if two-factor authentication is enabled.
EMAIL_SMTP_PASSWORD='<YOUR_EMAIL_SMTP_PASSWORD>'
# EMAIL_SMTP_MAX_CONNECTION_RETRY_ATTEMPTS: Maximum retry attempts for SMTP connections.
# Example: Set a limit to retry email sending in case of connection failures.
EMAIL_SMTP_MAX_CONNECTION_RETRY_ATTEMPTS='10'
# EMAIL_FROM: Default sender email address for outgoing emails.
# Example: The "From" field in emails will display this address.
EMAIL_FROM='<YOUR_SENDER_EMAIL>'
####################################################
# GOOGLE DRIVE SERVICE CONFIGURATION
# Purpose: Optional settings for integrating Google Drive as a file storage solution.
# Use: Specify authentication and folder details for storing files on Google Drive.
####################################################
# GOOGLE_DRIVE_CLIENT_EMAIL: Client email for Google Drive API authentication.
# Example: The service account email associated with your Google Cloud project.
GOOGLE_DRIVE_CLIENT_EMAIL='google-drive-client-email'
# GOOGLE_DRIVE_FOLDER_KEY: Folder key for storing files in Google Drive.
# Example: The unique identifier for a folder in Google Drive where files will be stored.
GOOGLE_DRIVE_FOLDER_KEY='google-drive-folder-key'
# GOOGLE_DRIVE_PRIVATE_KEY: Base64-encoded private key for Google Drive API authentication.
# Example: The private key for the service account, encoded in Base64 format.
# Ensure this key is securely stored and never exposed publicly.
GOOGLE_DRIVE_PRIVATE_KEY='google-drive-private-key-in-base64'
# GOOGLE_DRIVE_SCOPE: OAuth scope for accessing Google Drive.
# Example: Specifies the level of access granted to the application.
# 'https://www.googleapis.com/auth/drive' provides full access to files in Google Drive.
GOOGLE_DRIVE_SCOPE='https://www.googleapis.com/auth/drive'
####################################################
# SYSTEM ADMIN CONFIGURATION
# Purpose: Contains settings for the default admin user of the application.
# Use: Configure the default admin user's email and password for initial setup.
####################################################
# SYSTEM_ADMIN_EMAIL: Default email for the system admin account.
# Example: The email address used to log in as the system administrator.
SYSTEM_ADMIN_EMAIL=
# SYSTEM_ADMIN_PASSWORD: Default password for the system admin account.
# Example: A strong password used during initial setup.
# Change this password immediately after the first login to enhance security.
SYSTEM_ADMIN_PASSWORD=
####################################################
# CONTACT INFORMATION
# Purpose: Defines contact information for the application.
# Use: Provide contact details for users to reach out for support or inquiries.
####################################################
# CONTACT_EMAIL: General contact email for inquiries.
# Example: Users can use this email address for non-support-related general inquiries.
CONTACT_EMAIL='[email protected]'
# CONTACT_MOBILE: General contact phone number.
# Example: This phone number can be used for general inquiries, feedback, or questions.
CONTACT_MOBILE='+8801722815469'
# SUPPORT_EMAIL: Email address for support requests.
# Example: Users should contact this email address for technical support or issue resolution.
SUPPORT_EMAIL='[email protected]'
# SUPPORT_MOBILE: Phone number for support requests.
# Example: This phone number can be used for urgent technical support or troubleshooting.
SUPPORT_MOBILE='+8801722815469'
# ADMIN_EMAIL: Email address for administrative contacts.
# Example: Administrative queries, such as account management or escalations, can be sent here.
ADMIN_EMAIL='[email protected]'
# ADMIN_MOBILE: Phone number for administrative contacts.
# Example: Use this number for urgent administrative issues or escalations.
ADMIN_MOBILE='+8801722815469'
####################################################
# SOCIAL MEDIA LINKS
# Purpose: Defines social media links for the application.
# Use: Provide links to social media profiles for users to connect with the application.
####################################################
# SOCIAL_MEDIA_LINKEDIN: LinkedIn profile link.
# Example: Users can connect professionally or view updates related to the application here.
SOCIAL_MEDIA_LINKEDIN='https://www.linkedin.com/in/montasim'
# SOCIAL_MEDIA_GITHUB: GitHub profile link.
# Example: Developers and users can view the application's repositories and code contributions here.
SOCIAL_MEDIA_GITHUB='https://github.com/montasim'
# SOCIAL_MEDIA_X: X (formerly Twitter) profile link.
# Example: This link directs users to the application's updates, tweets, or discussions.
SOCIAL_MEDIA_X='https://github.com/montasim'
# SOCIAL_MEDIA_FACEBOOK: Facebook profile link.
# Example: Users can follow the application for updates, events, or posts on Facebook.
SOCIAL_MEDIA_FACEBOOK='https://github.com/montasim'
# SOCIAL_MEDIA_INSTAGRAM: Instagram profile link.
# Example: This link allows users to view visual content or promotional posts related to the application.
SOCIAL_MEDIA_INSTAGRAM='https://github.com/montasim'
####################################################
# SENTRY CONFIGURATION
# Purpose: Define Sentry credentials for error tracking and monitoring.
# Use: Monitor application errors and performance in production.
####################################################
# SENTRY_ORG: Name of the Sentry organization.
# Example: This identifies the organization within Sentry that owns the project.
SENTRY_ORG=
# SENTRY_PROJECT: Name of the Sentry project.
# Example: Used to specify the project within the organization being monitored.
SENTRY_PROJECT=
# SENTRY_TUNNEL_ROUTE: Custom route for Sentry tunneling.
# Example: '/monitoring' specifies the endpoint where Sentry events are routed.
# This is useful for proxying requests or avoiding direct communication with Sentry's servers.
SENTRY_TUNNEL_ROUTE='/monitoring'
# SENTRY_DSN: Data Source Name for the Sentry project.
# Example: This URL is required to connect the application to the Sentry service.
# Obtain the DSN from the project settings in your Sentry account.
SENTRY_DSN=
# SENTRY_AUTH_TOKEN: Authentication token for accessing the Sentry API.
# Example: This token allows API-level communication with Sentry for project management and event ingestion.
# Ensure this token is securely stored and kept confidential.
SENTRY_AUTH_TOKEN=
####################################################
# DEBUG CONFIGURATION
# Purpose: Define settings related to debug mode in the application.
# Use: Enable detailed debugging features during development or troubleshooting.
####################################################
# DEBUG_MODE: Enables or disables debug mode.
# true - Debug mode is enabled.
# false - Debug mode is disabled.
DEBUG_MODE=true
# DEBUG_LOG_LEVEL: Specifies the level of detail in debug logs.
# Options: 'INFO', 'DEBUG', 'WARN', 'ERROR'
DEBUG_LOG_LEVEL='DEBUG'
# DEBUG_ALLOWED_USER_AGENT: Specifies user agents allowed for debug mode.
# Example: 'PostmanRuntime/' allows debugging for requests from Postman.
DEBUG_ALLOWED_USER_AGENT='PostmanRuntime/'
# DEBUG_KEY: Encryption key used for debug purposes.
# Example: Used to decrypt sensitive data for debugging.
# Ensure this key is stored securely and rotated periodically.
DEBUG_KEY='<YOUR_DEBUG_KEY>'
####################################################
# CRYPTOGRAPHY CONFIGURATION
# Purpose: Define secrets for cryptographic operations within the application.
# Use: Ensure secure data encryption, decryption, and hashing processes.
####################################################
# NEXT_PUBLIC_CRYPTO_SECRET_KEY: Secret key for cryptographic operations.
# Example: Used for data encryption and decryption processes.
# Ensure this key is kept secure and never exposed publicly.
NEXT_PUBLIC_CRYPTO_SECRET_KEY='<YOUR_CRYPTO_SECRET_KEY>'
# NEXT_PUBLIC_BASE_URL: Base URL for the application.
# Example: Specifies the root URL for API requests or frontend routing.
# Update this value based on the environment (e.g., production, staging, or development).
NEXT_PUBLIC_BASE_URL='<YOUR_BASE_URL>'
# NEXT_PUBLIC_VERSION: API version to be used in requests.
# Example: Defines the version of the API endpoints for backward compatibility.
# Update this value when deploying a new API version.
NEXT_PUBLIC_VERSION='v1'
# NEXT_PUBLIC_UNSPLASH_ACCESS_KEY: Access key for Unsplash API integration.
# Example: Used to authenticate requests made to the Unsplash API for fetching images.
# Obtain this key from your Unsplash developer account and keep it secure.
NEXT_PUBLIC_UNSPLASH_ACCESS_KEY='v1'
# NEXT_DIST_DIR: Distribution directory for the application.
# Example: Specifies the folder where the compiled application is built and served.
# This is typically set to 'dist' for production builds.
NEXT_DIST_DIR='dist'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment