{
  "manifest_version": "1.0.0",
  "template": {
    "id": "08eb893c-2f17-4b8b-818a-ffa377ee5711",
    "slug": "wakapi-coding-statistics",
    "name": "Wakapi coding statistics",
    "description": "Private coding statistics with durable PostgreSQL storage.",
    "url": "https://railway.com/deploy/wakapi-coding-statistics",
    "upstream": {
      "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
    }
  },
  "services": [
    {
      "name": "Wakapi App",
      "source": {
        "image": "ghcr.io/muety/wakapi:2.17.5@sha256:b2ed3753af47c5adef330243c2431b04940f2560b57b9dba6029fd851a8f64a9"
      },
      "needs_volume": false,
      "http": false
    },
    {
      "name": "Wakapi",
      "source": {
        "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "Wakapi App",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "WAKAPI_PORT",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_PORT.",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "WAKAPI_DB_HOST",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_HOST.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "WAKAPI_DB_NAME",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_NAME.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "WAKAPI_DB_PORT",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_PORT.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "WAKAPI_DB_TYPE",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_TYPE.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "WAKAPI_DB_USER",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "WAKAPI_COOKIE_KEY",
      "service": "Wakapi App",
      "description": "Stable generated session-signing key.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "WAKAPI_PUBLIC_URL",
      "service": "Wakapi App",
      "description": "Canonical HTTPS URL through the public gateway.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "WAKAPI_DB_PASSWORD",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_PASSWORD.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "WAKAPI_LISTEN_IPV4",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_LISTEN_IPV4.",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "WAKAPI_LISTEN_IPV6",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_LISTEN_IPV6.",
      "secret": false,
      "strategy": "default",
      "default": "-"
    },
    {
      "key": "WAKAPI_ALLOW_SIGNUP",
      "service": "Wakapi App",
      "description": "Allows private bootstrap; the public gateway permanently blocks signup.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "WAKAPI_INVITE_CODES",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_INVITE_CODES.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "WAKAPI_MAIL_ENABLED",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_MAIL_ENABLED.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "WAKAPI_PASSWORD_SALT",
      "service": "Wakapi App",
      "description": "Stable generated password salt; never rotate casually.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "WAKAPI_IMPORT_ENABLED",
      "service": "Wakapi App",
      "description": "Disables server-side imports by default to limit outbound requests.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "WAKAPI_INSECURE_COOKIES",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_INSECURE_COOKIES.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "WAKAPI_OIDC_ALLOW_SIGNUP",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_OIDC_ALLOW_SIGNUP.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "WAKAPI_DB_MAX_CONNECTIONS",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_DB_MAX_CONNECTIONS.",
      "secret": false,
      "strategy": "default",
      "default": "10"
    },
    {
      "key": "WAKAPI_LEADERBOARD_ENABLED",
      "service": "Wakapi App",
      "description": "Provide a value for WAKAPI_LEADERBOARD_ENABLED.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "PORT",
      "service": "Wakapi",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "ADMIN_EMAIL",
      "service": "Wakapi",
      "description": "Administrator email; SMTP is disabled by default.",
      "secret": false,
      "strategy": "default",
      "default": "admin@example.com"
    },
    {
      "key": "ADMIN_PASSWORD",
      "service": "Wakapi",
      "description": "Generated administrator password used idempotently at startup.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "ADMIN_USERNAME",
      "service": "Wakapi",
      "description": "Generated administrator login username.",
      "secret": false,
      "strategy": "default",
      "default": "railwayadmin"
    },
    {
      "key": "GATEWAY_CONFIG",
      "service": "Wakapi",
      "description": "Public reverse proxy that blocks all registration routes.",
      "secret": false,
      "strategy": "default",
      "default": ":8080 {\n  handle /healthz {\n    root * /tmp\n    rewrite * /wakapi-health\n    file_server\n  }\n  @signup path /signup*\n  respond @signup \"Registration is disabled; use the generated administrator account.\" 403\n  reverse_proxy {$WAKAPI_UPSTREAM}\n}"
    },
    {
      "key": "WAKAPI_UPSTREAM",
      "service": "Wakapi",
      "description": "Provide a value for WAKAPI_UPSTREAM.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PORT",
      "service": "Postgres",
      "description": "Provide a value for PORT.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Database subdirectory inside the Railway volume.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_DB.",
      "secret": false,
      "strategy": "default",
      "default": "wakapi"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Provide a value for POSTGRES_USER.",
      "secret": false,
      "strategy": "default",
      "default": "wakapi"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated PostgreSQL password.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "wakapi-coding-statistics"
      }
    },
    "cli": "railway deploy --template wakapi-coding-statistics",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "08eb893c-2f17-4b8b-818a-ffa377ee5711",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "388765c2-6cf1-44bf-9880-eb1629efd663": {
                  "icon": null,
                  "name": "Wakapi App",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": null,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/muety/wakapi:2.17.5@sha256:b2ed3753af47c5adef330243c2431b04940f2560b57b9dba6029fd851a8f64a9"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "3000"
                    },
                    "WAKAPI_PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "3000"
                    },
                    "WAKAPI_DB_HOST": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "WAKAPI_DB_NAME": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Postgres.POSTGRES_DB}}"
                    },
                    "WAKAPI_DB_PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "5432"
                    },
                    "WAKAPI_DB_TYPE": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "postgres"
                    },
                    "WAKAPI_DB_USER": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "WAKAPI_COOKIE_KEY": {
                      "isOptional": false,
                      "description": "Stable generated session-signing key.",
                      "defaultValue": "{{WAKAPI_COOKIE_KEY}}"
                    },
                    "WAKAPI_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Canonical HTTPS URL through the public gateway.",
                      "defaultValue": "https://${{Wakapi.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "WAKAPI_DB_PASSWORD": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "WAKAPI_LISTEN_IPV4": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "0.0.0.0"
                    },
                    "WAKAPI_LISTEN_IPV6": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "-"
                    },
                    "WAKAPI_ALLOW_SIGNUP": {
                      "isOptional": false,
                      "description": "Allows private bootstrap; the public gateway permanently blocks signup.",
                      "defaultValue": "true"
                    },
                    "WAKAPI_INVITE_CODES": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "false"
                    },
                    "WAKAPI_MAIL_ENABLED": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "false"
                    },
                    "WAKAPI_PASSWORD_SALT": {
                      "isOptional": false,
                      "description": "Stable generated password salt; never rotate casually.",
                      "defaultValue": "{{WAKAPI_PASSWORD_SALT}}"
                    },
                    "WAKAPI_IMPORT_ENABLED": {
                      "isOptional": false,
                      "description": "Disables server-side imports by default to limit outbound requests.",
                      "defaultValue": "false"
                    },
                    "WAKAPI_INSECURE_COOKIES": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "false"
                    },
                    "WAKAPI_OIDC_ALLOW_SIGNUP": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "false"
                    },
                    "WAKAPI_DB_MAX_CONNECTIONS": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "10"
                    },
                    "WAKAPI_LEADERBOARD_ENABLED": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "false"
                    }
                  }
                },
                "48f0adad-409d-4f39-a1db-8a927e3381e4": {
                  "icon": null,
                  "name": "Wakapi",
                  "deploy": {
                    "startCommand": "/bin/sh -ec 'until curl -fsS -H \"Content-Type: application/json\" \"$WAKAPI_UPSTREAM/api/health\" | grep -q '\"'\"'\"db\":1'\"'\"'; do sleep 2; done; signup_status=\"$(curl -sS -o /dev/null -w '\"'\"'%{http_code}'\"'\"' --data-urlencode \"username=$ADMIN_USERNAME\" --data-urlencode \"password=$ADMIN_PASSWORD\" --data-urlencode \"password_repeat=$ADMIN_PASSWORD\" --data-urlencode \"email=$ADMIN_EMAIL\" \"$WAKAPI_UPSTREAM/signup\")\"; case \"$signup_status\" in 302) login_status=\"$(curl -sS -o /dev/null -w '\"'\"'%{http_code}'\"'\"' --data-urlencode \"username=$ADMIN_USERNAME\" --data-urlencode \"password=$ADMIN_PASSWORD\" \"$WAKAPI_UPSTREAM/login\")\"; [ \"$login_status\" = 302 ] ;; 409) ;; *) echo \"Administrator bootstrap failed with HTTP $signup_status\" >&2; exit 1 ;; esac; (while true; do if curl -fsS -H \"Content-Type: application/json\" \"$WAKAPI_UPSTREAM/api/health\" | grep -q '\"'\"'\"db\":1'\"'\"'; then printf \"OK\\n\" >/tmp/wakapi-health; else rm -f /tmp/wakapi-health; fi; sleep 5; done) & printf \"%s\\n\" \"$GATEWAY_CONFIG\" >/tmp/Caddyfile; exec caddy run --config /tmp/Caddyfile --adapter caddyfile'",
                    "healthcheckPath": "/healthz",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "caddy:2.11.4-alpine@sha256:5f5c8640aae01df9654968d946d8f1a56c497f1dd5c5cda4cf95ab7c14d58648"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "8080"
                    },
                    "ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Administrator email; SMTP is disabled by default.",
                      "defaultValue": "admin@example.com"
                    },
                    "ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated administrator password used idempotently at startup.",
                      "defaultValue": "{{ADMIN_PASSWORD}}"
                    },
                    "ADMIN_USERNAME": {
                      "isOptional": false,
                      "description": "Generated administrator login username.",
                      "defaultValue": "railwayadmin"
                    },
                    "GATEWAY_CONFIG": {
                      "isOptional": false,
                      "description": "Public reverse proxy that blocks all registration routes.",
                      "defaultValue": ":8080 {\n  handle /healthz {\n    root * /tmp\n    rewrite * /wakapi-health\n    file_server\n  }\n  @signup path /signup*\n  respond @signup \"Registration is disabled; use the generated administrator account.\" 403\n  reverse_proxy {$WAKAPI_UPSTREAM}\n}"
                    },
                    "WAKAPI_UPSTREAM": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "http://${{Wakapi App.RAILWAY_PRIVATE_DOMAIN}}:3000"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {
                        "port": 8080
                      }
                    }
                  }
                },
                "c8b8b253-ccb3-4c8d-b0b5-5e9d3e9fb98e": {
                  "icon": null,
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": null,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "postgres:16-alpine@sha256:57c72fd2a128e416c7fcc499958864df5301e940bca0a56f58fddf30ffc07777"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "5432"
                    },
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Database subdirectory inside the Railway volume.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "wakapi"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "",
                      "defaultValue": "wakapi"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated PostgreSQL password.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "c8b8b253-ccb3-4c8d-b0b5-5e9d3e9fb98e": {
                      "sizeMB": 5000,
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Wakapi",
      "method": "GET",
      "path": "/healthz",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-10T16:14:52.212Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-05T00:22:43.583Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_f2e67811db28420199fb",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 97,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "Wakapi"
  }
}
