Getting Started

Deskly is a Next.js app for embeddable, multi-tenant AI chat widgets: each account runs unlimited bots, each bot has its own public embed key, domain allowlist, and document-scoped knowledge base. Follow the steps below until you have a bot embedded and answering questions on a real page.

Quick Start

  1. Clone and install

    git clone https://github.com/boilerlykit/deskly.git
    cd deskly
    pnpm install
    
  2. Set up environment variables

    • Copy .env.local.example to .env.local
    • Follow the Configuration Guide to fill in Supabase, AI provider, and (optionally) Resend/CRM keys
  3. Set up the database

    • Run the SQL schema from src/db/schema.sql in your Supabase SQL editor
    • Create a storage bucket named uploads in Supabase Storage
  4. Start the dev server

    pnpm dev
    
  5. Run the built-in setup checklist (recommended)

    • Visit /dashboard/setup to validate your environment variables and database schema
  6. Create your first bot

    • Sign in, open /dashboard/bots, create a bot, and add at least one domain to its allowed-domains list (a bot with no allowed domains never renders — secure by default)
    • Upload a document so the bot has something to answer from
  7. Embed it

    <script src="https://your-deploy-url.com/widget.js" data-bot-key="pk_..." async></script>
    

    Drop this before </body> on any page. It injects a sandboxed iframe bubble in the bottom-right corner — see Embeddable Widget for how the isolation and resize behavior work.

What ships

  • Multi-tenant bots — a bots table, not a single hard-coded assistant; see Architecture
  • Embeddable iframe widget — one script tag, CSS-isolated from the host page
  • Per-bot RAG — uploads scoped to a bot, not the whole account; see RAG Pipeline
  • Abuse protection — visitor, hourly, and daily rate limits plus a real owner credit check; see Abuse Protection
  • Lead capture — email/phone extraction and owner email alerts; see Lead Capture
  • Same foundation as the base template — Supabase Auth, Postgres RLS, Stripe credits, unchanged

Documentation

GuideDescription
ConfigurationEnvironment variables setup
ArchitectureThe multi-tenant bots layer
Embeddable WidgetScript tag, iframe, domain checks
RAG PipelinePer-bot document upload and retrieval
Abuse ProtectionRate limits and credit guardrails
Lead CaptureExtraction, storage, email alerts
API ReferenceWidget and CRM endpoints
CRM IntegrationsJobber/Housecall Pro OAuth scaffold
DeploymentProduction deployment guide
TroubleshootingCommon issues and solutions

Next Steps

  1. Configure your environment variables
  2. Create a bot in /dashboard/bots and upload a document
  3. Embed the widget on a test page
  4. Deploy to production