Working on your project

Working with environment variables

env files in the repository, custom variables, and how dev and prod are configured.

On this page

Every generated repository ships with its configuration. Environment variables live in two places: the env/ directory in the code repository (for local development and app builds) and the gitops-configuration repository (for the dev and prod deployments).

The env/ directory

App and backend repositories contain an env/ directory with files following the pattern <stage>.<kind>.env:

File Maintained by Contents
local.generated.env Platform URLs and values for local development
local.custom.env You Your own local settings
dev.generated.env / prod.generated.env Platform Stage-specific URLs (e.g. backend URL on dev/prod)
dev.custom.env / prod.custom.env You Your own stage-specific values
shared.generated.env Platform Cross-stage values (e.g. Sentry DSN, bundle IDs)
shared.custom.env You Your own cross-stage values

The rule is simple:

  • *.generated.env is written by the platform and overwritten on changes – do not edit.
  • *.custom.env is yours. Add your own variables here or override generated values.

When starting via ap run-local, the right files are loaded automatically – for Flutter apps via --dart-define-from-file, for example.

Tip
Need a new variable for local work? Add it to env/local.custom.env and restart ap run-local.

Deployment configuration: dev and prod

What runs on the servers is configured in your project’s gitops-configuration repository – one folder per environment:

gitops-configuration/
└── configurations/
    ├── dev/
    │   ├── generated.yaml   # Platform: hostnames, registry, secrets (SOPS)
    │   ├── custom.yaml      # You: custom environment variables
    │   └── versions.yaml    # Pipeline: deployed image versions
    └── prod/                # same structure

Add your own deployment environment variables in custom.yaml under additional_env_variables. After a commit to main, the GitOps repository automatically rolls the change out to the respective environment – just like the regular deployment workflow.

Secrets

Passwords, tokens, and keys are generated by the platform and stored encrypted or managed automatically – including database credentials, JWT secrets, and registry credentials.

Warning
Do not put sensitive passwords or API keys in plain text into *.custom.env or custom.yaml. Use the platform-managed secrets for sensitive values, or ask support which approach fits your case.

See also