Fundamental_Analysis/frontend/public/user-guide.md
Lv, Qi b41eaf8b99 Refactor frontend to Vite+React SPA and update docs
Major architectural shift from Next.js to a lightweight Vite + React SPA model ("Puppet Architecture") to better support real-time workflow visualization and strict type safety.

Key Changes:
1. **Architecture & Build**:
   - Initialized Vite + React + TypeScript project.
   - Configured Tailwind CSS v4 and Shadcn UI.
   - Archived legacy Next.js frontend to 'frontend/archive/v2_nextjs'.

2. **Core Features**:
   - **Dashboard**: Implemented startup page with Symbol, Market, and Template selection.
   - **Report Page**:
     - **Workflow Visualization**: Integrated ReactFlow to show dynamic DAG of analysis tasks.
     - **Real-time Status**: Implemented Mock SSE logic to simulate task progress, logs, and status changes.
     - **Multi-Tab Interface**: Dynamic tabs for 'Overview', 'Fundamental Data', and analysis modules.
     - **Streaming Markdown**: Enabled typewriter-style streaming rendering for analysis reports using 'react-markdown'.
   - **Config Page**: Implemented settings for AI Providers, Data Sources, and Templates using TanStack Query.

3. **Documentation**:
   - Created v2.0 User Guide ('docs/1_requirements/20251122_[Active]_user-guide_v2.md').
   - Implemented 'DocsPage' in frontend to render the user guide directly within the app.

4. **Backend Alignment**:
   - Created 'docs/frontend/backend_todos.md' outlining necessary backend adaptations (OpenAPI, Progress tracking).

This commit establishes the full frontend 'shell' ready for backend integration.
2025-11-22 19:37:36 +08:00

3.0 KiB
Raw Blame History

Fundamental Analysis Platform 用户指南 (v2.0 - Vite Refactor)

日期: 2025-11-22 版本: 2.0

1. 简介

Fundamental Analysis Platform 是一个基于 AI Agent 的深度基本面投研平台,旨在通过自动化工作流聚合多源金融数据,并利用 LLM大语言模型生成专业的财务分析报告。

v2.0 版本采用了全新的 Vite + React SPA 架构,提供了更流畅的交互体验和实时的分析状态可视化。

2. 核心功能

2.1 仪表盘 (Dashboard)

平台首页,提供简洁的分析入口。

  • 股票代码: 支持输入 A股 (如 600519.SS)、美股 (如 AAPL) 或港股代码。
  • 市场选择: 下拉选择 CN (中国)、US (美国) 或 HK (香港)。
  • 开始分析: 点击“生成分析报告”按钮即可启动分析流程。

2.2 分析报告页 (Report View)

核心工作区,分为左侧状态栏和右侧详情区。

左侧:工作流状态

  • 可视化 DAG: 展示当前的分析任务依赖图。
    • 节点颜色: 灰色(等待)、蓝色(运行中)、绿色(完成)、红色(失败)。
    • 动态连线: 当任务运行时,连接线会有流光动画指示数据流向。
  • 实时日志: 滚动展示所有后台任务的执行日志,支持实时查看数据抓取和分析进度。

右侧:详情面板

  • Analysis Report: 展示由 AI 生成的最终分析报告。支持 Markdown 格式(标题、表格、加粗、引用),并带有打字机生成特效。
  • Fundamental Data: (开发中) 展示抓取到的原始财务数据表格。
  • Stock Chart: (开发中) 展示股价走势图。

2.3 系统配置 (Config)

集中管理平台的所有外部连接和参数。

  • AI Provider:
    • 管理 LLM 供应商 (OpenAI, Anthropic, Local Ollama 等)。
    • 配置 API Key 和 Base URL。
    • 刷新并选择可用的模型 (GPT-4o, Claude-3.5 等)。
  • 数据源配置:
    • 启用/禁用金融数据源 (Tushare, Finnhub, AlphaVantage)。
    • 输入对应的 API Token。
    • 支持连接测试。
  • 分析模板:
    • 查看当前的分析流程模板(如 "Quick Scan")。
    • 查看每个模块使用的 Prompt 模板及模型配置。
  • 系统状态:
    • 监控微服务集群 (API Gateway, Orchestrator 等) 的健康状态。

3. 快速开始

  1. 进入 配置页 -> AI Provider,添加您的 OpenAI API Key。
  2. 进入 配置页 -> 数据源配置,启用 Tushare 并输入 Token。
  3. 回到 首页,输入 600519.SS,选择 CN 市场。
  4. 点击 生成分析报告,观察工作流运行及报告生成。

4. 常见问题

  • Q: 报告生成卡住怎么办?
    • A: 检查左侧“实时日志”,查看是否有 API 连接超时或配额耗尽的错误。
  • Q: 如何添加本地模型?
    • A: 在 AI Provider 页添加新的 ProviderBase URL 填入 http://localhost:11434/v1 (Ollama 默认地址)。