{
  "generated_at": "2026-04-10T10:04:35.643Z",
  "system": {
    "id": "topolo-venue-survey",
    "name": "Topolo Venue Survey",
    "slug": "topolo-venue-survey",
    "kind": "application",
    "summary": "Internal venue-survey application with a worker API, asset storage, and a Cloudflare Pages web shell.",
    "aliases": [
      "venue-survey"
    ],
    "lifecycle": "active",
    "last_verified": "2026-04-07",
    "owners": [
      "platform-experience"
    ],
    "repo_paths": [
      "InternalApplications/topolo-venue-survey"
    ],
    "service_ids": [],
    "visibility": "internal",
    "api_contract": {
      "type": "curated",
      "source": "PlatformApplications/TopoloDocs/src/content/internal/apps/venue-survey.mdx"
    },
    "primary_hosts": [
      "https://survey.topolo.app",
      "https://topolo-venue-survey-api.topolo.workers.dev"
    ],
    "doc_paths": [
      "internal/apps/venue-survey"
    ],
    "dependencies": [
      "topolo-auth"
    ],
    "public_hub_url": null,
    "internal_hub_url": "/internal/systems/topolo-venue-survey",
    "application_api_url": "/reference/apps/topolo-venue-survey",
    "generated_openapi_url": null,
    "machine_urls": {
      "system": "/machine/systems/topolo-venue-survey.json",
      "application": "/machine/applications/topolo-venue-survey.json"
    }
  },
  "docs": {
    "public": [],
    "internal": [
      {
        "id": "apps/commerce.mdx",
        "title": "TopoloCommerce Handbook",
        "summary": "Internal handbook for the multi-vertical commerce workspace, its org-to-venue hierarchy, module resolution model, and the boundary between guest, staff, and platform-owned integrations.",
        "audience": "internal",
        "tags": [
          "commerce",
          "venues",
          "modules",
          "kiosk"
        ],
        "url": "/internal/apps/commerce.mdx",
        "last_verified": "2026-04-10"
      },
      {
        "id": "apps/venue-survey.mdx",
        "title": "Topolo Venue Survey Handbook",
        "summary": "Internal handbook for the venue-survey runtime, operator deployment surface, and Cloudflare-backed asset flow.",
        "audience": "internal",
        "tags": [
          "survey",
          "venues",
          "operations"
        ],
        "url": "/internal/apps/venue-survey.mdx",
        "last_verified": "2026-04-07"
      }
    ],
    "runbooks": [
      {
        "id": "runbooks/api-key-scope-mismatches.mdx",
        "title": "API Key Scope Mismatches",
        "summary": "Runbook for when TopoloOne or an app shows the wrong API key scopes, no scopes, or unexpected scope drift.",
        "url": "/internal/runbooks/api-key-scope-mismatches.mdx"
      },
      {
        "id": "runbooks/auth-session-and-role-drift.mdx",
        "title": "Auth Session and Role Drift",
        "summary": "Runbook for stale role claims, incorrect admin gating, and mismatches between live org roles and token claims.",
        "url": "/internal/runbooks/auth-session-and-role-drift.mdx"
      },
      {
        "id": "runbooks/cors-and-cross-origin-failures.mdx",
        "title": "CORS and Cross-Origin Failures",
        "summary": "Runbook for preflight failures, wrong API origins, and wildcard-origin credential issues.",
        "url": "/internal/runbooks/cors-and-cross-origin-failures.mdx"
      },
      {
        "id": "runbooks/stale-deploy-and-cache-issues.mdx",
        "title": "Stale Deploy and Cache Issues",
        "summary": "Runbook for old bundles, wrong host delivery, stale service workers, and mismatched Pages/worker routes.",
        "url": "/internal/runbooks/stale-deploy-and-cache-issues.mdx"
      },
      {
        "id": "runbooks/resource-binding-sync-failures.mdx",
        "title": "Resource Binding Sync Failures",
        "summary": "Runbook for missing bindable resources such as brands or workspaces in the API key form.",
        "url": "/internal/runbooks/resource-binding-sync-failures.mdx"
      }
    ]
  },
  "authority": {
    "owners": [
      "platform-experience"
    ],
    "repo_paths": [
      "InternalApplications/topolo-venue-survey"
    ],
    "service_ids": [],
    "dependencies": [
      "topolo-auth"
    ],
    "aliases": [
      "venue-survey"
    ]
  },
  "interfaces": {
    "contract_type": "curated",
    "contract_source": "PlatformApplications/TopoloDocs/src/content/internal/apps/venue-survey.mdx",
    "contract_source_exists": true,
    "openapi": null,
    "readme": {
      "path": "InternalApplications/topolo-venue-survey/README.md",
      "intro": [
        "Cloudflare-native intake app for on-site venue meetings.",
        "Auth/session helpers added for app usability:",
        "1. D1 DB created: `topolo-venue-survey` (`35a75c2d-8931-4b2c-be54-a022dee6f679`).\n2. R2 bucket created: `topolo-venue-survey-assets`.\n3. Migrations applied remotely: `0001_init.sql`, `0002_seed_sample.sql`.\n4. Worker runtime config:\n   - Vars: `APP_ORIGIN`, `MAGIC_LINK_BASE_URL`, `R2_ACCOUNT_ID`, `R2_BUCKET_NAME`\n   - Required secret: `JWT_SECRET`\n   - Optional secrets (for direct R2 signed URLs): `R2_ACCESS_KEY_ID`, `R2_SECRET_ACCESS_KEY`\n   - Optional secret: `TURNSTILE_SECRET`\n   - Note: if optional R2 secrets are missing, the API uses Worker-signed upload/download URLs as a fallback.\n5. Set web env using `apps/web/.env.example` (`VITE_API_BASE`)."
      ],
      "headings": [
        "Topolo Venue Survey",
        "Structure",
        "Implemented scope",
        "API endpoint map",
        "Cloudflare setup",
        "Provisioned deploys",
        "Custom Domain DNS",
        "Magic Link Email Delivery",
        "Decisions taken"
      ],
      "routeHighlights": [
        "`POST /api/surveys`",
        "`GET /api/surveys`",
        "`GET /api/surveys/{id}`",
        "`PUT /api/surveys/{id}`",
        "`POST /api/surveys/{id}/submit`",
        "`POST /api/surveys/{id}/assets/presign`",
        "`POST /api/surveys/{id}/assets/commit`",
        "`GET /api/surveys/{id}/export?format=html|markdown|whatsapp`",
        "`GET /api/assets/{assetId}`",
        "`POST /api/auth/magic/request`",
        "`POST /api/auth/magic/verify`",
        "`GET /api/auth/session`"
      ],
      "commandHighlights": [
        "Worker API: `https://topolo-venue-survey-api.topolo.workers.dev`",
        "Pages project: `topolo-venue-survey-web`",
        "Pages URL: `https://topolo-venue-survey-web.pages.dev`",
        "Custom domain requested: `survey.topolo.app` (currently pending; CNAME not set)"
      ]
    }
  },
  "auth": {
    "depends_on_topolo_auth": true,
    "api_key_scopes": [],
    "service_permissions": []
  },
  "runtime": {
    "primary_hosts": [
      "https://survey.topolo.app",
      "https://topolo-venue-survey-api.topolo.workers.dev"
    ],
    "repo_entries": [
      "InternalApplications/topolo-venue-survey/README.md",
      "InternalApplications/topolo-venue-survey/apps/",
      "InternalApplications/topolo-venue-survey/package-lock.json",
      "InternalApplications/topolo-venue-survey/package.json",
      "InternalApplications/topolo-venue-survey/packages/",
      "InternalApplications/topolo-venue-survey/topolo.cloudcontrol.json"
    ],
    "wrangler_surfaces": [
      {
        "path": "InternalApplications/topolo-venue-survey/apps/api/wrangler.toml",
        "observabilityEnabled": false,
        "environments": [],
        "routes": [],
        "vars": [
          "ADMIN_EMAILS",
          "ALLOWED_EMAIL_DOMAINS",
          "APP_ORIGIN",
          "MAGIC_FROM_EMAIL",
          "MAGIC_LINK_BASE_URL",
          "R2_ACCOUNT_ID",
          "R2_BUCKET_NAME"
        ],
        "bindings": [
          {
            "kind": "d1",
            "binding": "DB",
            "sourcePath": "InternalApplications/topolo-venue-survey/apps/api/wrangler.toml",
            "target": "35a75c2d-8931-4b2c-be54-a022dee6f679"
          },
          {
            "kind": "r2",
            "binding": "ASSETS",
            "sourcePath": "InternalApplications/topolo-venue-survey/apps/api/wrangler.toml",
            "target": "topolo-venue-survey-assets"
          }
        ],
        "cronTriggers": [],
        "workerName": "topolo-venue-survey-api",
        "main": "src/index.ts",
        "compatibilityDate": "2026-02-22"
      },
      {
        "path": "InternalApplications/topolo-venue-survey/apps/web/wrangler.toml",
        "observabilityEnabled": false,
        "environments": [],
        "routes": [],
        "vars": [],
        "bindings": [],
        "cronTriggers": [],
        "workerName": "topolo-venue-survey-web",
        "compatibilityDate": "2026-02-22"
      }
    ],
    "packages": [
      {
        "path": "InternalApplications/topolo-venue-survey/apps/api/package.json",
        "name": "@topolo/api",
        "scripts": [
          "build",
          "typecheck",
          "dev",
          "deploy",
          "deploy:dry-run",
          "cf-typegen"
        ],
        "scriptCommands": [
          {
            "name": "build",
            "command": "tsc -p tsconfig.json"
          },
          {
            "name": "typecheck",
            "command": "tsc -p tsconfig.json --noEmit"
          },
          {
            "name": "dev",
            "command": "wrangler dev"
          },
          {
            "name": "deploy",
            "command": "wrangler deploy"
          },
          {
            "name": "deploy:dry-run",
            "command": "wrangler deploy --dry-run --outdir .wrangler/build"
          },
          {
            "name": "cf-typegen",
            "command": "wrangler types"
          }
        ]
      },
      {
        "path": "InternalApplications/topolo-venue-survey/apps/web/package.json",
        "name": "@topolo/web",
        "scripts": [
          "dev",
          "build",
          "preview",
          "typecheck"
        ],
        "scriptCommands": [
          {
            "name": "dev",
            "command": "vite"
          },
          {
            "name": "build",
            "command": "tsc -p tsconfig.json && vite build"
          },
          {
            "name": "preview",
            "command": "vite preview"
          },
          {
            "name": "typecheck",
            "command": "tsc -p tsconfig.json --noEmit"
          }
        ]
      },
      {
        "path": "InternalApplications/topolo-venue-survey/package.json",
        "name": "topolo-venue-survey",
        "scripts": [
          "build",
          "typecheck"
        ],
        "scriptCommands": [
          {
            "name": "build",
            "command": "npm run build -w @topolo/shared && npm run build -w @topolo/api && npm run build -w @topolo/web"
          },
          {
            "name": "typecheck",
            "command": "npm run build -w @topolo/shared && npm run typecheck -w @topolo/api && npm run typecheck -w @topolo/web"
          }
        ]
      },
      {
        "path": "InternalApplications/topolo-venue-survey/packages/shared/package.json",
        "name": "@topolo/shared",
        "scripts": [
          "build",
          "typecheck"
        ],
        "scriptCommands": [
          {
            "name": "build",
            "command": "tsc -p tsconfig.json"
          },
          {
            "name": "typecheck",
            "command": "tsc -p tsconfig.json --noEmit"
          }
        ]
      }
    ]
  },
  "data": {
    "env_vars": [
      "ADMIN_EMAILS",
      "ALLOWED_EMAIL_DOMAINS",
      "APP_ORIGIN",
      "MAGIC_FROM_EMAIL",
      "MAGIC_LINK_BASE_URL",
      "R2_ACCOUNT_ID",
      "R2_BUCKET_NAME"
    ],
    "bindings": [
      {
        "kind": "d1",
        "binding": "DB",
        "sourcePath": "InternalApplications/topolo-venue-survey/apps/api/wrangler.toml",
        "target": "35a75c2d-8931-4b2c-be54-a022dee6f679"
      },
      {
        "kind": "r2",
        "binding": "ASSETS",
        "sourcePath": "InternalApplications/topolo-venue-survey/apps/api/wrangler.toml",
        "target": "topolo-venue-survey-assets"
      }
    ],
    "queue_bindings": [],
    "storage_kinds": [
      "d1",
      "r2"
    ],
    "workflow_signals": []
  },
  "deployment": {
    "commands": [
      {
        "name": "build",
        "command": "InternalApplications/topolo-venue-survey/apps/api/package.json :: tsc -p tsconfig.json"
      },
      {
        "name": "deploy",
        "command": "InternalApplications/topolo-venue-survey/apps/api/package.json :: wrangler deploy"
      },
      {
        "name": "deploy:dry-run",
        "command": "InternalApplications/topolo-venue-survey/apps/api/package.json :: wrangler deploy --dry-run --outdir .wrangler/build"
      },
      {
        "name": "build",
        "command": "InternalApplications/topolo-venue-survey/apps/web/package.json :: tsc -p tsconfig.json && vite build"
      },
      {
        "name": "preview",
        "command": "InternalApplications/topolo-venue-survey/apps/web/package.json :: vite preview"
      },
      {
        "name": "build",
        "command": "InternalApplications/topolo-venue-survey/package.json :: npm run build -w @topolo/shared && npm run build -w @topolo/api && npm run build -w @topolo/web"
      },
      {
        "name": "build",
        "command": "InternalApplications/topolo-venue-survey/packages/shared/package.json :: tsc -p tsconfig.json"
      }
    ],
    "routes": [],
    "environments": [],
    "assets_directories": [],
    "observability_enabled": false
  },
  "debugging": {
    "failure_modes": [
      "No Auth service ID is registered for this system."
    ],
    "entrypoints": [
      "InternalApplications/topolo-venue-survey/apps/api/wrangler.toml",
      "InternalApplications/topolo-venue-survey/apps/web/wrangler.toml",
      "PlatformApplications/TopoloDocs/src/content/internal/apps/venue-survey.mdx",
      "InternalApplications/topolo-venue-survey/README.md",
      "InternalApplications/topolo-venue-survey/apps/api/package.json",
      "InternalApplications/topolo-venue-survey/apps/web/package.json",
      "InternalApplications/topolo-venue-survey/package.json",
      "InternalApplications/topolo-venue-survey/packages/shared/package.json"
    ]
  }
}