{
  "manifest_version": "1.0.0",
  "template": {
    "id": "55c9c20f-ef55-41d8-adb4-5a5dc6228d52",
    "slug": "directus-nextjs-visual-editor",
    "name": "Directus + Nextjs Visual Editor",
    "description": "Directus CMS with Next.js for modern content management.",
    "url": "https://railway.com/deploy/directus-nextjs-visual-editor",
    "upstream": {
      "repo_url": "https://github.com/enamic-software/directus-nextjs"
    }
  },
  "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": "Redis",
      "source": {
        "image": "redis:8.2.1"
      },
      "needs_volume": true,
      "volume_mount_path": "/data",
      "http": false
    },
    {
      "name": "Nextjs",
      "source": {
        "repo": "https://github.com/enamic-software/directus-nextjs"
      },
      "needs_volume": false,
      "http": true
    },
    {
      "name": "Directus",
      "source": {
        "repo": "https://github.com/enamic-software/directus-nextjs"
      },
      "needs_volume": false,
      "http": true
    }
  ],
  "required_inputs": [
    {
      "key": "PGDATA",
      "service": "Postgres",
      "description": "The directory where PostgreSQL stores its data files.",
      "secret": false,
      "strategy": "default",
      "default": "/var/lib/postgresql/data"
    },
    {
      "key": "PGHOST",
      "service": "Postgres",
      "description": "The hostname of the PostgreSQL server.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "PGPORT",
      "service": "Postgres",
      "description": "The port number on which PostgreSQL listens.",
      "secret": false,
      "strategy": "default",
      "default": "5432"
    },
    {
      "key": "PGUSER",
      "service": "Postgres",
      "description": "The PostgreSQL username.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGDATABASE",
      "service": "Postgres",
      "description": "The name of the PostgreSQL database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "PGPASSWORD",
      "service": "Postgres",
      "description": "The password for the PostgreSQL user.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "POSTGRES_DB",
      "service": "Postgres",
      "description": "The name of the default PostgreSQL database.",
      "secret": false,
      "strategy": "default",
      "default": "railway"
    },
    {
      "key": "DATABASE_URL",
      "service": "Postgres",
      "description": "\t Primary PostgreSQL connection URL (credentials + host + port + database) for apps running on Railway’s private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "POSTGRES_USER",
      "service": "Postgres",
      "description": "Default PostgreSQL database superuser account name created for this instance.",
      "secret": false,
      "strategy": "default",
      "default": "postgres"
    },
    {
      "key": "SSL_CERT_DAYS",
      "service": "Postgres",
      "description": "Number of days the auto-generated TLS certificate for Postgres remains valid before renewal.",
      "secret": false,
      "strategy": "default",
      "default": "1825"
    },
    {
      "key": "POSTGRES_PASSWORD",
      "service": "Postgres",
      "description": "Password for the PostgreSQL superuser (POSTGRES_USER); treat as a secret.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DATABASE_PUBLIC_URL",
      "service": "Postgres",
      "description": "Primary PostgreSQL connection URL (credentials + host + port + database) for apps running on Railway’s private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "RAILWAY_DEPLOYMENT_DRAINING_SECONDS",
      "service": "Postgres",
      "description": "Grace period (seconds) Railway waits during deploys for existing DB connections to finish before cutting over.",
      "secret": false,
      "strategy": "default",
      "default": "30"
    },
    {
      "key": "REDISHOST",
      "service": "Redis",
      "description": "Hostname of the Redis instance on Railway’s private network.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_private_domain"
    },
    {
      "key": "REDISPORT",
      "service": "Redis",
      "description": "TCP port the Redis server listens on (often 6379).",
      "secret": false,
      "strategy": "default",
      "default": "6379"
    },
    {
      "key": "REDISUSER",
      "service": "Redis",
      "description": "Redis ACL username (if your Redis template enables ACLs); may be unused depending on image/plan.",
      "secret": false,
      "strategy": "default",
      "default": "default"
    },
    {
      "key": "REDIS_URL",
      "service": "Redis",
      "description": "Full Redis connection URL (scheme, host, port, auth) for private-network clients on Railway.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDISPASSWORD",
      "service": "Redis",
      "description": "Redis password used by clients that connect with host/port + password (non-URL form).",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "REDIS_PASSWORD",
      "service": "Redis",
      "description": "Same role as REDISPASSWORD: secret credential for Redis authentication; name varies by template.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "REDIS_PUBLIC_URL",
      "service": "Redis",
      "description": "Publicly routable Redis URL for external tools or local dev when a public endpoint is enabled.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PUBLIC_SITE_URL",
      "service": "Nextjs",
      "description": "Canonical public base URL of the Next.js site (scheme + host); exposed to the browser for links, redirects, and absolute URLs.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "DIRECTUS_SERVER_TOKEN",
      "service": "Nextjs",
      "description": "Static Directus access token used only on the server (SSR/API routes) for privileged reads/writes; never expose to the client.",
      "secret": true,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PUBLIC_DIRECTUS_URL",
      "service": "Nextjs",
      "description": "Public base URL of the Directus API as seen from the browser; used by client-side fetches and asset URLs.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "REDIS",
      "service": "Directus",
      "description": "Redis connection string or URL Directus uses for caching, rate limiting, or pub/sub (depends on your Directus config).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "SECRET",
      "service": "Directus",
      "description": "Signing secret for Directus sessions and JWTs; must be long and random; changing it invalidates existing tokens.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "PUBLIC_URL",
      "service": "Directus",
      "description": "Public base URL where Directus is reachable (used in emails, webhooks, OAuth callbacks, and absolute asset links).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "ADMIN_EMAIL",
      "service": "Directus",
      "description": "The email address for the Directus admin account.",
      "secret": false,
      "strategy": "ask_user"
    },
    {
      "key": "ADMIN_TOKEN",
      "service": "Directus",
      "description": "Static Directus admin (or high-privilege) access token used for automation, migrations, or server-side admin API calls; treat as a secret.",
      "secret": true,
      "strategy": "generate",
      "generate": "random_base64_32"
    },
    {
      "key": "CORS_ORIGIN",
      "service": "Directus",
      "description": "Comma-separated list of allowed browser origins for Directus CORS (e.g. your Next.js public URL and local dev URLs).",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "ADMIN_PASSWORD",
      "service": "Directus",
      "description": "The password for the Directus admin account.",
      "secret": true,
      "strategy": "generate",
      "generate": "strong_password"
    },
    {
      "key": "DB_CONNECTION_STRING",
      "service": "Directus",
      "description": "PostgreSQL connection string Directus uses for its metadata and content database.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "reference_variable"
    },
    {
      "key": "NEXT_PUBLIC_SITE_URL",
      "service": "Directus",
      "description": "Public base URL of the front-end site (often mirrored from the Next.js app) so Directus can generate correct absolute links in emails, redirects, or integrations.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_SRC",
      "service": "Directus",
      "description": "JSON/string of Content-Security-Policy directives merged into Directus responses; tighten or relax CSP for assets, APIs, and embeds.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    },
    {
      "key": "CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_ANCESTORS",
      "service": "Directus",
      "description": "Overrides one CSP directive (e.g. connect-src, img-src) for Directus; value is typically a space-separated source list.",
      "secret": false,
      "strategy": "railway_provided",
      "railway_source": "railway_domain"
    }
  ],
  "deploy": {
    "mcp": {
      "server": "railway",
      "tool": "deploy_template",
      "args": {
        "template_code": "directus-nextjs-visual-editor"
      }
    },
    "cli": "railway deploy --template directus-nextjs-visual-editor",
    "api": {
      "method": "POST",
      "path": "/graphql/v2",
      "body": {
        "query": "mutation templateDeploy($input: TemplateDeployV2Input!) { templateDeployV2(input: $input) { projectId workflowId } }",
        "variables": {
          "input": {
            "templateId": "55c9c20f-ef55-41d8-adb4-5a5dc6228d52",
            "serializedConfig": {
              "buckets": {},
              "services": {
                "44b450d9-8f54-4388-a16d-e017d4e14121": {
                  "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": "The directory where PostgreSQL stores its data files.",
                      "defaultValue": "/var/lib/postgresql/data"
                    },
                    "PGHOST": {
                      "isOptional": false,
                      "description": "The hostname of the PostgreSQL server.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "PGPORT": {
                      "isOptional": false,
                      "description": "The port number on which PostgreSQL listens.",
                      "defaultValue": "5432"
                    },
                    "PGUSER": {
                      "isOptional": false,
                      "description": "The PostgreSQL username.",
                      "defaultValue": "${{POSTGRES_USER}}"
                    },
                    "PGDATABASE": {
                      "isOptional": false,
                      "description": "The name of the PostgreSQL database.",
                      "defaultValue": "${{POSTGRES_DB}}"
                    },
                    "PGPASSWORD": {
                      "isOptional": false,
                      "description": "The password for the PostgreSQL user.",
                      "defaultValue": "${{POSTGRES_PASSWORD}}"
                    },
                    "POSTGRES_DB": {
                      "isOptional": false,
                      "description": "The name of the default PostgreSQL database.",
                      "defaultValue": "railway"
                    },
                    "DATABASE_URL": {
                      "isOptional": false,
                      "description": "\t Primary PostgreSQL connection URL (credentials + host + port + database) for apps running on Railway’s private network.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_PRIVATE_DOMAIN}}:5432/${{PGDATABASE}}"
                    },
                    "POSTGRES_USER": {
                      "isOptional": false,
                      "description": "Default PostgreSQL database superuser account name created for this instance.",
                      "defaultValue": "postgres"
                    },
                    "SSL_CERT_DAYS": {
                      "isOptional": false,
                      "description": "Number of days the auto-generated TLS certificate for Postgres remains valid before renewal.",
                      "defaultValue": "1825"
                    },
                    "POSTGRES_PASSWORD": {
                      "isOptional": false,
                      "description": "Password for the PostgreSQL superuser (POSTGRES_USER); treat as a secret.",
                      "defaultValue": "{{POSTGRES_PASSWORD}}"
                    },
                    "DATABASE_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Primary PostgreSQL connection URL (credentials + host + port + database) for apps running on Railway’s private network.",
                      "defaultValue": "postgresql://${{PGUSER}}:${{POSTGRES_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}/${{PGDATABASE}}"
                    },
                    "RAILWAY_DEPLOYMENT_DRAINING_SECONDS": {
                      "isOptional": false,
                      "description": "Grace period (seconds) Railway waits during deploys for existing DB connections to finish before cutting over.",
                      "defaultValue": "30"
                    }
                  },
                  "volumeMounts": {
                    "44b450d9-8f54-4388-a16d-e017d4e14121": {
                      "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."
                  }
                },
                "4c7a7172-951c-484b-9ee9-4149b72f908b": {
                  "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\"",
                    "healthcheckPath": null,
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "image": "redis:8.2.1"
                  },
                  "variables": {
                    "REDISHOST": {
                      "isOptional": false,
                      "description": "Hostname of the Redis instance on Railway’s private network.",
                      "defaultValue": "${{RAILWAY_PRIVATE_DOMAIN}}"
                    },
                    "REDISPORT": {
                      "isOptional": false,
                      "description": "TCP port the Redis server listens on (often 6379).",
                      "defaultValue": "6379"
                    },
                    "REDISUSER": {
                      "isOptional": false,
                      "description": "Redis ACL username (if your Redis template enables ACLs); may be unused depending on image/plan.",
                      "defaultValue": "default"
                    },
                    "REDIS_URL": {
                      "isOptional": false,
                      "description": "Full Redis connection URL (scheme, host, port, auth) for private-network clients on Railway.",
                      "defaultValue": "redis://${{REDISUSER}}:${{REDIS_PASSWORD}}@${{REDISHOST}}:${{REDISPORT}}"
                    },
                    "REDISPASSWORD": {
                      "isOptional": false,
                      "description": "Redis password used by clients that connect with host/port + password (non-URL form).",
                      "defaultValue": "${{REDIS_PASSWORD}}"
                    },
                    "REDIS_PASSWORD": {
                      "isOptional": false,
                      "description": "Same role as REDISPASSWORD: secret credential for Redis authentication; name varies by template.",
                      "defaultValue": "{{REDIS_PASSWORD}}"
                    },
                    "REDIS_PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Publicly routable Redis URL for external tools or local dev when a public endpoint is enabled.",
                      "defaultValue": "redis://default:${{REDIS_PASSWORD}}@${{RAILWAY_TCP_PROXY_DOMAIN}}:${{RAILWAY_TCP_PROXY_PORT}}"
                    }
                  },
                  "volumeMounts": {
                    "4c7a7172-951c-484b-9ee9-4149b72f908b": {
                      "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
                    },
                    "internal": null,
                    "description": "This will convert your Redis instance to an HA cluster with Sentinel failover and HAProxy routing to the primary."
                  }
                },
                "c6103a9c-47f9-47e7-af98-1f24c2124233": {
                  "icon": "https://devicons.railway.com/i/nextjs.svg",
                  "name": "Nextjs",
                  "deploy": {
                    "startCommand": null,
                    "healthcheckPath": "/",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/enamic-software/directus-nextjs",
                    "rootDirectory": "nextjs"
                  },
                  "variables": {
                    "NEXT_PUBLIC_SITE_URL": {
                      "isOptional": false,
                      "description": "Canonical public base URL of the Next.js site (scheme + host); exposed to the browser for links, redirects, and absolute URLs.",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "DIRECTUS_SERVER_TOKEN": {
                      "isOptional": false,
                      "description": "Static Directus access token used only on the server (SSR/API routes) for privileged reads/writes; never expose to the client.",
                      "defaultValue": "${{Directus.ADMIN_TOKEN}}"
                    },
                    "NEXT_PUBLIC_DIRECTUS_URL": {
                      "isOptional": false,
                      "description": "Public base URL of the Directus API as seen from the browser; used by client-side fetches and asset URLs.",
                      "defaultValue": "https://${{Directus.RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                },
                "c7608057-a560-4432-86c9-5736b6f484f9": {
                  "icon": "https://devicons.railway.com/i/directus.svg",
                  "name": "Directus",
                  "deploy": {
                    "startCommand": "",
                    "healthcheckPath": "/server/health",
                    "restartPolicyType": "ON_FAILURE",
                    "restartPolicyMaxRetries": 10
                  },
                  "source": {
                    "repo": "https://github.com/enamic-software/directus-nextjs",
                    "rootDirectory": "directus"
                  },
                  "variables": {
                    "REDIS": {
                      "isOptional": false,
                      "description": "Redis connection string or URL Directus uses for caching, rate limiting, or pub/sub (depends on your Directus config).",
                      "defaultValue": "${{Redis.REDIS_URL}}"
                    },
                    "SECRET": {
                      "isOptional": false,
                      "description": "Signing secret for Directus sessions and JWTs; must be long and random; changing it invalidates existing tokens.",
                      "defaultValue": "{{SECRET}}"
                    },
                    "PUBLIC_URL": {
                      "isOptional": false,
                      "description": "Public base URL where Directus is reachable (used in emails, webhooks, OAuth callbacks, and absolute asset links).",
                      "defaultValue": "https://${{RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "ADMIN_EMAIL": {
                      "isOptional": false,
                      "description": "The email address for the Directus admin account.",
                      "defaultValue": "{{ADMIN_EMAIL}}"
                    },
                    "ADMIN_TOKEN": {
                      "isOptional": false,
                      "description": "Static Directus admin (or high-privilege) access token used for automation, migrations, or server-side admin API calls; treat as a secret.",
                      "defaultValue": "{{ADMIN_TOKEN}}"
                    },
                    "CORS_ORIGIN": {
                      "isOptional": false,
                      "description": "Comma-separated list of allowed browser origins for Directus CORS (e.g. your Next.js public URL and local dev URLs).",
                      "defaultValue": "https://${{Nextjs.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "ADMIN_PASSWORD": {
                      "isOptional": false,
                      "description": "The password for the Directus admin account.",
                      "defaultValue": "{{ADMIN_PASSWORD}}"
                    },
                    "DB_CONNECTION_STRING": {
                      "isOptional": false,
                      "description": "PostgreSQL connection string Directus uses for its metadata and content database.",
                      "defaultValue": "${{Postgres.DATABASE_URL}}"
                    },
                    "NEXT_PUBLIC_SITE_URL": {
                      "isOptional": false,
                      "description": "Public base URL of the front-end site (often mirrored from the Next.js app) so Directus can generate correct absolute links in emails, redirects, or integrations.",
                      "defaultValue": "https://${{Nextjs.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_SRC": {
                      "isOptional": false,
                      "description": "JSON/string of Content-Security-Policy directives merged into Directus responses; tighten or relax CSP for assets, APIs, and embeds.",
                      "defaultValue": "https://${{Nextjs.RAILWAY_PUBLIC_DOMAIN}}"
                    },
                    "CONTENT_SECURITY_POLICY_DIRECTIVES__FRAME_ANCESTORS": {
                      "isOptional": false,
                      "description": "Overrides one CSP directive (e.g. connect-src, img-src) for Directus; value is typically a space-separated source list.",
                      "defaultValue": "https://${{Nextjs.RAILWAY_PUBLIC_DOMAIN}}"
                    }
                  },
                  "networking": {
                    "serviceDomains": {
                      "<hasDomain>": {}
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "post_deploy": {
    "healthcheck": {
      "service": "Nextjs",
      "method": "GET",
      "path": "/",
      "expect_status": 200
    }
  },
  "resources": {
    "expected_services": 4,
    "needs_volume": true
  },
  "generated_at": "2026-09-11T04:14:34.944Z",
  "generator_version": "0.1.0"
}
