{
  "manifest_version": "1.0.0",
  "template": {
    "id": "817aec97-715b-49df-966d-bc95ec5e5780",
    "slug": "rei3",
    "name": "REI3 | Open-Source Low-Code Business App Platform",
    "description": "Low-code platform for business apps: CRM, tickets, time, assets. Postgres.",
    "url": "https://railway.com/deploy/rei3",
    "upstream": {
      "repo_url": "https://github.com/nomideusz/rei3-railway"
    }
  },
  "services": [
    {
      "name": "REI3",
      "source": {
        "repo": "https://github.com/nomideusz/rei3-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/opt/r3/data",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "REI3",
      "description": "HTTP port REI3 listens on behind Railway's HTTPS - leave as is.",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "PGHOST",
      "service": "REI3",
      "description": "Postgres host (private network)",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "REI3",
      "description": "Postgres port",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "REI3",
      "description": "Postgres user",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "REI3",
      "description": "Postgres database",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "REI3",
      "description": "Postgres password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "R3_VERSION",
      "service": "REI3",
      "description": "REI3 release to build (see github.com/r3-team/r3/releases). Raise it and redeploy to upgrade; the database is migrated on start and cannot be downgraded.",
      "secret": false,
      "strategy": "default",
      "default": "3.13"
    },
    {
      "key": "R3_PUBLIC_HOST",
      "service": "REI3",
      "description": "Public host name REI3 uses in links (mails, calendars, client config). Applied once on first boot; change it later in Admin -> System.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "R3_ADMIN_PASSWORD",
      "service": "REI3",
      "description": "Password for the 'admin' account, set on first boot in place of REI3's default admin/admin. Change it in REI3 afterwards; this variable is not used again.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Database name",
      "secret": false,
      "strategy": "default",
      "default": "rei3"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Database user",
      "secret": false,
      "strategy": "default",
      "default": "rei3"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Auto-generated database password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Time for Postgres to shut down cleanly on redeploy",
      "secret": false,
      "strategy": "default",
      "default": "60"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "rei3"
      }
    },
    "cli": "railway deploy --template rei3",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "817aec97-715b-49df-966d-bc95ec5e5780",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "6928db39-c27d-4a01-8edf-e0d2217b7885": {
                  "icon": "https://raw.githubusercontent.com/nomideusz/rei3-railway/main/icon.png",
                  "name": "REI3",
                  "build": {
                    "dockerfilePath": "Dockerfile"
                  },
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/status",
                    "restartPolicyType": "ON_FAILURE",
                    "healthcheckTimeout": 300,
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/nomideusz/rei3-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port REI3 listens on behind Railway's HTTPS - leave as is.",
                      "defaultValue": "8080"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Postgres host (private network)",
                      "defaultValue": "${{Postgres.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Postgres port",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Postgres user",
                      "defaultValue": "${{Postgres.POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Postgres database",
                      "defaultValue": "${{Postgres.POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Postgres password",
                      "defaultValue": "${{Postgres.POSTGRES_PASSWORD}}"
                    },
                    "R3_VERSION": {
                      "isOptional": false,
                      "description": "REI3 release to build (see github.com/r3-team/r3/releases). Raise it and redeploy to upgrade; the database is migrated on start and cannot be downgraded.",
                      "defaultValue": "3.13"
                    },
                    "R3_PUBLIC_HOST": {
                      "isOptional": true,
                      "description": "Public host name REI3 uses in links (mails, calendars, client config). Applied once on first boot; change it later in Admin -> System.",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "R3_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the 'admin' account, set on first boot in place of REI3's default admin/admin. Change it in REI3 afterwards; this variable is not used again.",
                      "defaultValue": "{{R3_ADMIN_PASSWORD}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  },
                  "volumeMounts": {
                    "20e50ac6-8ae1-4004-a0ce-1fca090f83a4": {
                      "mountPath": "/opt/r3/data"
                    }
                  }
                },
                "91c73b0b-fc22-41ad-9fee-871c9e97b839": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "build": {},
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:17"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data subdirectory - keeps Postgres happy on Railway volumes",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database name",
                      "defaultValue": "rei3"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Database user",
                      "defaultValue": "rei3"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Auto-generated database password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time for Postgres to shut down cleanly on redeploy",
                      "defaultValue": "60"
                    }
                  },
                  "networking": {
                    "serviceDomains": {}
                  },
                  "volumeMounts": {
                    "3e71d1a0-1e97-4f1a-bfb3-872dd72395b5": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "REI3",
      "method": "GET",
      "path": "/status",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-18T04:14:41.301Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-10-18T02:17:37.665Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_448bd800cded4451af6c",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 87,
    "typical_build_seconds": 61,
    "typical_start_seconds": 10,
    "slowest_service": "REI3"
  }
}
