The Problem

Retail and semi-professional investors juggle multiple markets (A-share, HK, US, JP, KR) and need daily, AI-generated decision briefs without paying for a terminal or spending hours aggregating quotes, news, and technical indicators. The repo solves this by automating the full pipeline—data collection, LLM analysis, report generation, and push notifications—on a schedule that costs nothing to run.

What This Does

This is a collection of six self-contained projects, not a single codebase. The core is a Python analysis engine (src/, data_provider/, strategies/) that pulls multi-source market data, applies technical indicators, and feeds it to an LLM (OpenAI-compatible, Gemini, DeepSeek, local Ollama, etc.) to produce a structured decision report. A FastAPI backend (api/) exposes analysis, backtest, portfolio, and alert endpoints. Two front-ends exist: a React web app (apps/dsa-web/) and an Electron desktop app (apps/dsa-desktop/). A bot module (bot/) handles chat-based strategy queries, and GitHub Actions workflows orchestrate scheduled runs with zero server cost.

How It Is Wired

Execution starts either from a GitHub Actions schedule (.github/workflows/00-daily-analysis.yml) or the FastAPI server (api/app.py). The pipeline routes through src/core/pipeline, which calls data_provider/base to fetch quotes and news, src/analyzer to generate the LLM report, and src/storage to persist results. The most connected modules are src/config (130 modules import it, 10 it imports) and src/storage (65 importers, 4 imports) — both are high-blast-radius hubs. Three modules (src/config, data_provider/base, src/analyzer) sit in a circular import cycle, which makes isolated changes risky. The web app's UiLanguageContext is a front-end hub (59 importers). The wiring for the desktop app and bot is not mapped in this analysis.

How To Use It

Setup: Python backend uses pyproject.toml (pip or uv). Front-ends use package.json (npm). Docker is available via docker/Dockerfile and docker/docker-compose.yml.

Configuration: Copy .env.example to .env and set LLM API keys (Anspire, OpenAI-compatible, etc.), data source tokens (AkShare, Tushare, YFinance), and push channel webhooks (WeCom, Feishu, Telegram, Slack, email).

Running it:

# Backend API
uvicorn api.app:app --reload

# Web app
cd apps/dsa-web && npm install && npm run dev

# Scheduled analysis via GitHub Actions
# Fork the repo, add secrets, enable the workflow

Real-World Use

A user forks the repo, sets LLM_API_KEY and TUSHARE_TOKEN in GitHub Secrets, and enables the daily workflow. Each morning at 8am UTC, the pipeline fetches quotes for configured watchlists, pulls news, generates a Markdown decision report with entry/exit points and risk alerts, and pushes it to a WeCom group. The same engine can be called on-demand via the FastAPI /api/v1/analysis endpoint from a portfolio tool.

Code Health & Issues

Static analysis (not opinion) found 457 issues: 162 high, 295 medium. Key findings:

  • High – Oversized files: src/config.py, src/storage.py, data_provider/base.py (up to 2593 lines) — hard to hold in one head, changes ripple widely.
  • High – Import cycle members: src/config.py, data_provider/base.py, src/analyzer.py — circular dependencies make isolated refactoring fragile.
  • High – Deep nesting (max depth 6) in the same three files — control flow hard to follow.
  • High – Hub modules: src/config (130 dependents), src/storage (65 dependents) — high-blast-radius churn.
  • Medium – Broad exception handling (except Exception) in src/storage.py, data_provider/base.py, src/analyzer.py — swallows errors indiscriminately.

SDLC observations: CI is present (GitHub Actions) with tests (310 test files), a license, and lockfiles. Two high-severity hygiene issues: GitHub Actions pinned to mutable tags (@v3, @v5) instead of commit SHAs, and pyproject.toml has no committed lockfile. Docker base images are unpinned (node:20-slim), and no dependency vulnerability scan runs in CI.

The Bottom Line

The system is functionally complete and genuinely useful for automated multi-market analysis at zero hosting cost. The main risk is maintainability: oversized hub modules and import cycles in the core engine will make any non-trivial change slow and error-prone. Use it if you want a working daily-analysis pipeline and are prepared to refactor the src/config and src/storage modules before extending them.