Skip to content

AI Docs

The AI Docs app allows users to generate documents using AI models. It supports freeform generation from prompts, reusable templates, and document summarization. Generated documents are stored and can be accessed later from the dashboard.

  • AI document generation from custom prompts with model selection
  • Template library for reusable document structures
  • Document summaries for quick review of generated content
  • Recent documents list with model badge and date display
RoutePurpose
/business/apps/aidocsDashboard showing nav cards and recent documents
/business/apps/aidocs/generateAI document generation form
/business/apps/aidocs/templatesTemplate management
/business/apps/aidocs/summariesDocument summary view
/business/apps/aidocs/[id]Individual document detail

The app uses service functions from $lib/apps/aidocs/services/index.js:

FunctionDescription
listAiDocuments(userId)Returns all generated documents for the user
listTemplates(userId)Returns all saved templates for the user

Each document record includes: id, title, prompt, model (the AI model used), and created_at.

The dashboard page is organized into three sections:

  • Navigation cards — a 3-column grid linking to Generate, Templates, and Summaries, each with an icon, title, and description
  • Recent documents list — a Card component listing documents with title, truncated prompt (80 chars), model badge, and formatted date
  • Empty state — when no documents exist, shows a prompt to generate the first document
  • AI model display — each document shows which model generated it via a Badge with variant="outline"
  • Service layer — data fetching is delegated to listAiDocuments and listTemplates service functions, keeping the server load function minimal
  • Back navigation — the header includes an explicit back arrow linking to /business/apps, unlike most other apps that rely on browser navigation