{
  "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 Git API and the same owners, organizations, slugs, visibility semantics, and SpiceDB relationships as repositories and registry packages.\n\n## Required services\n\n- Cuitty Git 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 or registry storage when listings include bundles, artifacts, or package output.\n\n## Environment variables\n\n```bash\nPUBLIC_API_URL=http://localhost:4351\nPUBLIC_CUITTY_AUTH_URL=http://localhost:7705\nAUTH_ISSUER=http://localhost:7705\nAUTH_CLIENT_ID=cuitty-git\nSPICEDB_ENDPOINT=http://localhost:50051\nSPICEDB_PRESHARED_KEY=dev-secret\nAIRFLOW_URL=http://localhost:8080\nCUITTY_APP_EXECUTION_MODE=airflow\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, registry namespace, or package.\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 Git 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)",
  "body_html": "<p>The Code App Market is the browser surface for discovering, installing, and managing Cuitty Code Apps. It uses the Cuitty Git API and the same owners, organizations, slugs, visibility semantics, and SpiceDB relationships as repositories and registry packages.</p>\n<h2 id=\"required-services\">Required services</h2>\n<ul>\n<li>Cuitty Git API and frontend.</li>\n<li>Cuitty Auth.</li>\n<li>Database for app listings, versions, installs, and profile docs.</li>\n<li>SpiceDB for listing visibility, install, manage, and publish checks.</li>\n<li>Airflow for app publishing and runtime workflows.</li>\n<li>Object or registry storage when listings include bundles, artifacts, or package output.</li>\n</ul>\n<h2 id=\"environment-variables\">Environment variables</h2>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"bash\"><code><span class=\"line\"><span style=\"color:#E1E4E8\">PUBLIC_API_URL</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">http://localhost:4351</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">PUBLIC_CUITTY_AUTH_URL</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">http://localhost:7705</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">AUTH_ISSUER</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">http://localhost:7705</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">AUTH_CLIENT_ID</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">cuitty-git</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">SPICEDB_ENDPOINT</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">http://localhost:50051</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">SPICEDB_PRESHARED_KEY</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">dev-secret</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">AIRFLOW_URL</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">http://localhost:8080</span></span>\n<span class=\"line\"><span style=\"color:#E1E4E8\">CUITTY_APP_EXECUTION_MODE</span><span style=\"color:#F97583\">=</span><span style=\"color:#9ECBFF\">airflow</span></span></code></pre>\n<h2 id=\"routes\">Routes</h2>\n<ul>\n<li><code>/market/apps</code> lists discoverable apps.</li>\n<li><code>/market/apps/:owner/:app</code> shows README, permissions, versions, and metadata.</li>\n<li><code>/market/apps/:owner/:app/install</code> reviews requested permissions and installs the app.</li>\n<li><code>/market/apps/:owner/:app/versions</code> lists published versions.</li>\n<li><code>/market/apps/:owner/:app/settings</code> manages owner-controlled metadata and visibility.</li>\n</ul>\n<h2 id=\"permissions-model\">Permissions model</h2>\n<p>Apps 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.</p>\n<p>Operators should verify that market search, detail, install, and settings routes all use the same authorization policy.</p>\n<h2 id=\"common-workflows\">Common workflows</h2>\n<ol>\n<li>Publish a listing from a repository release and <code>.cuitty/app.toml</code> manifest.</li>\n<li>Show README or manifest docs from the configured docs path.</li>\n<li>Review requested permissions before installation.</li>\n<li>Install to the selected user, organization, repository, registry namespace, or package.</li>\n<li>Manage versions, metadata, and visibility from the listing settings page.</li>\n</ol>\n<h2 id=\"failure-modes-and-recovery\">Failure modes and recovery</h2>\n<ul>\n<li>If manifest validation fails, leave the existing listing and latest stable version untouched.</li>\n<li>If requested grants are outside the manifest, reject the install and show the API error.</li>\n<li>If SpiceDB relationship writes fail, pause security-expanding market changes and replay the authz outbox.</li>\n<li>If the market UI cannot reach the API, confirm <code>PUBLIC_API_URL</code> and frontend proxy configuration.</li>\n</ul>\n<h2 id=\"e2e-checks\">E2E checks</h2>\n<p>From the <code>tests</code> directory in the Cuitty Git repository:</p>\n<pre class=\"astro-code github-dark\" style=\"background-color:#24292e;color:#e1e4e8; overflow-x: auto;\" tabindex=\"0\" data-language=\"bash\"><code><span class=\"line\"><span style=\"color:#B392F0\">bun</span><span style=\"color:#9ECBFF\"> run</span><span style=\"color:#9ECBFF\"> test:e2e:apps-registry</span><span style=\"color:#79B8FF\"> --</span><span style=\"color:#79B8FF\"> --project=chromium</span></span>\n<span class=\"line\"><span style=\"color:#B392F0\">bun</span><span style=\"color:#9ECBFF\"> run</span><span style=\"color:#9ECBFF\"> test:e2e:apps-registry:headed</span></span></code></pre>\n<p>The mocked specs set local browser auth state and intercept API responses by API path, so both direct API calls on <code>http://localhost:4351/api/v1/...</code> and proxied frontend calls on <code>http://localhost:4350/api/v1/...</code> are covered.</p>\n<h2 id=\"related-pages\">Related pages</h2>\n<ul>\n<li><a href=\"/docs/code/apps\">Cuitty Code Apps</a></li>\n<li><a href=\"/docs/code/app-manifest\">App Manifest</a></li>\n<li><a href=\"/docs/code/app-permissions\">App permissions</a></li>\n<li><a href=\"/docs/code/authz-spicedb\">Authorization with SpiceDB</a></li>\n<li><a href=\"/docs/code/operator-runbook\">Operator runbook</a></li>\n</ul>",
  "links_out": [
    "/docs/code/apps",
    "/docs/code/app-manifest",
    "/docs/code/app-permissions",
    "/docs/code/authz-spicedb",
    "/docs/code/operator-runbook"
  ]
}