{
  "manifest_version": "1.0.0",
  "template": {
    "id": "1d8b759d-5018-4b75-b33d-01a1727251ee",
    "slug": "papermark",
    "name": "Papermark",
    "description": "Papermark: Your #1 alternative to Docsend. Open Source.",
    "url": "https://railway.com/deploy/papermark",
    "upstream": {
      "repo_url": "https://github.com/atoolz/railway-papermark"
    }
  },
  "status": "unvalidated",
  "validated_at": null,
  "success_rate_30d": null,
  "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": "web",
      "source": {
        "repo": "https://github.com/atoolz/railway-papermark"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "data directory (volume mount path); often set by the image",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "private hostname on Railway's internal network for other services in the project",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "leave empty for default 5432, or set an explicit port",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "DB role; keep aligned with POSTGRES_USER",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "database name",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "password for PGUSER",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "logical database/schema name created on first init",
      "secret": false,
      "strategy": "default",
      "default": "papermark"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "in-cluster connection string; web service uses ${{Postgres.DATABASE_URL}} as POSTGRES_PRISMA_URL",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "superuser name on first init",
      "secret": false,
      "strategy": "default",
      "default": "papermark"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "optional TLS cert lifetime if you generate certs",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "generated root password; never commit real values to git",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "postgresql:// via Railway TCP proxy for clients outside the private network",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "drain window during deploys",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "PORT",
      "service": "web",
      "description": "HTTP port the Next.js server listens on",
      "secret": false,
      "strategy": "default",
      "default": "3000"
    },
    {
      "key": "NEXTAUTH_URL",
      "service": "web",
      "description": "canonical app URL used by NextAuth for callbacks",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "QSTASH_TOKEN",
      "service": "web",
      "description": "Upstash QStash token for background jobs and queues (https://upstash.com)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "HANKO_API_KEY",
      "service": "web",
      "description": "Hanko Passkey API key; required for passkey login (https://docs.hanko.io)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "RESEND_API_KEY",
      "service": "web",
      "description": "Resend API key for magic-link and notification emails (https://resend.com)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "TINYBIRD_TOKEN",
      "service": "web",
      "description": "Tinybird token for analytics event ingestion (optional)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXTAUTH_SECRET",
      "service": "web",
      "description": "session signing key; generated at provision",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "GOOGLE_CLIENT_ID",
      "service": "web",
      "description": "Google OAuth client ID for social login",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "TRIGGER_SECRET_KEY",
      "service": "web",
      "description": "Trigger.dev secret key for background task orchestration (optional)",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "POSTGRES_PRISMA_URL",
      "service": "web",
      "description": "pooled Postgres connection string for Prisma queries",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "GOOGLE_CLIENT_SECRET",
      "service": "web",
      "description": "Google OAuth client secret paired with the client ID above",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PUBLIC_BASE_URL",
      "service": "web",
      "description": "public-facing base URL for links, OG images, and redirects",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "BLOB_READ_WRITE_TOKEN",
      "service": "web",
      "description": "Vercel Blob read/write token; only needed if UPLOAD_TRANSPORT=vercel",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "UPSTASH_REDIS_REST_URL",
      "service": "web",
      "description": "Upstash Redis REST endpoint for rate limiting (https://console.upstash.com)",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "QSTASH_NEXT_SIGNING_KEY",
      "service": "web",
      "description": "next (rotated) QStash signing key; used during key rotation",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "UPSTASH_REDIS_REST_TOKEN",
      "service": "web",
      "description": "Upstash Redis REST token paired with the URL above",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PUBLIC_APP_BASE_HOST",
      "service": "web",
      "description": "bare hostname (no protocol); used by middleware to distinguish app vs custom domains",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "NEXT_PUBLIC_MARKETING_URL",
      "service": "web",
      "description": "marketing site URL; same as base URL in self-hosted setups",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_BUCKET",
      "service": "web",
      "description": "S3 bucket name for document storage",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_REGION",
      "service": "web",
      "description": "S3 bucket region",
      "secret": false,
      "strategy": "default",
      "default": "us-east-1"
    },
    {
      "key": "QSTASH_CURRENT_SIGNING_KEY",
      "service": "web",
      "description": "current QStash webhook signature key for request verification",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PUBLIC_HANKO_TENANT_ID",
      "service": "web",
      "description": "Hanko tenant ID paired with the API key above",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_ENDPOINT",
      "service": "web",
      "description": "S3-compatible endpoint URL; leave empty for AWS S3",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "NEXT_PUBLIC_UPLOAD_TRANSPORT",
      "service": "web",
      "description": "storage backend: \"vercel\" (Vercel Blob) or \"s3\" (any S3-compatible)",
      "secret": false,
      "strategy": "default",
      "default": "s3"
    },
    {
      "key": "UPSTASH_REDIS_REST_LOCKER_URL",
      "service": "web",
      "description": "Upstash Redis REST endpoint for tus.io bulk-upload locking",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "POSTGRES_PRISMA_URL_NON_POOLING",
      "service": "web",
      "description": "direct (non-pooled) Postgres connection for migrations",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "UPSTASH_REDIS_REST_LOCKER_TOKEN",
      "service": "web",
      "description": "Upstash Redis REST token for the locker instance",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PRIVATE_VERIFICATION_SECRET",
      "service": "web",
      "description": "HMAC secret for verification link checksums",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID",
      "service": "web",
      "description": "S3 access key ID",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "NEXT_PRIVATE_DOCUMENT_PASSWORD_KEY",
      "service": "web",
      "description": "encryption key for document password protection",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_DISTRIBUTION_HOST",
      "service": "web",
      "description": "CDN hostname (CloudFront, S3, or Blob) used in next.config.mjs image remotes",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY",
      "service": "web",
      "description": "S3 secret access key",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "papermark"
      }
    },
    "cli": "railway deploy --template papermark",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "1d8b759d-5018-4b75-b33d-01a1727251ee",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "31edba09-ae52-4768-80a2-afa7bb05c22d": {
                  "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 (volume mount path); often set by the image",
                      "defaultValue": "{{PGDATA}}"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "private hostname on Railway's internal network for other services in the project",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "leave empty for default 5432, or set an explicit port",
                      "defaultValue": "{{PGPORT}}"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "DB role; keep aligned with POSTGRES_USER",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "database name",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "password for PGUSER",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "logical database/schema name created on first init",
                      "defaultValue": "papermark"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "in-cluster connection string; web service uses ${{Postgres.DATABASE_URL}} as POSTGRES_PRISMA_URL",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "superuser name on first init",
                      "defaultValue": "papermark"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "optional TLS cert lifetime if you generate certs",
                      "defaultValue": "{{SSL_CERT_DAYS}}"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "generated root password; never commit real values to git",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "postgresql:// via Railway TCP proxy for clients outside the private network",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "drain window during deploys",
                      "defaultValue": "{{RAILWAY_DEPLOYMENT_DRAINING_SECONDS}}"
                    }
                  },
                  "volumeMounts": {
                    "31edba09-ae52-4768-80a2-afa7bb05c22d": {
                      "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."
                  }
                },
                "a2970505-cc71-4333-adbf-989fc77620a9": {
                  "icon": "https://raw.githubusercontent.com/atoolz/railway-papermark/main/assets/icon.svg",
                  "name": "web",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/atoolz/railway-papermark",
                    "rootDirectory": null
                  },
                  "variables": {
                    "PORT": {
                      "isOptional": false,
                      "description": "HTTP port the Next.js server listens on",
                      "defaultValue": "3000"
                    },
                    "NEXTAUTH_URL": {
                      "isOptional": false,
                      "description": "canonical app URL used by NextAuth for callbacks",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "QSTASH_TOKEN": {
                      "isOptional": false,
                      "description": "Upstash QStash token for background jobs and queues (https://upstash.com)",
                      "defaultValue": "{{QSTASH_TOKEN}}"
                    },
                    "HANKO_API_KEY": {
                      "isOptional": false,
                      "description": "Hanko Passkey API key; required for passkey login (https://docs.hanko.io)",
                      "defaultValue": "{{HANKO_API_KEY}}"
                    },
                    "RESEND_API_KEY": {
                      "description": "Resend API key for magic-link and notification emails (https://resend.com)",
                      "defaultValue": "{{RESEND_API_KEY}}"
                    },
                    "TINYBIRD_TOKEN": {
                      "description": "Tinybird token for analytics event ingestion (optional)",
                      "defaultValue": "{{TINYBIRD_TOKEN}}"
                    },
                    "NEXTAUTH_SECRET": {
                      "isOptional": false,
                      "description": "session signing key; generated at provision",
                      "defaultValue": "{{NEXTAUTH_SECRET}}"
                    },
                    "GOOGLE_CLIENT_ID": {
                      "description": "Google OAuth client ID for social login",
                      "defaultValue": "{{GOOGLE_CLIENT_ID}}"
                    },
                    "TRIGGER_SECRET_KEY": {
                      "description": "Trigger.dev secret key for background task orchestration (optional)",
                      "defaultValue": "{{TRIGGER_SECRET_KEY}}"
                    },
                    "POSTGRES_PRISMA_URL": {
                      "isOptional": false,
                      "description": "pooled Postgres connection string for Prisma queries",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "GOOGLE_CLIENT_SECRET": {
                      "description": "Google OAuth client secret paired with the client ID above",
                      "defaultValue": "{{GOOGLE_CLIENT_SECRET}}"
                    },
                    "NEXT_PUBLIC_BASE_URL": {
                      "isOptional": false,
                      "description": "public-facing base URL for links, OG images, and redirects",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "BLOB_READ_WRITE_TOKEN": {
                      "description": "Vercel Blob read/write token; only needed if UPLOAD_TRANSPORT=vercel",
                      "defaultValue": "{{BLOB_READ_WRITE_TOKEN}}"
                    },
                    "UPSTASH_REDIS_REST_URL": {
                      "description": "Upstash Redis REST endpoint for rate limiting (https://console.upstash.com)",
                      "defaultValue": "{{UPSTASH_REDIS_REST_URL}}"
                    },
                    "QSTASH_NEXT_SIGNING_KEY": {
                      "isOptional": false,
                      "description": "next (rotated) QStash signing key; used during key rotation",
                      "defaultValue": "{{QSTASH_NEXT_SIGNING_KEY}}"
                    },
                    "UPSTASH_REDIS_REST_TOKEN": {
                      "description": "Upstash Redis REST token paired with the URL above",
                      "defaultValue": "{{UPSTASH_REDIS_REST_TOKEN}}"
                    },
                    "NEXT_PUBLIC_APP_BASE_HOST": {
                      "isOptional": false,
                      "description": "bare hostname (no protocol); used by middleware to distinguish app vs custom domains",
                      "defaultValue": "${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "NEXT_PUBLIC_MARKETING_URL": {
                      "description": "marketing site URL; same as base URL in self-hosted setups",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_BUCKET": {
                      "description": "S3 bucket name for document storage",
                      "defaultValue": "{{NEXT_PRIVATE_UPLOAD_BUCKET}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_REGION": {
                      "description": "S3 bucket region",
                      "defaultValue": "us-east-1"
                    },
                    "QSTASH_CURRENT_SIGNING_KEY": {
                      "isOptional": false,
                      "description": "current QStash webhook signature key for request verification",
                      "defaultValue": "{{QSTASH_CURRENT_SIGNING_KEY}}"
                    },
                    "NEXT_PUBLIC_HANKO_TENANT_ID": {
                      "isOptional": false,
                      "description": "Hanko tenant ID paired with the API key above",
                      "defaultValue": "{{NEXT_PUBLIC_HANKO_TENANT_ID}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_ENDPOINT": {
                      "description": "S3-compatible endpoint URL; leave empty for AWS S3",
                      "defaultValue": "{{NEXT_PRIVATE_UPLOAD_ENDPOINT}}"
                    },
                    "NEXT_PUBLIC_UPLOAD_TRANSPORT": {
                      "isOptional": false,
                      "description": "storage backend: \"vercel\" (Vercel Blob) or \"s3\" (any S3-compatible)",
                      "defaultValue": "s3"
                    },
                    "UPSTASH_REDIS_REST_LOCKER_URL": {
                      "description": "Upstash Redis REST endpoint for tus.io bulk-upload locking",
                      "defaultValue": "{{UPSTASH_REDIS_REST_LOCKER_URL}}"
                    },
                    "POSTGRES_PRISMA_URL_NON_POOLING": {
                      "isOptional": false,
                      "description": "direct (non-pooled) Postgres connection for migrations",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "UPSTASH_REDIS_REST_LOCKER_TOKEN": {
                      "description": "Upstash Redis REST token for the locker instance",
                      "defaultValue": "{{UPSTASH_REDIS_REST_LOCKER_TOKEN}}"
                    },
                    "NEXT_PRIVATE_VERIFICATION_SECRET": {
                      "description": "HMAC secret for verification link checksums",
                      "defaultValue": "{{NEXT_PRIVATE_VERIFICATION_SECRET}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID": {
                      "description": "S3 access key ID",
                      "defaultValue": "{{NEXT_PRIVATE_UPLOAD_ACCESS_KEY_ID}}"
                    },
                    "NEXT_PRIVATE_DOCUMENT_PASSWORD_KEY": {
                      "isOptional": false,
                      "description": "encryption key for document password protection",
                      "defaultValue": "{{NEXT_PRIVATE_DOCUMENT_PASSWORD_KEY}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_DISTRIBUTION_HOST": {
                      "description": "CDN hostname (CloudFront, S3, or Blob) used in next.config.mjs image remotes",
                      "defaultValue": "{{NEXT_PRIVATE_UPLOAD_DISTRIBUTION_HOST}}"
                    },
                    "NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY": {
                      "description": "S3 secret access key",
                      "defaultValue": "{{NEXT_PRIVATE_UPLOAD_SECRET_ACCESS_KEY}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {},
  "resources": {
    "expected_services": 2,
    "needs_volume": true
  },
  "generated_at": "2026-09-21T04:14:46.774Z",
  "generator_version": "0.1.0"
}
