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.
Key features
Section titled “Key features”- 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
Page structure
Section titled “Page structure”| Route | Purpose |
|---|---|
/business/apps/aidocs | Dashboard showing nav cards and recent documents |
/business/apps/aidocs/generate | AI document generation form |
/business/apps/aidocs/templates | Template management |
/business/apps/aidocs/summaries | Document summary view |
/business/apps/aidocs/[id] | Individual document detail |
Data model overview
Section titled “Data model overview”The app uses service functions from $lib/apps/aidocs/services/index.js:
| Function | Description |
|---|---|
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.
Key components
Section titled “Key components”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
Cardcomponent 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
Notable integrations
Section titled “Notable integrations”- AI model display — each document shows which model generated it via a
Badgewithvariant="outline" - Service layer — data fetching is delegated to
listAiDocumentsandlistTemplatesservice 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