{
  "manifest_version": "1.0.0",
  "template": {
    "id": "98ca8ae4-835e-4259-92a6-c14d3e174f0a",
    "slug": "mastra-software-factory",
    "name": "Mastra Software Factory",
    "description": "Agent software factory: turn GitHub issues into reviewed PRs with AI agents",
    "url": "https://railway.com/deploy/mastra-software-factory",
    "upstream": {
      "image": "ghcr.io/hmseeb/mastra-factory-railway:0.24.0-r1"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "factory",
      "source": {
        "image": "ghcr.io/hmseeb/mastra-factory-railway:0.24.0-r1"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    },
    {
      "name": "postgres",
      "source": {
        "image": "pgvector/pgvector:pg18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "factory",
      "description": "Port the server listens on and the public domain targets.",
      "secret": false,
      "strategy": "default",
      "default": "4111"
    },
    {
      "key": "DATABASE_URL",
      "service": "factory",
      "description": "Postgres connection string.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "WORKOS_API_KEY",
      "service": "factory",
      "description": "WorkOS API key (sk_...) from dashboard.workos.com. Sign-in runs through WorkOS AuthKit.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "WORKOS_CLIENT_ID",
      "service": "factory",
      "description": "WorkOS client ID (client_...). Add https://<your-domain>/auth/callback as a redirect URI in WorkOS.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "MASTRACODE_PUBLIC_URL",
      "service": "factory",
      "description": "Public origin. All OAuth callbacks derive from it. Change to https://your.domain after adding a custom domain.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "FACTORY_ALLOWED_EMAILS",
      "service": "factory",
      "description": "Comma-separated emails allowed to sign in, for example you@company.com. Everyone else is refused.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "WORKOS_COOKIE_PASSWORD",
      "service": "factory",
      "description": "Seals session cookies and signs OAuth state. Generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "FACTORY_SANDBOX_PROVIDER",
      "service": "factory",
      "description": "local runs agent commands inside this container. Clear it and set E2B_API_KEY for isolated E2B VMs.",
      "secret": false,
      "strategy": "default",
      "default": "local"
    },
    {
      "key": "GITHUB_APP_WEBHOOK_SECRET",
      "service": "factory",
      "description": "Webhook secret. Paste the same value into your GitHub App's webhook settings.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "FACTORY_CREDENTIAL_ENCRYPTION_KEY",
      "service": "factory",
      "description": "Encrypts stored model keys and integration tokens. Changing it makes them unreadable.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGDATA",
      "service": "postgres",
      "description": "Subdirectory of the volume; initdb refuses the mount root because of lost+found.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "POSTGRES_DB",
      "service": "postgres",
      "description": "Database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "postgres",
      "description": "Private connection string used by Factory.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "postgres",
      "description": "Superuser created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "postgres",
      "description": "Superuser password, generated per deploy.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "mastra-software-factory"
      }
    },
    "cli": "railway deploy --template mastra-software-factory",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "98ca8ae4-835e-4259-92a6-c14d3e174f0a",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "2c2f67a6-2662-414a-860b-327fc5fc7c56": {
                  "icon": "https://mastra.ai/favicon/new-brand/icon-512.png",
                  "name": "factory",
                  "deploy": {
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/hmseeb/mastra-factory-railway:0.24.0-r1"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the server listens on and the public domain targets.",
                      "defaultValue": "4111"
                    },
                    "E2B_API_KEY": {
                      "isOptional": true,
                      "description": "Optional. E2B key for isolated sandboxes; takes effect only when FACTORY_SANDBOX_PROVIDER is empty."
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string.",
                      "defaultValue": "${{postgres.DATABASE_URL}}"
                    },
                    "GITHUB_APP_ID": {
                      "isOptional": true,
                      "description": "Optional. Your GitHub App's ID. All five GITHUB_APP_* values enable repository projects."
                    },
                    "WORKOS_API_KEY": {
                      "isOptional": false,
                      "description": "WorkOS API key (sk_...) from dashboard.workos.com. Sign-in runs through WorkOS AuthKit.",
                      "defaultValue": "{{WORKOS_API_KEY}}"
                    },
                    "GITHUB_APP_SLUG": {
                      "isOptional": true,
                      "description": "Optional. Your GitHub App's slug (the name in its URL)."
                    },
                    "WORKOS_CLIENT_ID": {
                      "isOptional": false,
                      "description": "WorkOS client ID (client_...). Add https://<your-domain>/auth/callback as a redirect URI in WorkOS.",
                      "defaultValue": "{{WORKOS_CLIENT_ID}}"
                    },
                    "GITHUB_APP_CLIENT_ID": {
                      "isOptional": true,
                      "description": "Optional. Your GitHub App's client ID."
                    },
                    "MASTRACODE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public origin. All OAuth callbacks derive from it. Change to https://your.domain after adding a custom domain.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "FACTORY_ALLOWED_EMAILS": {
                      "isOptional": false,
                      "description": "Comma-separated emails allowed to sign in, for example you@company.com. Everyone else is refused.",
                      "defaultValue": "{{FACTORY_ALLOWED_EMAILS}}"
                    },
                    "GITHUB_APP_PRIVATE_KEY": {
                      "isOptional": true,
                      "description": "Optional. Your GitHub App's private key, the full PEM contents."
                    },
                    "WORKOS_COOKIE_PASSWORD": {
                      "isOptional": false,
                      "description": "Seals session cookies and signs OAuth state. Generated per deploy.",
                      "defaultValue": "{{WORKOS_COOKIE_PASSWORD}}"
                    },
                    "FACTORY_SANDBOX_PROVIDER": {
                      "isOptional": false,
                      "description": "local runs agent commands inside this container. Clear it and set E2B_API_KEY for isolated E2B VMs.",
                      "defaultValue": "local"
                    },
                    "GITHUB_APP_CLIENT_SECRET": {
                      "isOptional": true,
                      "description": "Optional. Your GitHub App's client secret."
                    },
                    "GITHUB_APP_WEBHOOK_SECRET": {
                      "isOptional": false,
                      "description": "Webhook secret. Paste the same value into your GitHub App's webhook settings.",
                      "defaultValue": "{{GITHUB_APP_WEBHOOK_SECRET}}"
                    },
                    "FACTORY_CREDENTIAL_ENCRYPTION_KEY": {
                      "isOptional": false,
                      "description": "Encrypts stored model keys and integration tokens. Changing it makes them unreadable.",
                      "defaultValue": "{{FACTORY_CREDENTIAL_ENCRYPTION_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:4111": {
                        "port": 4111
                      }
                    }
                  },
                  "volumeMounts": {
                    "7c2b9020-edbf-4ad2-833a-cf8e639a03b7": {
                      "mountPath": "/data"
                    }
                  }
                },
                "37f8fdd7-9307-4414-b9b6-ba3e590de14b": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "postgres",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"unset PGPORT; exec docker-entrypoint.sh postgres --port=5432\"",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "pgvector/pgvector:pg18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Subdirectory of the volume; initdb refuses the mount root because of lost+found.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string used by Factory.",
                      "defaultValue": "postgresql://${{POSTGRES_USER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{POSTGRES_DB}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot.",
                      "defaultValue": "postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, generated per deploy.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "513452ab-503d-428d-bac7-a38d8cbeb183": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "factory",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-10-25T22:14:45.812Z",
  "generator_version": "0.1.0"
}
