Projects and environments
How projects, regions and environments organise your services, and how to create, fork, switch and delete environments.
A project holds the services that make up one application, such as a web service, a worker, a database and a bucket. Each project has one or more environments, and an environment is a separate copy of the project with its own services, variables and data.
What is a region?
A region is the place where Dekka runs a project's infrastructure. You choose it when you create the project and every service in it runs there. Today the only region is Ghana (gh-1), and more will appear in the list once they're running and verified. Where your data lives explains what verified means.
What is an environment?
Every project starts with an environment called production, which is its default. Services, connections, variables and shared variables all belong to one environment, so a service in staging can't reach a database in production, and each environment gets its own private hostnames, such as api.staging.dekka.internal.
Create an environment
Open the environment menu next to the project name, choose New environment, enter a name in lowercase letters, numbers and dashes, and choose Create environment. Under Start from you can begin with An empty environment or with a copy of an existing one.
A copy recreates every service with the same settings, variables, shared variables, volumes and connections, and deploys each service. Databases and buckets in the copy are created empty, and no data is copied. Each copy counts against your plan like any other service.
curl https://api.dekka.cloud/v1/projects/$PROJECT_ID/environments \
-H "Authorization: Bearer $DEKKA_API_KEY" \
--json '{ "name": "staging", "fork_from": "'$PRODUCTION_ENV_ID'" }'The number of environments a project can have depends on your plan, counting production: one on Free, three on Starter and ten on Growth.
Switch between environments
Choose an environment from the menu next to the project name. Every project page, including the canvas, deployments, logs, metrics, variables and domains, then shows that environment, and the address gains ?env=staging so you can share a link to it. The default environment has no ?env= in its address.
Rename or delete an environment
Renaming an environment through the API (PATCH /v1/environments/{id}) changes its private hostnames and DEKKA_ENVIRONMENT from each service's next deploy. Deleting one (DELETE /v1/environments/{id}, which needs the admin role) deletes every service, database and bucket in it, and the default environment can't be deleted.
Preview a pull request
Turn on Pull request previews in the settings of a GitHub service in the default environment. Each pull request against that service's branch then gets its own environment, named after the pull request, such as pr-42, which is a copy of the default environment with empty databases. The previewed service deploys the pull request's latest commit, and every new commit to the pull request deploys again. Previews appear under Pull request previews in the environment menu, and closing the pull request deletes its environment.
A preview counts against your plan's environments per project, so on Free, where a project has one environment, previews can't be created. GET /v1/projects/{id}/previews lists them with their status and address, and DELETE /v1/previews/{id} closes one early.
Delete a project
Open the project's Settings and choose Delete project. Dekka only deletes a project once it's empty, so remove its services first.