feat: redesign backtest module UI and fix 404 issue

- Fix backtest API 404 by registering routes in setupRoutes()
- Redesign BacktestPage with 3-step wizard configuration
- Add progress ring visualization with animation
- Add equity chart with trade markers using Recharts
- Add trade timeline with card-style display
- Add stats cards for equity, return, drawdown, sharpe
- Add tab navigation for overview/chart/trades/decisions
- Improve run history list with status icons
- Add lightweight-charts dependency (for future use)
This commit is contained in:
tinkle-community
2025-12-14 00:23:51 +08:00
parent 4aa612f397
commit 1e135ea9c3
4 changed files with 1269 additions and 1108 deletions
+4
View File
@@ -187,6 +187,10 @@ func (s *Server) setupRoutes() {
protected.GET("/decisions", s.handleDecisions)
protected.GET("/decisions/latest", s.handleLatestDecisions)
protected.GET("/statistics", s.handleStatistics)
// Backtest routes
backtest := protected.Group("/backtest")
s.registerBacktestRoutes(backtest)
}
}
}
+16
View File
@@ -15,6 +15,7 @@
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"framer-motion": "^12.23.24",
"lightweight-charts": "^5.0.9",
"lucide-react": "^0.552.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
@@ -4483,6 +4484,12 @@
"node": ">=12.0.0"
}
},
"node_modules/fancy-canvas": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/fancy-canvas/-/fancy-canvas-2.1.0.tgz",
"integrity": "sha512-nifxXJ95JNLFR2NgRV4/MxVP45G9909wJTEKz5fg/TZS20JJZA6hfgRVh/bC9bwl2zBtBNcYPjiBE4njQHVBwQ==",
"license": "MIT"
},
"node_modules/fast-deep-equal": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
@@ -5797,6 +5804,15 @@
"node": ">= 0.8.0"
}
},
"node_modules/lightweight-charts": {
"version": "5.0.9",
"resolved": "https://registry.npmjs.org/lightweight-charts/-/lightweight-charts-5.0.9.tgz",
"integrity": "sha512-8oQIis8jfZVfSwz8j9Z5x3O79dIRTkEYI9UY7DKtE4O3ZxlHjMK3L0+4nOVOOFq4FHI/oSIzz1RHeNImCk6/Jg==",
"license": "Apache-2.0",
"dependencies": {
"fancy-canvas": "2.1.0"
}
},
"node_modules/lilconfig": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz",
+1
View File
@@ -21,6 +21,7 @@
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"framer-motion": "^12.23.24",
"lightweight-charts": "^5.0.9",
"lucide-react": "^0.552.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
File diff suppressed because it is too large Load Diff