How deco-cx/chat works
Project Type and Purpose
• deco.chat is a full-stack, open-source AI workspace platform that lets teams spin up rich, UI-driven chat agents.
• It is organized as a monorepo with:
• A React/Vite frontend (“apps/web”),
• A Deno‐based HTTP API (“apps/api”),
• A Cloudflare Worker–style outbound service (“apps/outbound”),
• A CLI client (“packages/cli”),
• Core shared libraries for AI logic (“packages/ai”), runtime hosting (“packages/runtime”), SDK and hooks (“packages/sdk”), and UI primitives (“packages/ui”),
• A Supabase schema/migration folder.
File Structure
• apps/web: React + Vite application, lots of components, hooks, assets, environment configuration.
• apps/api: Deno + Oak (or built‐in) HTTP entrypoint, middlewares for auth, context, Stripe webhooks, database utils, actors.
• apps/outbound: a small Deno/Cloudflare Worker that handles outbound channel calls (e.g., WhatsApp, Slack).
• packages/cli: Deno-powered CLI to manage auth, deploy, link, whoami, MCP publishing.
• packages/ai: Core TypeScript agent runtime, triggers, tools, MCP loaders, message adapters.
• packages/runtime: JSR bindings, proxy, connection abstractions for hosting agents.
• packages/sdk: HTTP client and React hooks for app/web to call the API, auth flows, cache, observability.
• packages/ui: Tailwind/CSS + React primitives used by apps/web and example agent UIs.
• supabase/: Database migrations and policies for Supabase Postgres.
README for Additional Insights
• Describes production vs. local environment flags.
• Mentions Deno + Node prerequisites, CLI installation, Supabase migrations.
• Key functional domains: interactive chat, “Golden Layout” multitabs, extensible MCP catalog, community library.
• External integrations: Stripe (billing/webhooks), Supabase (data + auth), 3rd-party APIs (via MCP).
Detail Is Key
• In the Shared Libraries lane, list: packages/ai, packages/runtime, packages/sdk, packages/ui.
• Supabase schema folder under Database.