{
  "manifest_version": "1.0.0",
  "template": {
    "id": "9565efeb-8b4b-47ac-a3bd-9ce06b60c77c",
    "slug": "nakatomicrm",
    "name": "NakatomiCRM",
    "description": "Headless agent-native CRM — REST, MCP, A2A, ACP.",
    "url": "https://railway.com/deploy/nakatomicrm",
    "upstream": {
      "repo_url": "https://github.com/mrdulasolutions/NakatomiCRM"
    }
  },
  "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": "nakatomi",
      "source": {
        "repo": "https://github.com/mrdulasolutions/NakatomiCRM"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "Filesystem path inside the container where Postgres stores data. Persisted to a volume — don't change.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "Private-network hostname of this Postgres. Auto-resolved from Railway — Nakatomi reads DATABASE_URL instead.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "TCP port Postgres listens on. 5432 is the standard.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "Superuser name. Mirrors POSTGRES_USER.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "Active database name. Mirrors POSTGRES_DB.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "Superuser password, auto-generated per install. Never share or reuse.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "Initial database created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "Full internal connection string. What Nakatomi consumes to talk to Postgres.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Superuser account name created on first boot.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Validity in days of the self-signed SSL certificate Postgres serves.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Superuser password, auto-generated per install. Never share or reuse.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "External connection string for Postgres. Only set if you expose the DB publicly.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period Railway gives active queries before killing a replaced replica.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "PORT",
      "service": "nakatomi",
      "description": "Port the app listens on. ",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "LOG_LEVEL",
      "service": "nakatomi",
      "description": "Logging verbosity. INFO for normal use, DEBUG for troubleshooting.",
      "secret": false,
      "strategy": "default",
      "default": "INFO"
    },
    {
      "key": "S3_BUCKET",
      "service": "nakatomi",
      "description": "Linked from the Nakatomi Files Bucket service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_REGION",
      "service": "nakatomi",
      "description": "Railway sets the Bucket region automatically.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SECRET_KEY",
      "service": "nakatomi",
      "description": "Signing secret for JWTs and OAuth codes. Generated on install — do not share.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "ENVIRONMENT",
      "service": "nakatomi",
      "description": "Environment label shown in /health. Use production.",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "CORS_ORIGINS",
      "service": "nakatomi",
      "description": "Comma-separated origins allowed to call the API. * is fine for agent-only use.",
      "secret": false,
      "strategy": "default",
      "default": "*"
    },
    {
      "key": "DATABASE_URL",
      "service": "nakatomi",
      "description": "Postgres connection. Linked automatically to the attached Postgres service.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_ACCESS_KEY",
      "service": "nakatomi",
      "description": "Linked from the Bucket.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_SECRET_KEY",
      "service": "nakatomi",
      "description": "Linked, sensitive.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "S3_ENDPOINT_URL",
      "service": "nakatomi",
      "description": "Linked",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "STORAGE_BACKEND",
      "service": "nakatomi",
      "description": "Where uploaded files go: local (uses the mounted volume) or s3.",
      "secret": false,
      "strategy": "default",
      "default": "s3"
    },
    {
      "key": "DASHBOARD_ENABLED",
      "service": "nakatomi",
      "description": "Exposes the audit UI at /dashboard. Leave false unless you add your own auth in front.",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "JWT_EXPIRE_MINUTES",
      "service": "nakatomi",
      "description": "How long user login tokens stay valid. Default 60.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "STORAGE_LOCAL_PATH",
      "service": "nakatomi",
      "description": "Where local-backend files are written. Must be inside the mounted /app/data volume.",
      "secret": false,
      "strategy": "default",
      "default": "/app/data/files"
    },
    {
      "key": "WEBHOOK_MAX_RETRIES",
      "service": "nakatomi",
      "description": "Retries per failed webhook delivery before giving up.",
      "secret": false,
      "strategy": "default",
      "default": "3"
    },
    {
      "key": "WEBHOOK_WORKER_ENABLED",
      "service": "nakatomi",
      "description": "Background worker that delivers webhooks. Keep true.",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "WEBHOOK_TIMEOUT_SECONDS",
      "service": "nakatomi",
      "description": "Request timeout for each webhook POST.",
      "secret": false,
      "strategy": "default",
      "default": "10"
    },
    {
      "key": "API_KEY_RATE_LIMIT_PER_MINUTE",
      "service": "nakatomi",
      "description": "Max requests per API key per minute. Default 120.",
      "secret": true,
      "strategy": "default",
      "default": "120"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "nakatomicrm"
      }
    },
    "cli": "railway deploy --template nakatomicrm",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "9565efeb-8b4b-47ac-a3bd-9ce06b60c77c",
            "serializedConfig": {
              "buckets": {
                "35d11015-2ecc-42b7-bc12-1b80796f25cd": {
                  "name": "Nakatomi Files"
                }
              },
              "services": {
                "c5c02f75-5e14-48fb-be84-10be1ee7bd88": {
                  "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": "Filesystem path inside the container where Postgres stores data. Persisted to a volume — don't change.",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Private-network hostname of this Postgres. Auto-resolved from Railway — Nakatomi reads DATABASE_URL instead.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "TCP port Postgres listens on. 5432 is the standard.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Superuser name. Mirrors POSTGRES_USER.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Active database name. Mirrors POSTGRES_DB.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, auto-generated per install. Never share or reuse.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Initial database created on first boot.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Full internal connection string. What Nakatomi consumes to talk to Postgres.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Superuser account name created on first boot.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity in days of the self-signed SSL certificate Postgres serves.",
                      "defaultValue": "820"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Superuser password, auto-generated per install. Never share or reuse.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "External connection string for Postgres. Only set if you expose the DB publicly.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period Railway gives active queries before killing a replaced replica.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "c5c02f75-5e14-48fb-be84-10be1ee7bd88": {
                      "mountPath": "/var/lib/postgresql/data"
                    }
                  },
                  "haTemplateCode": "postgres-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxy",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "Routes traffic to the primary",
                      "defaultValue": 3
                    },
                    "replica": {
                      "label": "Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5,
                        6,
                        7
                      ],
                      "nodeLabel": "Postgres",
                      "description": "Streaming replicas for automatic failover",
                      "defaultValue": 2
                    },
                    "internal": {
                      "label": "Coordinator Nodes",
                      "options": [
                        3,
                        5,
                        7,
                        9
                      ],
                      "nodeLabel": "etcd",
                      "defaultValue": 3
                    },
                    "description": "This will convert your Postgres database to an HA cluster with Patroni failover and etcd consensus."
                  }
                },
                "cae14798-cc8b-4102-aa00-6fc8250108d1": {
                  "icon": "https://raw.githubusercontent.com/mrdulasolutions/NakatomiCRM/main/public/nakatomi.svg",
                  "name": "nakatomi",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/mrdulasolutions/NakatomiCRM",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port the app listens on. ",
                      "defaultValue": "8080"
                    },
                    "LOG_LEVEL": {
                      "isOptional": false,
                      "description": "Logging verbosity. INFO for normal use, DEBUG for troubleshooting.",
                      "defaultValue": "INFO"
                    },
                    "S3_BUCKET": {
                      "isOptional": false,
                      "description": "Linked from the Nakatomi Files Bucket service.",
                      "defaultValue": "${{Nakatomi Files.BUCKET}}"
                    },
                    "S3_REGION": {
                      "isOptional": false,
                      "description": "Railway sets the Bucket region automatically.",
                      "defaultValue": "${{Nakatomi Files.REGION}}"
                    },
                    "SECRET_KEY": {
                      "isOptional": false,
                      "description": "Signing secret for JWTs and OAuth codes. Generated on install — do not share.",
                      "defaultValue": "{{SECRET_KEY}}"
                    },
                    "ENVIRONMENT": {
                      "isOptional": false,
                      "description": "Environment label shown in /health. Use production.",
                      "defaultValue": "production"
                    },
                    "CORS_ORIGINS": {
                      "isOptional": false,
                      "description": "Comma-separated origins allowed to call the API. * is fine for agent-only use.",
                      "defaultValue": "*"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection. Linked automatically to the attached Postgres service.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "GBRAIN_TOKEN": {
                      "isOptional": true,
                      "description": "Bearer token minted with gbrain auth create <label>.",
                      "defaultValue": ""
                    },
                    "S3_ACCESS_KEY": {
                      "isOptional": false,
                      "description": "Linked from the Bucket.",
                      "defaultValue": "${{Nakatomi Files.ACCESS_KEY_ID}}"
                    },
                    "S3_SECRET_KEY": {
                      "isOptional": false,
                      "description": "Linked, sensitive.",
                      "defaultValue": "${{Nakatomi Files.SECRET_ACCESS_KEY}}"
                    },
                    "GBRAIN_MCP_URL": {
                      "isOptional": true,
                      "description": "GBrain remote MCP endpoint URL (an ngrok tunnel ending in /mcp).",
                      "defaultValue": ""
                    },
                    "S3_ENDPOINT_URL": {
                      "isOptional": false,
                      "description": "Linked",
                      "defaultValue": "${{Nakatomi Files.ENDPOINT}}"
                    },
                    "STORAGE_BACKEND": {
                      "isOptional": false,
                      "description": "Where uploaded files go: local (uses the mounted volume) or s3.",
                      "defaultValue": "s3"
                    },
                    "DASHBOARD_ENABLED": {
                      "isOptional": false,
                      "description": "Exposes the audit UI at /dashboard. Leave false unless you add your own auth in front.",
                      "defaultValue": "false"
                    },
                    "DOCDEPLOY_API_KEY": {
                      "isOptional": true,
                      "description": "Bearer key for DocDeploy. Only needed if docdeploy is in MEMORY_CONNECTORS.",
                      "defaultValue": ""
                    },
                    "MEMORY_CONNECTORS": {
                      "isOptional": true,
                      "description": "Comma-separated memory connectors to enable: docdeploy, supermemory, gbrain. Leave blank to disable.",
                      "defaultValue": ""
                    },
                    "JWT_EXPIRE_MINUTES": {
                      "isOptional": false,
                      "description": "How long user login tokens stay valid. Default 60.",
                      "defaultValue": "60"
                    },
                    "STORAGE_LOCAL_PATH": {
                      "isOptional": false,
                      "description": "Where local-backend files are written. Must be inside the mounted /app/data volume.",
                      "defaultValue": "/app/data/files"
                    },
                    "SUPERMEMORY_API_KEY": {
                      "isOptional": true,
                      "description": "Bearer key for Supermemory. Only needed if supermemory is in MEMORY_CONNECTORS",
                      "defaultValue": ""
                    },
                    "WEBHOOK_MAX_RETRIES": {
                      "isOptional": false,
                      "description": "Retries per failed webhook delivery before giving up.",
                      "defaultValue": "3"
                    },
                    "WEBHOOK_WORKER_ENABLED": {
                      "isOptional": false,
                      "description": "Background worker that delivers webhooks. Keep true.",
                      "defaultValue": "true"
                    },
                    "WEBHOOK_TIMEOUT_SECONDS": {
                      "isOptional": false,
                      "description": "Request timeout for each webhook POST.",
                      "defaultValue": "10"
                    },
                    "API_KEY_RATE_LIMIT_PER_MINUTE": {
                      "isOptional": false,
                      "description": "Max requests per API key per minute. Default 120.",
                      "defaultValue": "120"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-20T16:14:49.616Z",
  "generator_version": "0.1.0",
  "status": "degraded",
  "validated_at": "2026-09-20T14:01:38.436Z",
  "success_rate_30d": 0,
  "validation": {
    "last_run_id": "run_d842a04c23fa44118101",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": false,
        "detail": "Your workspace has been restricted. Please contact support to resolve this."
      }
    ]
  }
}
