Environment
The project environment consists of three parts:
-
The
envfolder that contains a basic definition of environment variables inenv/default, and the environment folders cloned from the environments repository. As a recommendation, one per environment, e.g.:dev,staging,prod. -
The
tenantfolder cloned from the tenants repository, which contains configuration environment variables, specific resources, and style specifications. -
The source code distributed in the
desktop,mobile, andfenicefolders.
Separately, none of the three parts is functional. For the complete project to be functional, it is necessary to run a script that collects data from the first two parts and "implements" them in the third.
This happens by running the script yarn create_env {env-name}.
Env
Environment variables that will be used to establish the project configuration are defined in the env folder.
The env/default folder contains basic environment variables that can be redefined by each tenant's environment configuration. This way, each time we need to add a new environment variable, it is recommended to add it to the default environment so it doesn't fail due to not being defined in the tenants' environment configurations.
The "customized" environment folders are composed of a base tenant configuration obtained from the previously mentioned repository, and a submodule to the fenice tenants repository fenice-env which has three branches (dev, prod, staging). Changing the branch that the submodule points to changes the environment of the variables.
This separation is because there is a lot of common configuration among tenants, and we centralize it in fenice-env. And everything that is tenant-specific, especially credentials, firebase ids, apk signing keys, etc., are defined in the tenant's environment variables repository.
Environment Variables Structure
env/ # Environment variables
├── default/ # Basic project environment variables
│ ├── backend/ # Backend environment variables (never used, can be deprecated)
│ ├── client/
│ │ ├── app.env * # Client environment variables
│ │ └── sentry.properties # Example sentry config file