Skip to content

Commit 31dde00

Browse files
v4.0.7
Signed-off-by: Dinger <[email protected]>
1 parent a024187 commit 31dde00

6 files changed

Lines changed: 816 additions & 601 deletions

File tree

DEVELOPMENT.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
|------|---------|-------|
77
| Docker & Docker Compose | 20+ | required for the default setup |
88
| Python | 3.10+ | only if running backend outside Docker |
9-
| Node.js | 18+ | only if you maintain the private QuantDinger-Vue repo |
9+
| Node.js | 22 LTS | only if you maintain the private QuantDinger-Vue or mobile source repos |
1010

1111
## Quick Start (Docker)
1212

@@ -33,7 +33,7 @@ The stack includes:
3333
|---------|------|-------------|
3434
| `frontend` | 8888 | Nginx serving Vue SPA |
3535
| `backend` | 5000 | Flask API (gunicorn) |
36-
| `postgres` | 5432 | PostgreSQL 16 |
36+
| `postgres` | 5432 | PostgreSQL 18 |
3737
| `redis` | 6379 | Cache layer (LRU, 128 MB) |
3838

3939
## Project Structure
@@ -55,7 +55,7 @@ quantdinger/
5555
│ └── requirements.txt
5656
├── docs/ # Changelog, architecture notes
5757
├── docker-compose.yml # frontend service pulls ghcr.io/.../quantdinger-frontend
58-
├── docker-compose.ghcr.yml # both services pulled from GHCR (zero-clone deploy)
58+
├── docker-compose.ghcr.yml # backend, frontend, and mobile pulled from GHCR (zero-clone deploy)
5959
└── README.md
6060
```
6161

@@ -179,6 +179,8 @@ pytest tests/ -v
179179

180180
## Troubleshooting
181181

182+
- **First-time Docker install or pull failures** - see the bilingual [Installation Troubleshooting](docs/INSTALL_TROUBLESHOOTING.md) guide for Docker Desktop proxy setup, Docker Hub pull errors, and Postgres data-version issues.
183+
182184
- **"apikey parameter is incorrect"** from Twelve Data — verify `TWELVE_DATA_API_KEY` in `.env`; Chinese stock data requires a paid plan.
183185
- **Heatmap "暂无数据"** — usually caused by NaN in yfinance data; the global JSON encoder now sanitises all NaN/Inf to `null`.
184186
- **Redis connection refused** — ensure `redis` service is running (`docker compose up -d redis`); set `CACHE_ENABLED=false` to fall back to in-memory cache.

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
</a>
55

66
<h1>QuantDinger</h1>
7-
<h3>The open-source AI infrastructure layer for quant trading</h3>
8-
<p><strong>Turn trading ideas into Python strategies, backtests, paper trading, and live execution - all in one self-hosted stack.</strong></p>
7+
<h3>Open-source AI Trading OS</h3>
8+
<p><strong>Turn trading ideas into Python strategies, backtests, paper trading, live execution, and monitoring - all in one self-hosted stack.</strong></p>
99
<p><strong>QuantDinger is a product of Open Byte Inc.</strong></p>
1010
<p><em>AI research -> Strategy code -> Backtest -> Paper/Live execution -> Monitoring</em></p>
1111

@@ -113,20 +113,20 @@ docker compose up -d
113113

114114
</details>
115115

116-
For step-by-step detail and troubleshooting, see **[Installation & first-time setup](#installation--first-time-setup-docker-compose)**.
116+
For step-by-step detail and troubleshooting, see **[Installation & first-time setup](#installation--first-time-setup-docker-compose)** and **[Installation troubleshooting](docs/INSTALL_TROUBLESHOOTING.md)**.
117117

118118
---
119119

120120
## Why QuantDinger
121121

122122
| Traditional workflow | QuantDinger |
123123
|----------------------|-------------|
124-
| ChatGPT only generates code | Runs, backtests, and executes strategies in one stack |
124+
| ChatGPT only generates code | Runs, backtests, executes, and monitors strategies in one stack |
125125
| TradingView + Jupyter + exchange bots are fragmented | One self-hosted stack from research to execution |
126126
| SaaS platforms hold API keys | User-owned deployment — your infra, your keys |
127127
| AI agents without scopes or audit | Scoped Agent Gateway, paper-only default, audit logs |
128128

129-
QuantDinger is a **self-hosted, local-first** quantitative infrastructure layer — not a chatbot with a buy button. It unifies **multi-LLM research**, **Python-native strategy engines**, **server-side backtesting**, and **multi-broker live execution** across crypto venues, IBKR, and Alpaca in one production-grade stack you fully control.
129+
QuantDinger is a **self-hosted, local-first AI trading OS** — not a chatbot with a buy button. It unifies **multi-LLM research**, **Python-native strategy engines**, **server-side backtesting**, **automated execution**, and **multi-broker live operations** across crypto venues, IBKR, and Alpaca in one production-grade stack you fully control.
130130

131131
## Safety model
132132

@@ -161,13 +161,13 @@ QuantDinger is a **self-hosted, local-first** quantitative infrastructure layer
161161

162162
| | What makes QuantDinger different |
163163
|---|----------------------------------|
164-
| **Full-stack quant OS** | Charting, indicator IDE, AI research, backtests, live bots, quick trade, and broker account management — one product, one Postgres state store. |
164+
| **Full-stack AI trading OS** | Charting, indicator IDE, AI research, backtests, live bots, quick trade, and broker account management — one product, one Postgres state store. |
165165
| **Agent-native** | First-class **Agent Gateway** (`/api/agent/v1`) + **[`quantdinger-mcp`](https://pypi.org/project/quantdinger-mcp/)** on PyPI — Cursor, Claude Code, and Codex can read markets, run backtests, and trade (paper by default) with full audit logs. |
166166
| **Dual strategy runtimes** | **`IndicatorStrategy`** (four-way dataframe signals + chart overlays) and **`ScriptStrategy`** (event-driven `on_bar`, explicit orders) — research and production in the same codebase. |
167167
| **Multi-venue execution** | Direct adapters for Binance, OKX, Bitget, Bybit, Gate, HTX, Coinbase Exchange, Kraken, **IBKR**, and **Alpaca** — unified Broker Accounts page with isolated multi-tenant sessions. |
168168
| **Production-grade infra** | **PostgreSQL 18** + **Redis 7**, connection pooling, background workers (orders, portfolio monitor, reflection), idempotent schema bootstrap, GHCR multi-arch images (amd64/arm64). |
169169
| **Security by default** | Refuses default `SECRET_KEY`, agent tokens hashed at rest, **paper-only trading** unless explicitly unlocked server-side, every agent call audit-logged. |
170-
| **Operator-ready** | OAuth, multi-user roles, credits/membership/USDT billing toggles, an 11-language web UI, and multilingual docs — build a commercial quant product on top, not just a hobby bot. |
170+
| **Operator-ready** | OAuth, multi-user roles, credits/membership/USDT billing toggles, an 11-language web UI, and multilingual docs — build a commercial AI trading product on top, not just a hobby bot. |
171171

172172
<details>
173173
<summary><b>More install paths (GHCR-only, build notes)</b></summary>
@@ -184,7 +184,7 @@ docker compose -f docker-compose.ghcr.yml pull
184184
docker compose -f docker-compose.ghcr.yml up -d
185185
```
186186

