{
  "manifest_version": "1.0.0",
  "template": {
    "id": "4e4291e8-5147-4afe-a31e-4d3c1330a855",
    "slug": "nofx-ai-trader",
    "name": "NOFX",
    "description": "Trading terminal where an AI model picks and manages the trades",
    "url": "https://railway.com/deploy/nofx-ai-trader",
    "upstream": {
      "repo_url": "https://github.com/gridalpha/nofx-railway"
    }
  },
  "services": [
    {
      "name": "Postgres",
      "source": {
        "image": "ghcr.io/railwayapp-templates/postgres-ssl:18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql/data",
      "http": false
    },
    {
      "name": "nofx",
      "source": {
        "repo": "https://github.com/gridalpha/nofx-railway"
      },
      "needs_volume": true,
      "volume_mount_path": "/app/data",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Cluster location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Data panel alias, not read by the server",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "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",
      "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": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "SSL certificate expiry in days",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "TZ",
      "service": "nofx",
      "description": "Container timezone",
      "secret": false,
      "strategy": "default",
      "default": "UTC"
    },
    {
      "key": "PORT",
      "service": "nofx",
      "description": "HTTP port nginx listens on",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "DB_HOST",
      "service": "nofx",
      "description": "PostgreSQL private hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_NAME",
      "service": "nofx",
      "description": "PostgreSQL database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_PORT",
      "service": "nofx",
      "description": "PostgreSQL port",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_USER",
      "service": "nofx",
      "description": "PostgreSQL user",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "DB_SSLMODE",
      "service": "nofx",
      "description": "Encrypt the database connection",
      "secret": false,
      "strategy": "default",
      "default": "require"
    },
    {
      "key": "JWT_SECRET",
      "service": "nofx",
      "description": "Signs session tokens, keep stable",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "DB_PASSWORD",
      "service": "nofx",
      "description": "PostgreSQL password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "CORS_ALLOWED_ORIGINS",
      "service": "nofx",
      "description": "This deployment's own origin",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "TRANSPORT_ENCRYPTION",
      "service": "nofx",
      "description": "Browser encrypts API keys before sending",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "NOFX_ENCRYPTION_SECRET",
      "service": "nofx",
      "description": "Seeds the at-rest encryption key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "nofx",
      "description": "Clean shutdown window for traders",
      "secret": false,
      "strategy": "default",
      "default": "30"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "nofx-ai-trader"
      }
    },
    "cli": "railway deploy --template nofx-ai-trader",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "4e4291e8-5147-4afe-a31e-4d3c1330a855",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "3dc2aabb-101d-474f-a269-187f565474ab": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/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": "Cluster location on the volume",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Data panel alias, not read by the server",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Database created on first boot",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Private connection string",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser created on first boot",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "SSL certificate expiry in days",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "3dc2aabb-101d-474f-a269-187f565474ab": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  }
                },
                "7bacba54-b82b-4bd7-86d9-e4f07d0d48ea": {
                  "icon": "https://raw.githubusercontent.com/NoFxAiOS/nofx/main/web/public/icons/nofx.svg",
                  "name": "nofx",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/gridalpha/nofx-railway",
                    "rootDirectory": null
                  },
                  "variables": {
                    "TZ": {
                      "isOptional": false,
                      "description": "Container timezone",
                      "defaultValue": "UTC"
                    },
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port nginx listens on",
                      "defaultValue": "8080"
                    },
                    "DB_HOST": {
                      "isOptional": false,
                      "description": "PostgreSQL private hostname",
                      "defaultValue": "${{Postgres.PGHOST}}"
                    },
                    "DB_NAME": {
                      "isOptional": false,
                      "description": "PostgreSQL database name",
                      "defaultValue": "${{Postgres.PGDATABASE}}"
                    },
                    "DB_PORT": {
                      "isOptional": false,
                      "description": "PostgreSQL port",
                      "defaultValue": "${{Postgres.PGPORT}}"
                    },
                    "DB_USER": {
                      "isOptional": false,
                      "description": "PostgreSQL user",
                      "defaultValue": "${{Postgres.PGUSER}}"
                    },
                    "DB_SSLMODE": {
                      "isOptional": false,
                      "description": "Encrypt the database connection",
                      "defaultValue": "require"
                    },
                    "JWT_SECRET": {
                      "isOptional": false,
                      "description": "Signs session tokens, keep stable",
                      "defaultValue": "{{JWT_SECRET}}"
                    },
                    "DB_PASSWORD": {
                      "isOptional": false,
                      "description": "PostgreSQL password",
                      "defaultValue": "${{Postgres.PGPASSWORD}}"
                    },
                    "CORS_ALLOWED_ORIGINS": {
                      "isOptional": false,
                      "description": "This deployment's own origin",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "TRANSPORT_ENCRYPTION": {
                      "isOptional": false,
                      "description": "Browser encrypts API keys before sending",
                      "defaultValue": "true"
                    },
                    "NOFX_ENCRYPTION_SECRET": {
                      "isOptional": false,
                      "description": "Seeds the at-rest encryption key",
                      "defaultValue": "{{NOFX_ENCRYPTION_SECRET}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window for traders",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  },
                  "volumeMounts": {
                    "7bacba54-b82b-4bd7-86d9-e4f07d0d48ea": {
                      "mountPath": "/app/data"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T10:14:37.339Z",
  "generator_version": "0.1.0",
  "status": "validated",
  "validated_at": "2026-09-19T16:15:15.320Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_01b9c4f7577c4b32b870",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 127,
    "typical_build_seconds": 21,
    "typical_start_seconds": 5,
    "slowest_service": "nofx"
  }
}
