{
  "slug": "code/app-market",
  "title": "Code App Market",
  "description": "Publish, share, install, and manage Cuitty Code Apps.",
  "url": "https://cuitty.com/docs/code/app-market",
  "markdown_url": "https://cuitty.com/docs/code/app-market.md",
  "json_url": "https://cuitty.com/docs/code/app-market.json",
  "frontmatter": {
    "title": "Code App Market",
    "description": "Publish, share, install, and manage Cuitty Code Apps.",
    "order": 13,
    "section": "Code",
    "updatedAt": "2026-05-24"
  },
  "headings": [
    {
      "depth": 2,
      "slug": "required-services",
      "text": "Required services"
    },
    {
      "depth": 2,
      "slug": "environment-variables",
      "text": "Environment variables"
    },
    {
      "depth": 2,
      "slug": "routes",
      "text": "Routes"
    },
    {
      "depth": 2,
      "slug": "permissions-model",
      "text": "Permissions model"
    },
    {
      "depth": 2,
      "slug": "common-workflows",
      "text": "Common workflows"
    },
    {
      "depth": 2,
      "slug": "failure-modes-and-recovery",
      "text": "Failure modes and recovery"
    },
    {
      "depth": 2,
      "slug": "e2e-checks",
      "text": "E2E checks"
    },
    {
      "depth": 2,
      "slug": "related-pages",
      "text": "Related pages"
    }
  ],
  "body_markdown": "The Code App Market is the browser surface for discovering, installing, and managing Cuitty Code Apps. It uses the Cuitty Code API and the same owners, organizations, slugs, visibility semantics, and SpiceDB relationships as repositories. Registry namespace and package targets are available when Cuitty Registry integration is configured.\n\n## Required services\n\n- Cuitty Code API and frontend.\n- Cuitty Auth.\n- Database for app listings, versions, installs, and profile docs.\n- SpiceDB for listing visibility, install, manage, and publish checks.\n- Airflow for app publishing and runtime workflows.\n- Object storage or Cuitty Registry when listings include bundles, artifacts, or package output.\n\n## Environment variables\n\nProduction deployments should keep secret values behind Safe references. The reference syntax is `cuitty-safe:account/safe/secret`; only the resolver sees the decrypted value.\n\n```dotenv\nPUBLIC_API_URL=https://code.example.com\nPUBLIC_CUITTY_AUTH_URL=https://auth.example.com\nAUTH_ISSUER=https://auth.example.com\nAUTH_CLIENT_ID=cuitty-git\nSPICEDB_ENDPOINT=https://spicedb.example.com:50051\nSPICEDB_PRESHARED_KEY=cuitty-safe:acme/prod/spicedb-preshared-key\nAIRFLOW_URL=https://airflow.example.com\nCUITTY_APP_EXECUTION_MODE=airflow\n```\n\nFor an isolated local development stack only, use disposable placeholder values and local endpoints:\n\n```dotenv\nPUBLIC_API_URL=http://localhost:4351\nPUBLIC_CUITTY_AUTH_URL=http://localhost:7705\nAUTH_ISSUER=http://localhost:7705\nAUTH_CLIENT_ID=cuitty-code\nSPICEDB_ENDPOINT=http://localhost:50051\nSPICEDB_PRESHARED_KEY=<local-dev-only-spicedb-key>\nAIRFLOW_URL=http://localhost:8080\nCUITTY_APP_EXECUTION_MODE=airflow\nPUBLIC_REGISTRY_URL=http://localhost:4371\n```\n\n## Routes\n\n- `/market/apps` lists discoverable apps.\n- `/market/apps/:owner/:app` shows README, permissions, versions, and metadata.\n- `/market/apps/:owner/:app/install` reviews requested permissions and installs the app.\n- `/market/apps/:owner/:app/versions` lists published versions.\n- `/market/apps/:owner/:app/settings` manages owner-controlled metadata and visibility.\n\n## Permissions model\n\nApps can be public, private, or organization-visible. Public discovery does not automatically mean public install; app owners can still restrict who may install an app. Private and organization-visible apps should return not found to unauthorized users when hiding existence is required.\n\nOperators should verify that market search, detail, install, and settings routes all use the same authorization policy.\n\n## Common workflows\n\n1. Publish a listing from a repository release and `.cuitty/app.toml` manifest.\n2. Show README or manifest docs from the configured docs path.\n3. Review requested permissions before installation.\n4. Install to the selected user, organization, repository, or Registry namespace/package target.\n5. Manage versions, metadata, and visibility from the listing settings page.\n\n## Failure modes and recovery\n\n- If manifest validation fails, leave the existing listing and latest stable version untouched.\n- If requested grants are outside the manifest, reject the install and show the API error.\n- If SpiceDB relationship writes fail, pause security-expanding market changes and replay the authz outbox.\n- If the market UI cannot reach the API, confirm `PUBLIC_API_URL` and frontend proxy configuration.\n\n## E2E checks\n\nFrom the `tests` directory in the Cuitty Code repository:\n\n```bash\nbun run test:e2e:apps-registry -- --project=chromium\nbun run test:e2e:apps-registry:headed\n```\n\nThe mocked specs set local browser auth state and intercept API responses by API path, so both direct API calls on `http://localhost:4351/api/v1/...` and proxied frontend calls on `http://localhost:4350/api/v1/...` are covered.\n\n## Related pages\n\n- [Cuitty Code Apps](/docs/code/apps)\n- [App Manifest](/docs/code/app-manifest)\n- [App permissions](/docs/code/app-permissions)\n- [Authorization with SpiceDB](/docs/code/authz-spicedb)\n- [Operator runbook](/docs/code/operator-runbook)\n- [Registry code integration](/docs/registry/code-integration)",
  "links_out": [
    "/docs/code/apps",
    "/docs/code/app-manifest",
    "/docs/code/app-permissions",
    "/docs/code/authz-spicedb",
    "/docs/code/operator-runbook",
    "/docs/registry/code-integration"
  ]
}