{
  "manifest_version": "1.0.0",
  "template": {
    "id": "56b595ff-9c1e-459c-9d98-5c03eb98227c",
    "slug": "affine-workspace",
    "name": "AFFiNE — Self-Hosted Notion & Miro Alternative",
    "description": "Self-host AFFiNE — docs, whiteboards & databases in one canvas",
    "url": "https://railway.com/deploy/affine-workspace",
    "upstream": {
      "image": "ghcr.io/toeverything/affine"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "services": [
    {
      "name": "pgvector",
      "source": {
        "image": "pgvector/pgvector:pg18"
      },
      "needs_volume": true,
      "volume_mount_path": "/var/lib/postgresql",
      "http": false
    },
    {
      "name": "Redis",
      "source": {
        "image": "redis:8.2"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Affine",
      "source": {
        "image": "ghcr.io/toeverything/affine"
      },
      "needs_volume": true,
      "volume_mount_path": "/root/.affine",
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "pgvector",
      "description": "PGDATA",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data/pgdata"
    },
    {
      "key": "PGHOST",
      "service": "pgvector",
      "description": "Public Host",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPORT",
      "service": "pgvector",
      "description": "Public port exposed for Postgres connections.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGUSER",
      "service": "pgvector",
      "description": "Username for PostgreSQL authentication.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "pgvector",
      "description": "Default Postgres database name.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "pgvector",
      "description": "Password for the Postgres user.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "pgvector",
      "description": "Name of the database created on startup.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "pgvector",
      "description": "Full public connection string for Postgres.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_USER",
      "service": "pgvector",
      "description": "Postgres superuser name.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "pgvector",
      "description": "Validity period for generated SSL certificates.",
      "secret": false,
      "strategy": "default",
      "default": "820"
    },
    {
      "key": "PGHOST_PRIVATE",
      "service": "pgvector",
      "description": "PGHOST_PRIVATE",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT_PRIVATE",
      "service": "pgvector",
      "description": "Private internal port for Postgres.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "pgvector",
      "description": "Password for the Postgres superuser.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_URL_PRIVATE",
      "service": "pgvector",
      "description": "Full private connection string for internal services.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "pgvector",
      "description": "Time to wait before shutting down old deployments.",
      "secret": false,
      "strategy": "default",
      "default": "60"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Host",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "Port",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "User",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Connection string for connecting to redis using the private network",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Password",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "PORT",
      "service": "Affine",
      "description": "HTTP port Railway routes traffic to",
      "secret": false,
      "strategy": "default",
      "default": "3010"
    },
    {
      "key": "NODE_ENV",
      "service": "Affine",
      "description": "Node.js runtime mode",
      "secret": false,
      "strategy": "default",
      "default": "production"
    },
    {
      "key": "DATABASE_URL",
      "service": "Affine",
      "description": "Postgres connection string",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDIS_SERVER_HOST",
      "service": "Affine",
      "description": "Redis private hostname",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDIS_SERVER_PORT",
      "service": "Affine",
      "description": "Redis port",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDIS_SERVER_USER",
      "service": "Affine",
      "description": "Redis AUTH username",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AFFINE_ADMIN_EMAIL",
      "service": "Affine",
      "description": "Create Bootstrap admin email",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "AFFINE_CONFIG_PATH",
      "service": "Affine",
      "description": "Config directory inside volume",
      "secret": false,
      "strategy": "default",
      "default": "/root/.affine/config"
    },
    {
      "key": "AFFINE_SERVER_HOST",
      "service": "Affine",
      "description": "Bind to all interfaces inside container",
      "secret": false,
      "strategy": "default",
      "default": "0.0.0.0"
    },
    {
      "key": "AFFINE_SERVER_PORT",
      "service": "Affine",
      "description": "Internal listener port",
      "secret": false,
      "strategy": "default",
      "default": "3010"
    },
    {
      "key": "AFFINE_SERVER_HTTPS",
      "service": "Affine",
      "description": "Railway edge terminates TLS",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "AFFINE_ADMIN_PASSWORD",
      "service": "Affine",
      "description": "Create Admin password (alteast 1 uppercase + 2 digits + 2 specials)",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_SERVER_PASSWORD",
      "service": "Affine",
      "description": "Redis AUTH password",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "AFFINE_INDEXER_ENABLED",
      "service": "Affine",
      "description": "Disable search indexer (needs Manticore/ES)",
      "secret": false,
      "strategy": "default",
      "default": "false"
    },
    {
      "key": "AFFINE_SERVER_EXTERNAL_URL",
      "service": "Affine",
      "description": "Public-facing app URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "affine-workspace"
      }
    },
    "cli": "railway deploy --template affine-workspace",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "56b595ff-9c1e-459c-9d98-5c03eb98227c",
            "serializedConfig": {
              "services": {
                "15bf6a4d-7db4-4283-ba0d-7cde1c1c64bf": {
                  "icon": "https://devicons.railway.app/postgres",
                  "name": "pgvector",
                  "source": {
                    "image": "pgvector/pgvector:pg18"
                  },
                  "variables": {
                    "PGDATA": {
                      "isOptional": false,
                      "description": "PGDATA",
                      "defaultValue": "/var/lib/postgresql/data/pgdata"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "Public Host",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "Public port exposed for Postgres connections.",
                      "defaultValue": "${{RAILWAY_TCP_PROXY_PORT}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "Username for PostgreSQL authentication.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "Default Postgres database name.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "Password for the Postgres user.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "Name of the database created on startup.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Full public connection string for Postgres.",
                      "defaultValue": "postgres://${{PGUSER}}:${{PGPASSWORD}}@${{PGHOST}}:${{PGPORT}}/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Postgres superuser name.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Validity period for generated SSL certificates.",
                      "defaultValue": "820"
                    },
                    "PGHOST_PRIVATE": {
                      "isOptional": false,
                      "description": "PGHOST_PRIVATE",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT_PRIVATE": {
                      "isOptional": false,
                      "description": "Private internal port for Postgres.",
                      "defaultValue": "5432"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the Postgres superuser.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_URL_PRIVATE": {
                      "isOptional": false,
                      "description": "Full private connection string for internal services.",
                      "defaultValue": "postgres://${{PGUSER}}:${{PGPASSWORD}}@${{PGHOST_PRIVATE}}:${{PGPORT_PRIVATE}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Time to wait before shutting down old deployments.",
                      "defaultValue": "60"
                    }
                  },
                  "volumeMounts": {
                    "15bf6a4d-7db4-4283-ba0d-7cde1c1c64bf": {
                      "mountPath": "/var/lib/postgresql"
                    }
                  }
                },
                "44bc1162-4d2f-4ad9-ae3e-53c6b016a0ee": {
                  "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\""
                  },
                  "source": {
                    "image": "redis:8.2"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Host",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "Port",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "User",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Connection string for connecting to redis using the private network",
                      "defaultValue": "redis://${{ REDISUSER }}:${{ REDIS_PASSWORD }}@${{ REDISHOST }}:${{ REDISPORT }}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Password",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Password",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    }
                  },
                  "volumeMounts": {
                    "44bc1162-4d2f-4ad9-ae3e-53c6b016a0ee": {
                      "mountPath": "/data"
                    }
                  },
                  "haTemplateCode": "redis-ha",
                  "haConversionConfig": {
                    "edge": {
                      "label": "Reverse Proxies",
                      "options": [
                        1,
                        2
                      ],
                      "nodeLabel": "HAProxy",
                      "description": "HAProxy instances routing writes to the primary",
                      "defaultValue": 2
                    },
                    "replica": {
                      "label": "Redis Replicas",
                      "options": [
                        2,
                        3,
                        4,
                        5
                      ],
                      "nodeLabel": "Redis",
                      "description": "Nodes running Redis + colocated Sentinel",
                      "defaultValue": 2
                    },
                    "description": "This will convert your Redis instance to an HA cluster with Sentinel failover and HAProxy routing to the primary."
                  }
                },
                "b3053e91-8922-4a03-92e5-67f361136bc8": {
                  "icon": "https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/affine-light.svg",
                  "name": "Affine",
                  "source": {
                    "image": "ghcr.io/toeverything/affine"
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port Railway routes traffic to",
                      "defaultValue": "3010"
                    },
                    "NODE_ENV": {
                      "isOptional": false,
                      "description": "Node.js runtime mode",
                      "defaultValue": "production"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "Postgres connection string",
                      "defaultValue": "postgresql://${{pgvector.POSTGRES_USER}}:${{pgvector.POSTGRES_PASSWORD}}@${{pgvector.RAILWAY_PRIVATE_DOMAIN}}:5432/${{pgvector.POSTGRES_DB}}"
                    },
                    "REDIS_SERVER_HOST": {
                      "isOptional": false,
                      "description": "Redis private hostname",
                      "defaultValue": "${{Redis.RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDIS_SERVER_PORT": {
                      "isOptional": false,
                      "description": "Redis port",
                      "defaultValue": "6379"
                    },
                    "REDIS_SERVER_USER": {
                      "isOptional": false,
                      "description": "Redis AUTH username",
                      "defaultValue": "${{Redis.REDISUSER}}"
                    },
                    "AFFINE_ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "Create Bootstrap admin email",
                      "defaultValue": "{{AFFINE_ADMIN_EMAIL}}"
                    },
                    "AFFINE_CONFIG_PATH": {
                      "isOptional": false,
                      "description": "Config directory inside volume",
                      "defaultValue": "/root/.affine/config"
                    },
                    "AFFINE_SERVER_HOST": {
                      "isOptional": false,
                      "description": "Bind to all interfaces inside container",
                      "defaultValue": "0.0.0.0"
                    },
                    "AFFINE_SERVER_PORT": {
                      "isOptional": false,
                      "description": "Internal listener port",
                      "defaultValue": "3010"
                    },
                    "AFFINE_SERVER_HTTPS": {
                      "isOptional": false,
                      "description": "Railway edge terminates TLS",
                      "defaultValue": "false"
                    },
                    "AFFINE_ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "Create Admin password (alteast 1 uppercase + 2 digits + 2 specials)",
                      "defaultValue": "{{AFFINE_ADMIN_PASSWORD}}"
                    },
                    "REDIS_SERVER_PASSWORD": {
                      "isOptional": false,
                      "description": "Redis AUTH password",
                      "defaultValue": "${{Redis.REDIS_PASSWORD}}"
                    },
                    "AFFINE_INDEXER_ENABLED": {
                      "isOptional": false,
                      "description": "Disable search indexer (needs Manticore/ES)",
                      "defaultValue": "false"
                    },
                    "AFFINE_SERVER_EXTERNAL_URL": {
                      "isOptional": false,
                      "description": "Public-facing app URL",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>:3010": {
                        "port": 3010
                      }
                    }
                  },
                  "volumeMounts": {
                    "b3053e91-8922-4a03-92e5-67f361136bc8": {
                      "mountPath": "/root/.affine"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 3,
    "needs_volume": true
  },
  "generated_at": "2026-09-07T11:54:15.772Z",
  "generator_version": "0.1.0"
}