187-
**Do not use `docker compose up --build` for a normal install** — the main compose file only declares `image:` for the frontend; `--build` affects the backend only. Rebuild backend after code changes: `docker compose up -d --build backend`. For Vue source builds, use `docker-compose.build.yml` (see [Installation](#installation--first-time-setup-docker-compose)).
187+
**A normal install does not need `docker compose up --build`** — the main compose file builds only the backend from local source; the web and mobile UI services pull GHCR images. Rebuild backend after code changes with `docker compose up -d --build backend`. For UI source builds, use `docker-compose.build.yml` (see [Installation](#installation--first-time-setup-docker-compose)).
188188

189189
</details>
190190

@@ -227,7 +227,7 @@ Deeper references: [AI Integration design](docs/agent/AI_INTEGRATION_DESIGN.md)
227227

228228
## Product overview
229229

230-
**Audience:** independent quants, Python strategy authors, prop/small teams, and operators building white-label quant products on private infrastructure — without handing API keys to a black-box SaaS.
230+
**Audience:** independent traders, Python strategy authors, small trading teams, and operators building white-label AI trading products on private infrastructure — without handing API keys to a black-box SaaS.
231231

232232
## Features at a glance
233233

@@ -307,7 +307,7 @@ flowchart LR
307307

308308
> **Already ran [Try in 2 minutes](#try-in-2-minutes)?** Skip this section — it's the same outcome, just expanded into a step-by-step checklist for first-time deployers and operations folks who want to understand every knob.
309309
310-
This section mirrors a typical “local deploy” path: **prepare the host → obtain the code → configure secrets → start the stack → verify → harden → optionally wire AI**. Node.js is **not** required: the `frontend` service pulls `ghcr.io/brokermr810/quantdinger-frontend` directly, so Nginx serves the SPA without any local build step.
310+
This section mirrors a typical “local deploy” path: **prepare the host → obtain the code → configure secrets → start the stack → verify → harden → optionally wire AI**. Node.js is **not** required: the `frontend` and `mobile` services pull GHCR images directly, so Nginx serves the web and H5 apps without any local build step.
311311

312312
### Prerequisites
313313

@@ -372,8 +372,9 @@ docker compose up -d
372372
```
373373

374374
- **`frontend`** — pulls `ghcr.io/brokermr810/quantdinger-frontend:latest` (no local Vue tree required).
375+
- **`mobile`** — pulls `ghcr.io/brokermr810/quantdinger-mobile:latest` (no local mobile source tree required).
375376
- **`backend`** — built from `./backend_api_python` on first start if no local image exists yet.
376-
- For UI development from Vue source, clone **QuantDinger-Vue** into `./QuantDinger-Vue/` and add `-f docker-compose.build.yml` to the command (see *Build the frontend from Vue source* below).
377+
- For UI development from source, clone **QuantDinger-Vue** and/or **QuantDinger-Mobile** into the expected local directories and add `-f docker-compose.build.yml` to the command (see *Build the frontend or mobile H5 from source* below).
377378

378379
Services: **`postgres`**, **`redis`**, **`backend`**, **`frontend`**, **`mobile`** (see `docker-compose.yml`).
379380

@@ -419,7 +420,7 @@ Do **not** mount a PostgreSQL 16 data directory into a PostgreSQL 18 image, or t
419420

420421
#### Alternative: zero-repo install from GHCR (lightest)
421422

422-
Prebuilt multi-arch (amd64/arm64) images for **both** backend and frontend — no `git clone`:
423+
Prebuilt multi-arch (amd64/arm64) images for **backend, web frontend, and mobile H5** — no `git clone`:
423424

424425
```bash
425426
curl -O https://raw.githubusercontent.com/brokermr810/QuantDinger/main/docker-compose.ghcr.yml
@@ -466,16 +467,16 @@ docker compose -f docker-compose.yml -f docker-compose.build.yml up -d --build
466467

467468
The same override can build the mobile H5 client from `./QuantDinger-Mobile/` or `MOBILE_SRC_PATH=/abs/path/to/QuantDinger-Mobile`.
468469

469-
The main `docker-compose.yml` only pulls GHCR images; the override file `docker-compose.build.yml` adds local `build:` blocks. Without the override, `./QuantDinger-Vue/` and `./QuantDinger-Mobile/` do not need to exist. Point `FRONTEND_SRC_PATH` / `MOBILE_SRC_PATH` somewhere else if you keep sources outside this repo, or set `COMPOSE_FILE=docker-compose.yml:docker-compose.build.yml` in a root `.env` to skip the long `-f -f` invocation.
470+
The main `docker-compose.yml` builds the backend from this repository and pulls web/mobile UI images from GHCR; the override file `docker-compose.build.yml` adds local UI `build:` blocks. Without the override, `./QuantDinger-Vue/` and `./QuantDinger-Mobile/` do not need to exist. Point `FRONTEND_SRC_PATH` / `MOBILE_SRC_PATH` somewhere else if you keep sources outside this repo, or set `COMPOSE_FILE=docker-compose.yml:docker-compose.build.yml` in a root `.env` to skip the long `-f -f` invocation.
470471

471472
### 5) Verify and sign in
472473

473474
| Check | URL / command |
474475
|--------|----------------|
475-
| Web UI | `http://localhost:8888` (override host/port with `FRONTEND_HOST` / `FRONTEND_PORT` in root `.env` if needed). |
476+
| Web UI | `http://localhost:8888` (override host/port with `FRONTEND_PORT` in root `.env` if needed, for example `127.0.0.1:8888`). |
476477
| Mobile H5 | `http://localhost:8889` (override with `MOBILE_PORT`; on a phone, use your host LAN IP, for example `http://192.168.1.10:8889`). |
477478
| API health | `http://localhost:5000/api/health` |
478-
| Logs | `docker-compose logs -f backend` |
479+
| Logs | `docker compose logs -f backend` |
479480

480481
Admin account:
481482

@@ -488,7 +489,7 @@ admin is treated as safely initialized and the first-login password reminder is
488489
not shown. If an existing database still stores the old default, startup syncs
489490
the first admin password to the non-default env value.
490491

491-
Also set **`FRONTEND_URL`** in `backend_api_python/.env` to the URL users actually use (including `https://` behind a reverse proxy); it affects redirects, CORS-related settings, and some generated links.
492+
Also set **`FRONTEND_URL`** in `backend_api_python/.env` or `backend.env` to the URL users actually use (including `https://` behind a reverse proxy); it affects redirects, CORS-related settings, and some generated links.
492493

493494
### 5.1) Point the web/mobile clients at your own backend
494495

@@ -606,7 +607,7 @@ When running the desktop or mobile UI containers by themselves, use `BACKEND_URL
606607
docker run --rm -p 8889:80 -e BACKEND_URL=http://host.docker.internal:5000 ghcr.io/brokermr810/quantdinger-mobile:4.0.3
607608
```
608609

609-
Production-style TLS, domain, and reverse-proxy placement are covered in **[Cloud deployment](docs/CLOUD_DEPLOYMENT_EN.md)**.
610+
Production-style TLS, domain, and reverse-proxy placement are covered in **[Cloud deployment EN](docs/CLOUD_DEPLOYMENT_EN.md)** / **[CN](docs/CLOUD_DEPLOYMENT_CN.md)**.
610611

611612
### Suggested first session (product walkthrough)
612613

@@ -758,7 +759,8 @@ Economic calendar data is free-first: QuantDinger uses the no-key AkShare/Wallst
758759
| [API conventions](docs/API_CONVENTIONS.md) | Auth, envelopes, visibility tiers |
759760
| [Changelog](docs/CHANGELOG.md) | Releases & migrations |
760761
| [README (Chinese)](docs/README_CN.md) | Chinese overview |
761-
| [Cloud deployment](docs/CLOUD_DEPLOYMENT_EN.md) | HTTPS, reverse proxy, production |
762+
| [Installation troubleshooting](docs/INSTALL_TROUBLESHOOTING.md) | Bilingual Docker Desktop proxy, image pull, and Postgres startup troubleshooting |
763+
| [Cloud deployment EN](docs/CLOUD_DEPLOYMENT_EN.md) / [CN](docs/CLOUD_DEPLOYMENT_CN.md) | HTTPS, reverse proxy, production |
762764
| [Multi-user](docs/multi-user-setup.md) | Postgres multi-tenant patterns |
763765
| [Agent environment](docs/agent/AGENT_ENVIRONMENT_DESIGN.md) · [AI integration](docs/agent/AI_INTEGRATION_DESIGN.md) · [Quickstart](docs/agent/AGENT_QUICKSTART.md) · [OpenAPI](docs/agent/agent-openapi.json) · [MCP server](mcp_server/README.md) | Coding agents & MCP (`quantdinger-mcp` on PyPI) |
764766

0 commit comments

Comments
 (0)