定制 concept24/nova-ai-report 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

concept24/nova-ai-report

Composer 安装命令:

composer require concept24/nova-ai-report

包简介

KPI Reports tool for Laravel Nova — daily/weekly/monthly analytics dashboards for e-commerce.

README 文档

README

KPI Reports & BI Agent tool for Concept24 CMS — daily/weekly/monthly analytics dashboards and AI-powered chat for e-commerce, built on Laravel Nova.

Requirements

  • PHP >= 8.1
  • Laravel 12
  • Laravel Nova 4.12+ / 5.x
  • OpenRouter API key

Installation

composer require concept24/nova-ai-report

The service provider is auto-discovered. Migrations run automatically via loadMigrationsFrom. Publish config manually:

php artisan vendor:publish --tag=nova-ai-report-config

To copy migrations into your app's database/migrations/ (optional):

php artisan vendor:publish --tag=nova-ai-report-migrations

To seed the default prompt library (30 standard e-commerce reports):

php artisan db:seed --class="Concept24\NovaAiReport\Database\Seeders\AiReportPromptSeeder"

Configuration

config/nova-ai-report.php (takes full priority over package defaults):

KeyEnv varDefault
openrouter.api_keyOPENROUTER_API_KEY
default_modelNOVA_AI_REPORT_DEFAULT_MODELanthropic/claude-sonnet-4.6
models.primaryNOVA_AI_REPORT_MODEL_PRIMARYanthropic/claude-sonnet-4.6
models.fastNOVA_AI_REPORT_MODEL_FASTgoogle/gemini-3-flash-preview
models.reasoningNOVA_AI_REPORT_MODEL_REASONINGanthropic/claude-opus-4.7
max_tool_iterationsNOVA_AI_REPORT_MAX_TOOL_ITERATIONS15
cache_ttlNOVA_AI_REPORT_CACHE_TTL300
rate_limitNOVA_AI_REPORT_RATE_LIMIT30,1

Minimum .env:

OPENROUTER_API_KEY=sk-or-...

Database

Tables

TablePurpose
nova_ai_report_conversationsBI Agent chat sessions (user_id, title, model, model_tier)
nova_ai_report_messagesChat messages (role, content, tool_calls, query_results)
nova_ai_report_logsPer-request usage tracking (tokens, cost, latency, tool_calls_count)
nova_ai_report_promptsGlobal saved prompt library (title, content, sort_order)

Prompts table

nova_ai_report_prompts
  id            bigint PK
  title         varchar(255)
  content       text  (max 5000 chars)
  sort_order    int   (default 0)
  created_at    timestamp
  updated_at    timestamp

Prompts are global — no user ownership, no sharing flags. All Nova users share the same library.

Seeder

AiReportPromptSeeder ships 30 standard e-commerce report prompts in Romanian, organized by category:

CategoryPrompts
Vânzări & Venituri6 — revenue, product/category sales, AOV, vouchers, returns, profitability
Comportament Utilizatori5 — conversion rate, funnel, cart abandonment, page performance, site search
Clienți & Loialitate7 — new vs. returning, CLV, cohort retention, repeat purchase, RFM, churn risk, reviews
Produse & Stoc6 — bestsellers/worst performers, critical stock, replenishment, dead stock, cross-sell, wishlist
Operațional & Logistică3 — order status, delivery performance, payment methods
Financiar & Strategic3 — executive dashboard, net profitability after returns, 6-month strategic trend

Excludes: GA4, Google Ads, Meta/TikTok, Hotjar/Clarity — uses only internal database data.

Features

KPI Dashboards

Tab-based dashboards powered by pre-aggregated kpi_* tables. Tabs are hidden automatically if kpi_daily_sales does not exist in the database.

TabData source
OverviewCross-table KPI summary
Saleskpi_daily_sales, site_orders
Traffickpi_daily_traffic, kpi_sessions
UXkpi_daily_ux, kpi_webvitals
Productskpi_daily_products, site_products
Funnelskpi_daily_funnels, kpi_events

BI Agent Chat

AI-powered chat that queries operational and KPI tables via a tool-call loop.

  • Multi-turn conversation with tool calls: execute_sql, get_table_schema, get_join_pattern, get_entity_links, get_report_recipe
  • Multi-model picker: Gemini Flash, Gemini Pro, Claude Sonnet, Claude Opus, Grok
  • SSE real-time streaming with animated typing indicator
  • Silent retry on failed tool calls
  • Per-conversation cost display
  • Conversation management: rename, delete, search, multi-tab

