Configuration and Environment Variables
Relevant source files
The following files were used as context for generating this wiki page:
The Ever Teams platform relies heavily on environment variables for configuration across its various components, including the web frontend, mobile app, backend API, and deployment environments. This system allows for flexibility in deployment, easy customization for white-labeling, and clear separation of configuration from code. Configuration is managed through .env files, Docker Compose files, and platform-specific deployment manifests.
The core principle is to inject configuration at build time or runtime, allowing the same codebase to be used for production, demo, staging, and self-hosted instances. Key configurable aspects include API endpoints, branding elements (logos, names, links), third-party service integrations (OAuth, Sentry, Jitsu), and feature flags.
Web Application Configuration (apps/web)
The Next.js web application uses a multi-layered approach to handle configuration, flowing from environment variables to build configuration, and finally to strongly-typed constants available throughout the application.
Configuration Flow
The diagram below illustrates how environment variables are processed and made available to the web application.
This diagram shows the flow of environment variables from files to the Next.js build and then into the application code.
Sources: apps/web/next.config.js, apps/web/core/constants/config/constants.tsx
Next.js Build Configuration (next.config.js)
The next.config.js file is the entry point for build-time configuration. It reads process.env variables to configure various aspects of the Next.js application.
- Environment Variables: It directly exposes a set of branding and feature variables to the client-side bundle through the
envproperty. This makes them accessible in the browser underprocess.env. - Image Optimization: The
images.remotePatternsconfiguration is dynamically generated by parsing theNEXT_PUBLIC_IMAGES_HOSTSenvironment variable, which allows for flexible whitelisting of image sources. - Sentry Integration: Sentry is conditionally enabled and configured based on the presence of
SENTRY_DSNand other related variables for production builds.
// apps/web/next.config.js:122-140
env: {
APP_NAME: process.env.APP_NAME,
APP_SIGNATURE: process.env.APP_SIGNATURE,
APP_LOGO_URL: process.env.APP_LOGO_URL,
APP_LINK: process.env.APP_LINK,
APP_SLOGAN_TEXT: process.env.APP_SLOGAN_TEXT,
COMPANY_NAME: process.env.COMPANY_NAME,
COMPANY_LINK: process.env.COMPANY_LINK,
TERMS_LINK: process.env.TERMS_LINK,
PRIVACY_POLICY_LINK: process.env.PRIVACY_POLICY_LINK,
MAIN_PICTURE: process.env.MAIN_PICTURE,
MAIN_PICTURE_DARK: process.env.MAIN_PICTURE_DARK,
// New branding variables
NEXT_PUBLIC_SITE_NAME: process.env.NEXT_PUBLIC_SITE_NAME,
NEXT_PUBLIC_SITE_TITLE: process.env.NEXT_PUBLIC_SITE_TITLE,
NEXT_PUBLIC_SITE_DESCRIPTION: process.env.NEXT_PUBLIC_SITE_DESCRIPTION,
NEXT_PUBLIC_SITE_KEYWORDS: process.env.NEXT_PUBLIC_SITE_KEYWORDS,
NEXT_PUBLIC_WEB_APP_URL: process.env.NEXT_PUBLIC_WEB_APP_URL,
NEXT_PUBLIC_TWITTER_USERNAME: process.env.NEXT_PUBLIC_TWITTER_USERNAME,
ANALYZE: process.env.ANALYZE
// NEXT_PUBLIC_DEMO is automatically accessible (no need to add it here)
},
Sources: apps/web/next.config.js:122-140
Centralized Constants (constants.tsx)
The file apps/web/core/constants/config/constants.tsx serves as a single source of truth for configuration values within the application code. It reads from process.env and exports typed constants, providing default fallbacks for many values. This practice prevents scattering process.env calls and ensures consistency.
Key constants defined here include:
- API URLs:
GAUZY_API_SERVER_URLandGAUZY_API_BASE_SERVER_URL. - Branding:
APP_NAME,APP_LOGO_URL,COMPANY_NAME, etc. - Feature Flags:
IS_DEMO_MODE,ACTIVE_LOCAL_LOG_SYSTEM. - Third-Party Keys:
RECAPTCHA_SITE_KEY,POSTHOG_KEY,GITHUB_APP_NAME. - Authentication:
TOKEN_COOKIE_NAME, OAuth client IDs, and callback URLs.
| Constant | Environment Variable | Default Value | Purpose |
|---|---|---|---|
GAUZY_API_SERVER_URL | GAUZY_API_SERVER_URL | https://api.ever.team/api | The backend API endpoint. |
APP_NAME | APP_NAME | Ever Teams | The application name for branding. |
APP_LOGO_URL | APP_LOGO_URL | https://app.ever.team/assets/ever-teams.png | URL for the application logo. |
IS_DEMO_MODE | NEXT_PUBLIC_DEMO | false | Enables or disables demo mode features. |
GITHUB_APP_NAME | NEXT_PUBLIC_GITHUB_APP_NAME | '' | The name of the GitHub App for integration. |
MEET_DOMAIN | NEXT_PUBLIC_MEET_DOMAIN | '' | The domain for the Jitsi meeting integration. |
| Sources: apps/web/core/constants/config/constants.tsx:112-160, 240-243, 273-276 |
Docker Deployment
The project uses Docker Compose for orchestrating services. There are multiple docker-compose files for different environments: production (docker-compose.yml), demo (docker-compose.demo.yml), and local build (docker-compose.build.yml).
Service Overview
The main docker-compose.yml defines two primary services: api (the Gauzy backend) and webapp (the Ever Teams frontend). It also includes docker-compose.infra.yml to manage infrastructure services like databases and message queues.
This diagram shows the services defined in the Docker Compose files and their dependencies.
Sources: docker-compose.yml:4-14, 78-81
webapp Service Configuration
The webapp service is configured almost entirely through environment variables. These variables control everything from backend API connections to branding and third-party integrations.
| Variable | Example Default | Purpose |
|---|---|---|
GAUZY_API_SERVER_URL | https://api.ever.team | Sets the backend API URL for server-side rendering. |
NEXT_PUBLIC_GAUZY_API_SERVER_URL | https://api.ever.team | Sets the backend API URL for client-side requests. |
NODE_ENV | development | Sets the application environment mode. |
NEXT_PUBLIC_DEMO | true | Enables demo mode. |
APP_NAME | Ever Teams | Defines the application name for branding. |
APP_LOGO_URL | https://app.ever.team/assets/ever-teams.png | URL for the main application logo. |
COMPANY_NAME | Ever Co. LTD | Defines the company name for branding. |
NEXT_PUBLIC_SITE_TITLE | Open Work and Project... | Sets the website title for SEO. |
NEXT_PUBLIC_GITHUB_APP_NAME | ever-github | Name of the GitHub App for OAuth. |
GITHUB_CLIENT_ID | (empty) | Client ID for GitHub OAuth. |
NEXT_PUBLIC_MEET_DOMAIN | meet.ever.team | Domain for the meeting feature. |
NEXT_PUBLIC_SENTRY_DSN | (empty) | Sentry DSN for error tracking. |
| Sources: docker-compose.yml:82-167, docker-compose.demo.yml:5-89 |
api Service Configuration
The api service, which runs the Gauzy backend, is also configured via environment variables. These are crucial for connecting to the database and other infrastructure, as well as for integrating with services like GitHub.
| Variable | Example Default | Purpose |
|---|---|---|
DB_HOST | db | Hostname for the database service. |
API_BASE_URL | http://localhost:3000 | The public-facing base URL of the API. |
CLIENT_BASE_URL | http://localhost:4200 | The base URL of the client application. |
GAUZY_GITHUB_CLIENT_ID | (empty) | GitHub App client ID. |
GAUZY_GITHUB_CLIENT_SECRET | (empty) | GitHub App client secret. |
APP_NAME | (empty) | Application name, used in email templates. |
APP_EMAIL_CONFIRMATION_URL | (empty) | URL for email confirmation links. |
| Sources: docker-compose.yml:9-49 |
Mobile Application Branding
The mobile application's branding is configured using environment variables, as documented in apps/mobile/BRANDING.md. These variables are used during the build process to customize the app's name, logo, and other identifiers.
| Variable | Default Value | Purpose |
|---|---|---|
APP_NAME | Ever Teams | The display name of the application. |
COMPANY_NAME | Ever Co. LTD | The name of the company. |
APP_LOGO_URL | https://app.ever.team/assets/ever-teams.png | URL for the app logo. |
APP_WEBSITE_URL | https://ever.team/ | The application's official website. |
EXPO_PROJECT_PACKAGE_NAME | (none) | Android package name (e.g., com.yourcompany.yourapp). |
EXPO_PROJECT_IOS_BUNDLE_IDENTIFIER | (none) | iOS bundle identifier (e.g., com.yourcompany.yourapp). |
| Sources: apps/mobile/BRANDING.md |
Cloud Deployment Configuration
The repository includes configuration files for various hosting platforms, which also rely on environment variables.
Render (render.yaml)
The render.yaml file defines a web service for deployment on Render. It specifies build commands and a list of environment variables. Many variables are set to sync: false, indicating that their values must be provided securely in the Render dashboard rather than being committed to the repository.
| Key | Value / Sync | Purpose |
|---|---|---|
NEXT_PUBLIC_GAUZY_API_SERVER_URL | https://api.ever.team | Sets the backend API URL. |
APP_NAME | Ever Teams | Sets the application name. |
SMTP_HOST | sync: false | SMTP server host (secret). |
SMTP_PASSWORD | sync: false | SMTP server password (secret). |
NEXT_PUBLIC_SENTRY_DSN | sync: false | Sentry DSN for error tracking (secret). |
| Sources: render.yaml:9-62 |
Summary
Configuration management in Ever Teams is robust and standardized around environment variables. This approach provides a powerful mechanism for customizing the platform for different deployment targets, tenants, and branding requirements. By centralizing variable access in files like constants.tsx and defining service configurations in docker-compose.yml, the project maintains a clean separation of concerns and enhances maintainability and scalability.