api and web repositories contain an app_engine.yaml file that configures the App Engine service.
The
app_engine.yaml files live in the individual service repositories, not in the main peermetrics/peermetrics repository. Find them at:Prerequisites
- A Google Cloud project with App Engine enabled
- The Google Cloud CLI (
gcloud) installed and authenticated - A PostgreSQL database accessible from App Engine (e.g. Cloud SQL)
- A Redis instance accessible from App Engine (e.g. Memorystore)
Overview
Because Peermetrics splits ingestion (API) and visualization (web) into two services, both must be deployed separately to App Engine. Each deployment reads its configuration from environment variables defined in the respectiveapp_engine.yaml.
Deployment steps
Configure the API service
Edit
api/app_engine.yaml to set your environment variables. At minimum, configure the database connection, Redis, and the secret values:SECRET_KEY— Django secret keyINIT_TOKEN_SECRET— used to generate JWT tokensSESSION_TOKEN_SECRET— used to encrypt session cookiesDEFAULT_ADMIN_PASSWORD— password for the auto-created admin accountDATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD,DATABASE_NAMEREDIS_HOSTWEB_DOMAIN— the domain where the web service will be accessible
Configure the web service
Edit
web/app_engine.yaml and set:SECRET_KEYDEFAULT_ADMIN_PASSWORD— must match the value set in the API serviceAPI_ROOT— the public URL of your deployed API service, ending with/v1DATABASE_HOST,DATABASE_USER,DATABASE_PASSWORD,DATABASE_NAME
Optional Google Cloud integrations
The API service supports optional integrations that are useful when running on Google Cloud. Enable them by setting the following environment variables inapp_engine.yaml:
| Variable | Value | Description |
|---|---|---|
USE_GOOGLE_CLOUD_LOGGING | True | Route Django logs to Google Cloud Logging |
USE_GOOGLE_TASK_QUEUE | True | Use Cloud Tasks instead of local task processing |
GOOGLE_TASK_QUEUE_NAME | e.g. queue-1 | Name of the Cloud Tasks queue |
APP_ENGINE_LOCATION | e.g. us-east1 | App Engine region for Cloud Tasks |
TASK_QUEUE_DOMAIN | e.g. https://api.example.com/ | Domain used when enqueuing tasks |
Next steps
- See Configuration: environment variables for the full list of variables accepted by each service.
- See Authentication for guidance on securing admin credentials before your first deployment.