Routing: all BI Agent endpoints are prefixed /nova-vendor/nova-ai-report/bi-agent/ and protected by Nova + Authorize middleware.

MethodPathDescription
POSTchatStream a response (SSE)
GETconfigAvailable models, defaults, KPI table presence
GETcreditsOpenRouter credit balance
GETusagePer-day usage stats
GET/POSTconversationsList / create
GET/PATCH/DELETEconversations/{id}Show / update / delete
GET/POSTpromptsList / create prompts
PATCH/DELETEprompts/{id}Update / delete prompt
POSTexportGenerate HTML export

Saved Prompts

Global library of reusable prompt templates accessible from two entry points:

  • Prompts tab — split-panel management UI (CRUD, search, inline edit)
  • ⚡ button in ChatInput — modal picker that inserts prompt content into the textarea

Chat Export

Selective export of agent responses to a self-contained HTML file.

  • Click the ↓ button in the tab bar to enter selection mode
  • Checkboxes appear on each exportable message (text + charts/tables)
  • Transitional inter-tool notes are excluded from export automatically
  • Click Export HTMLhtml2canvas captures chart messages as PNG screenshots; text messages export as real HTML
  • Downloads as {conversation-title}.html

Architecture

Backend

src/
  Http/
    Controllers/
      BiAgentController.php     — chat, config, credits, usage
      ConversationController.php — conversation CRUD
      PromptController.php       — prompt CRUD
      ExportController.php       — HTML export
  Services/
    BiAgentOrchestrator.php      — tool-call loop
    ChatExportService.php        — HTML export generation
    KpiSchemaProvider.php        — system prompt + schema introspection
    KpiQuerySanitizer.php        — SQL safety (SELECT/WITH only, sensitive column masking)
    NovaReportRecipes.php        — CMS report SQL recipes
    OpenRouterClient.php         — SSE streaming client
  Models/
    Conversation.php
    Message.php
    AiReportLog.php
    Prompt.php

Frontend (Vue 3 Composition API)

resources/js/
  pages/
    AiReport.vue                  — root page, tab routing
  components/
    tabs/
      BiAgentTab.vue              — chat UI, export orchestration
      PromptsTab.vue              — prompt management (split panel)
      UsageTab.vue
      OverviewTab.vue / SalesTab.vue / TrafficTab.vue / UxTab.vue / ProductsTab.vue / FunnelsTab.vue
    bi-agent/
      ChatThread.vue              — message list
      BiAgentMessage.vue          — single message (text / chart / export checkbox)
      BiAgentResultChart.vue      — chart/table renderer (Chart.js)
      ChatInput.vue               — textarea + model picker + ⚡ prompts button
      ExportBar.vue               — export mode action bar
      PromptPickerModal.vue       — modal prompt selector

CSS

All component styles in resources/css/tool.css using --ai-* CSS variables scoped to .nova-ai-report-wrap. Dark mode via .dark .nova-ai-report-wrap.

Changelog

VersionDateNotes
1.4.82026-05-19Fix UX/Traffic/Products tab KPI cards reading wrong API key (currentkpis.*.current); fix product name resolution (use title accessor instead of name); add utils/labels.js with human-readable labels for events/funnels/steps/page types; funnel chart improvements (wider labels, more spacing, value pill visible on both filled and empty bars)
1.3.12026-05-02Fix o3/o1 temperature error (reasoning models skip temperature, use max_completion_tokens); increase max_tokens 4096→16384; compress large tool results in conversation history (first 60 rows); error/timeout messages survive loadTabMessages reload
1.3.02026-04-30Migrations bundled in package; AiReportPromptSeeder (30 e-commerce reports); KPI tabs auto-hidden; Romanian terminology; operational tables priority; table overflow fix
1.2.02026-04-30Chat export to HTML (html2canvas); nudge/retry chips; transitional message styling
1.1.02026-04-29Saved Prompts (global library + modal picker + management tab)
1.0.02026-04-29Initial release — BI Agent chat, KPI dashboards, model picker, usage tracking

concept24/nova-ai-report 适用场景与选型建议

concept24/nova-ai-report 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 27 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「analytics」 「nova」 「tool」 「laravel」 「e-commerce」 「reports」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 concept24/nova-ai-report 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 concept24/nova-ai-report 我们能提供哪些服务?
定制开发 / 二次开发

基于 concept24/nova-ai-report 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 27
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 39
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-30