{
  "manifest_version": "1.0.0",
  "template": {
    "id": "2c77b5db-8885-4f9c-971f-afa1d10b56fe",
    "slug": "deploy-casecite-legal-ai-research",
    "name": "Deploy CaseCite Legal AI Research",
    "description": "Self-hosted legal RAG for caselaw research and document review",
    "url": "https://railway.com/deploy/deploy-casecite-legal-ai-research",
    "upstream": {
      "image": "ghcr.io/onepush-dev/casecite:1.3.0"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "CaseCite",
      "source": {
        "image": "ghcr.io/onepush-dev/casecite:1.3.0"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    },
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    }
  ],
  "required_inputs": [
    {
      "key": "REDIS_URL",
      "service": "CaseCite",
      "description": "URL of the bundled Redis (noeviction) used for rate limits, lockouts and revoked-token markers.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "SECRET_KEY",
      "service": "CaseCite",
      "description": "Generated 64-hex key that signs JWTs and sessions; changing it signs everyone out.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CORS_ORIGINS",
      "service": "CaseCite",
      "description": "Browser origins allowed to call the API; your Railway domain over HTTPS.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DATABASE_URL",
      "service": "CaseCite",
      "description": "Async SQLAlchemy URL of the bundled Postgres over Railway's private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "FRONTEND_URL",
      "service": "CaseCite",
      "description": "Public URL used in password-reset and invitation links.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "ALLOWED_HOSTS",
      "service": "CaseCite",
      "description": "Hostnames the app accepts (TrustedHost); your Railway domain, add custom domains comma-separated.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "AUDIT_HMAC_KEY",
      "service": "CaseCite",
      "description": "Generated 64-hex key for the tamper-evident audit-log HMAC chain.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "ENCRYPTION_SALT",
      "service": "CaseCite",
      "description": "Generated 32-hex salt for deriving keys that encrypt stored user secrets; keep it stable.",
      "secret": false,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "REGISTRATION_BOOTSTRAP_TOKEN",
      "service": "CaseCite",
      "description": "Generated token required to register the first (admin) account, so nobody else can claim the instance.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Data directory on the Postgres volume.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private hostname of the Postgres service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Same as POSTGRES_PASSWORD, for psql-style clients.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Plain postgresql:// connection URL (private network, database postgres).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Generated password for the postgres superuser.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Private hostname of the Redis service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "redis:// connection URL over the private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Same as REDIS_PASSWORD (legacy name).",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Generated password for the Redis default user.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "deploy-casecite-legal-ai-research"
      }
    },
    "cli": "railway deploy --template deploy-casecite-legal-ai-research",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "2c77b5db-8885-4f9c-971f-afa1d10b56fe",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "13684b27-10f4-434c-98a1-6dff47e22687": {
                  "icon": null,
                  "name": "CaseCite",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/onepush-dev/casecite:1.3.0"
                  },
                  "variables": {
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "URL of the bundled Redis (noeviction) used for rate limits, lockouts and revoked-token markers.",
                      "defaultValue": "redis://default:${{Redis.REDIS_PASSWORD}}@${{Redis.RAILWAY_PRIVATE_DOMAIN}}:6379/0"
                    },
                    "SECRET_KEY": {
                      "isOptional": false,
                      "description": "Generated 64-hex key that signs JWTs and sessions; changing it signs everyone out.",
                      "defaultValue": "{{SECRET_KEY}}"
                    },
                    "CORS_ORIGINS": {
                      "isOptional": false,
                      "description": "Browser origins allowed to call the API; your Railway domain over HTTPS.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Async SQLAlchemy URL of the bundled Postgres over Railway's private network.",
                      "defaultValue": "postgresql+asyncpg://postgres:${{Postgres.POSTGRES_PASSWORD}}@${{Postgres.RAILWAY_PRIVATE_DOMAIN}}:5432/postgres"
                    },
                    "FRONTEND_URL": {
                      "isOptional": false,
                      "description": "Public URL used in password-reset and invitation links.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "ALLOWED_HOSTS": {
                      "isOptional": false,
                      "description": "Hostnames the app accepts (TrustedHost); your Railway domain, add custom domains comma-separated.",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "AUDIT_HMAC_KEY": {
                      "isOptional": false,
                      "description": "Generated 64-hex key for the tamper-evident audit-log HMAC chain.",
                      "defaultValue": "{{AUDIT_HMAC_KEY}}"
                    },
                    "ENCRYPTION_SALT": {
                      "isOptional": false,
                      "description": "Generated 32-hex salt for deriving keys that encrypt stored user secrets; keep it stable.",
                      "defaultValue": "{{ENCRYPTION_SALT}}"
                    },
                    "REGISTRATION_BOOTSTRAP_TOKEN": {
                      "isOptional": false,
                      "description": "Generated token required to register the first (admin) account, so nobody else can claim the instance.",
                      "defaultValue": "{{REGISTRATION_BOOTSTRAP_TOKEN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:80": {
                        "port": 80
                      }
                    }
                  },
                  "volumeMounts": {
                    "13684b27-10f4-434c-98a1-6dff47e22687": {
                      "mountPath": "/app/data"
                    }
                  }
                },
                "2ec78b9d-87ec-45e9-9d41-bfb4e623f511": {
                  "icon": "https://devicons.railway.app/i/postgresql.svg",
                  "name": "Postgres",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "Data directory on the Postgres volume.",
                      "defaultValue": "${{RAILWAY_VOLUME_MOUNT_PATH}}/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private hostname of the Postgres service.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Same as POSTGRES_PASSWORD, for psql-style clients.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Plain postgresql:// connection URL (private network, database postgres).",
                      "defaultValue": "postgresql://postgres:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/postgres"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the postgres superuser.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "2ec78b9d-87ec-45e9-9d41-bfb4e623f511": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "b4d4bd41-cb1e-498b-adc9-eab72c09c5eb": {
                  "icon": "https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg",
                  "name": "Redis",
                  "deploy": {
                    "startCommand": "/bin/sh -c \"rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Private hostname of the Redis service.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "redis:// connection URL over the private network.",
                      "defaultValue": "redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:6379"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Same as REDIS_PASSWORD (legacy name).",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Generated password for the Redis default user.",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "b4d4bd41-cb1e-498b-adc9-eab72c09c5eb": {
                      "mountPath": "/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "CaseCite",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-11-08T22:15:11.842Z",
  "generator_version": "0.1.0"
}
