Page - Chart
abstract
Entry point for the chart view — reads lastChartSymbol from localStorage and immediately redirects to /chart/{symbol}. Acts as a redirect proxy; no content is rendered.
Route
| Property | Value |
|---|---|
| Path | /chart |
| File | frontend/src/app/chart/page.tsx |
| Auth Required | No |
| Layout | Root layout with sidebar |
| Dynamic Segment | None |
Primary chart route: /chart/[symbol] — the actual chart view
Behavior
export default function ChartIndexPage() {
const router = useRouter();
useEffect(() => {
const last = localStorage.getItem("lastChartSymbol") ?? "XAUUSD";
router.replace(`/chart/${last}`);
}, [router]);
return (
<SidebarInset className="flex items-center justify-center">
<Loader2 className="h-5 w-5 animate-spin text-muted-foreground" />
</SidebarInset>
);
}- Reads
lastChartSymbolfromlocalStorage(default:"XAUUSD") - Uses
router.replace()(notpush) — no back-button history entry - Shows spinner while redirecting
Chart Detail: /chart/[symbol]
The actual chart page at frontend/src/app/chart/[symbol]/page.tsx renders:
ChartSymbolPage (/chart/EURUSD)
├── AppHeader (title=symbol, timeframe selector)
├── TradingViewChart (lightweight-charts)
│ └── Fetches OHLCV from GET /api/v1/market-data/{symbol}/{timeframe}
│ └── Overlays trade markers (entry/exit lines)
│ └── Real-time updates via WebSocket
└── Sidebar: LLM signal panel (latest signal for this symbol)
localStorage Key: lastChartSymbol — updated when user navigates to a different symbol
🗂️ Related
| Role | Link |
|---|---|
| Backend API | API-GET-v1-Market-Data |