PR2: read-only FastAPI dashboard backend #2
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/backend-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Zweiter von vier PRs. Das Backend, das PR3 (Dashboard) konsumiert.
Inhalt
analytics.py: reine Portfolio-Mathematik aus SQLite (keine Exchange-Calls)days-Fensterapi.py: FastAPI-App, read-only, keine WritesGET /api/health- Liveness + DB-CheckGET /api/summaryGET /api/history?days=30(1..365)GET /api/trades?limit=50&offset=0(neueste zuerst, paginiert)/api/docs; lazyapi.appfueruvicorn krypto_dca.api:apppaths.py: Config-Aufloesung aus cli.py herausgezogen (explizit /KRYPTO_DCA_CONFIG/ bekannte Pfade), von cli + api geteiltkrypto-dca serve: neuer CLI-Subcommand, startet uvicorn auf[backend] host/port(Default127.0.0.1:8787)krypto-dca-backend.service(Type=simple, Restart=always, gleiches Hardening wie die Timer) +nginx-trading.uliana.de.conf(TLS via acme.sh + HTTP Basic Auth vor127.0.0.1:8787)fastapi,uvicornals Runtime;httpxim dev-Extra (TestClient)Verifiziert
pytest-> 26 passed (6 neue: health, summary-Mathe, Trade-Pagination, History-Serie + Tagesfenster)buy+snapshot+serve, alle vier Endpunkte liefern 200; summary rechnet investiert 12,00 / holdings_value 11,97 (Fees) / Buy&Hold 12,00 sauber ausSicherheit
127.0.0.1, ausschliesslich lesend, keine ccxt-Aufrufekrypto-dca, nicht rootCo-authored-by: Claude claude@anthropic.com