{
  "manifest_version": "1.0.0",
  "template": {
    "id": "c7154669-6161-4d39-908c-a49b44c563d2",
    "slug": "typesense-search",
    "name": "Typesense",
    "description": "Search engine that powers fast, typo-tolerant search boxes",
    "url": "https://railway.com/deploy/typesense-search",
    "upstream": {
      "image": "typesense/typesense:30.2"
    }
  },
  "services": [
    {
      "name": "typesense",
      "source": {
        "image": "typesense/typesense:30.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": true
    },
    {
      "name": "typesense-dashboard",
      "source": {
        "image": "ghcr.io/bfritscher/typesense-dashboard:latest"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PORT",
      "service": "typesense",
      "description": "Port Railway health-checks",
      "secret": false,
      "strategy": "default",
      "default": "8108"
    },
    {
      "key": "TYPESENSE_API_KEY",
      "service": "typesense",
      "description": "Bootstrap admin API key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "TYPESENSE_API_PORT",
      "service": "typesense",
      "description": "Search API listening port",
      "secret": false,
      "strategy": "default",
      "default": "8108"
    },
    {
      "key": "TYPESENSE_DATA_DIR",
      "service": "typesense",
      "description": "Index location on the volume",
      "secret": false,
      "strategy": "default",
      "default": "/data"
    },
    {
      "key": "TYPESENSE_ENABLE_CORS",
      "service": "typesense",
      "description": "Allow browser clients",
      "secret": false,
      "strategy": "default",
      "default": "true"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "typesense",
      "description": "Clean shutdown window",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "PORT",
      "service": "typesense-dashboard",
      "description": "Static file server port",
      "secret": false,
      "strategy": "default",
      "default": "8080"
    },
    {
      "key": "TYPESENSE_HOST",
      "service": "typesense-dashboard",
      "description": "Search server the UI targets",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "typesense-search"
      }
    },
    "cli": "railway deploy --template typesense-search",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "c7154669-6161-4d39-908c-a49b44c563d2",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "3a2b83f3-db13-460c-b852-1a710ae3445c": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/typesense.svg",
                  "name": "typesense",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'C=4; if [ -r /sys/fs/cgroup/cpu.max ]; then read Q P < /sys/fs/cgroup/cpu.max; if [ \"$Q\" != \"max\" ] && [ -n \"$P\" ]; then C=$(( (Q + P - 1) / P )); fi; fi; if [ \"$C\" -lt 1 ]; then C=1; fi; if [ -z \"$TYPESENSE_THREAD_POOL_SIZE\" ]; then TYPESENSE_THREAD_POOL_SIZE=$((C * 8)); fi; if [ -z \"$TYPESENSE_NUM_COLLECTIONS_PARALLEL_LOAD\" ]; then TYPESENSE_NUM_COLLECTIONS_PARALLEL_LOAD=$((C * 4)); fi; export TYPESENSE_THREAD_POOL_SIZE TYPESENSE_NUM_COLLECTIONS_PARALLEL_LOAD; echo \"[railway] cgroup cpus=$C thread-pool=$TYPESENSE_THREAD_POOL_SIZE parallel-load=$TYPESENSE_NUM_COLLECTIONS_PARALLEL_LOAD\"; exec /opt/typesense-server'",
                    "healthcheckPath": "/health",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "typesense/typesense:30.2"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Port Railway health-checks",
                      "defaultValue": "8108"
                    },
                    "TYPESENSE_API_KEY": {
                      "isOptional": false,
                      "description": "Bootstrap admin API key",
                      "defaultValue": "{{TYPESENSE_API_KEY}}"
                    },
                    "TYPESENSE_API_PORT": {
                      "isOptional": false,
                      "description": "Search API listening port",
                      "defaultValue": "8108"
                    },
                    "TYPESENSE_DATA_DIR": {
                      "isOptional": false,
                      "description": "Index location on the volume",
                      "defaultValue": "/data"
                    },
                    "TYPESENSE_ENABLE_CORS": {
                      "isOptional": false,
                      "description": "Allow browser clients",
                      "defaultValue": "true"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Clean shutdown window",
                      "defaultValue": "30"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8108": {
                        "port": 8108
                      }
                    }
                  },
                  "volumeMounts": {
                    "3a2b83f3-db13-460c-b852-1a710ae3445c": {
                      "mountPath": "/data"
                    }
                  }
                },
                "b76ddcf3-601c-497c-b714-c5a87c2e54cd": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/typesense.svg",
                  "name": "typesense-dashboard",
                  "deploy": {
                    "startCommand": "/bin/sh -c 'printf \"{\\\"node\\\":{\\\"host\\\":\\\"%s\\\",\\\"port\\\":\\\"443\\\",\\\"protocol\\\":\\\"https\\\",\\\"path\\\":\\\"\\\",\\\"tls\\\":true}}\\n\" \"$TYPESENSE_HOST\" > /srv/config.json; if [ -n \"$TYPESENSE_HOST\" ]; then P=0; for f in /srv/assets/node-*.js; do if grep -q \"host:\\`localhost\\`,port:8108,protocol:\\`http\\`\" \"$f\" 2>/dev/null; then sed -i \"s|host:\\`localhost\\`,port:8108,protocol:\\`http\\`|host:\\`$TYPESENSE_HOST\\`,port:443,protocol:\\`https\\`|g\" \"$f\"; P=1; fi; done; if [ \"$P\" = 1 ]; then echo \"[railway] login form defaults patched to https://$TYPESENSE_HOST\"; else echo \"[railway] default node literal not found - enter host $TYPESENSE_HOST port 443 protocol https at the login screen\"; fi; fi; printf \"{\\n\\tservers {\\n\\t\\ttrusted_proxies static 100.64.0.0/10 fd00::/8\\n\\t}\\n}\\n:%s {\\n\\troot * /srv\\n\\tencode gzip\\n\\theader {\\n\\t\\tX-Frame-Options \\\"SAMEORIGIN\\\"\\n\\t\\tX-Content-Type-Options \\\"nosniff\\\"\\n\\t\\tReferrer-Policy \\\"strict-origin-when-cross-origin\\\"\\n\\t}\\n\\ttry_files {path} /index.html\\n\\tfile_server\\n}\\n\" \"${PORT:-8080}\" > /etc/caddy/Caddyfile; caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile; exec caddy run --config /etc/caddy/Caddyfile --adapter caddyfile'",
                    "healthcheckPath": "/",
                    "restartPolicyType": "ALWAYS",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "ghcr.io/bfritscher/typesense-dashboard:latest"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "Static file server port",
                      "defaultValue": "8080"
                    },
                    "TYPESENSE_HOST": {
                      "isOptional": false,
                      "description": "Search server the UI targets",
                      "defaultValue": "${{typesense.RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:8080": {
                        "port": 8080
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "typesense",
      "method": "GET",
      "path": "/health",
      "expect_status": 200
    }
  },
  "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-19T14:37:34.497Z",
  "success_rate_30d": 1,
  "validation": {
    "last_run_id": "run_d6507230940d491db7d4",
    "checks": [
      {
        "name": "workflow_completed",
        "passed": true
      },
      {
        "name": "all_services_deployed",
        "passed": true
      },
      {
        "name": "healthcheck",
        "passed": true
      },
      {
        "name": "stays_up",
        "passed": true
      }
    ],
    "typical_ready_seconds": 61,
    "typical_build_seconds": 0,
    "typical_start_seconds": 10,
    "slowest_service": "typesense"
  }
}
