Intelligence, Advanced Charting & Trading Platform
docs(setup): add safe Cloudflare WebSocket and React chart integration templates
davoodmehraban89 committed
Oct 12, 2026 at 00:26 UTC
b8ca983ca856617a1eabae5a3b6243903badd2fc
1 file changed
+46
packages/chart-ui/README.md
new
+46
@@ -0,0 +1,46 @@
1
+# ChartNova chart presentation package
2
+
3
+This is a **client-only React/TypeScript package**, not a deployed ChartNova web application.
4
+
5
+## Purpose
6
+
7
+- Uses `lightweight-charts` v5 and HTML5 Canvas (`CandlestickSeries` for provider OHLC; `LineSeries` for reference/price points).
8
+- Historical data are loaded from a server-side REST URL (`historyEndpoint`); the component does not contact market vendors or Neon directly.
9
+- Optional `wss://` stream applies `series.update` on sequential messages; on reconnect or sequence gaps, it refetches history.
10
+- No data will render unless a server provides a valid shape with public-use entitlement. No local or synthetic candles are embedded.
11
+- The chart includes a TradingView attribution link. Verify the complete NOTICE requirement before commercial release.
12
+
13
+## Install and type-check isolated package
14
+
15
+```sh
16
+cd packages/chart-ui
17
+corepack pnpm install
18
+corepack pnpm exec tsc --noEmit
19
+```
20
+
21
+For a future Next.js app, import the component from a `"use client"` host, or dynamically with SSR disabled:
22
+
23
+```tsx
24
+import {LightweightMarketChart} from "../packages/chart-ui/src/LightweightMarketChart";
25
+
26
+export function MarketPanel() {
27
+ return <LightweightMarketChart
28
+ symbol="BTC_USD"
29
+ from="2025-10-12"
30
+ to="2026-10-12"
31
+ timeframe="1d"
32
+ historyEndpoint="/api/v2/history"
33
+ websocketUrl="wss://YOUR-AUTHORIZED-GATEWAY/ws/market"
34
+ />;
35
+}
36
+```
37
+
38
+This example is **integration wiring only**: the v2 REST route is still an unmounted repository port, and the WebSocket gateway is not provisioned. No claim is made that the example returns real BTC data today.
39
+
40
+## Required server response and separation
41
+
42
+`source_ohlc` must be sourced from genuine licensed provider bars with units, timestamp, quality and `approved_public` rights. A `reference_point` has `time/price` only, not artificial OHLC. The currently deployed ECB `/api/history` endpoint has its own legacy response format; bridge it explicitly instead of pretending it supplies source candles.
43
+
44
+## Release requirements
45
+
46
+A real React app integration, signed market-data contracts, provider entitlements, secure server secret deployment, successful API+WS integration tests, accessible/responsive UI QA and rollback. Never expose database or provider credentials in JavaScript sent to browsers.