Python / OANDA API / TypeScript / React

FxSaarthi

Professional forex session dashboard tracking the four major sessions (Sydney, Tokyo, London, NY) with real-time pair coverage and session overlap analytics.

28

forex pairs

FxSaarthi

Leadership Lens

01 The Call

Identified a gap between simplistic world-clock widgets and expensive institutional terminals: no tool in the middle offered session-aware analytics with live data pipelines at zero cost. Chose to build a focused, specialist dashboard that solves one problem exceptionally well — knowing exactly which session is active and what it means for the 28 pairs you trade — rather than a generalist trading platform.

02 The Bet

Bet that separating the data pipeline into three independent Cloud Run jobs (ForexFactory scraper every 3 minutes, OANDA candles hourly, correlation matrix daily) — each owning exactly one concern — would give better reliability and a clearer upgrade path than a monolithic ingestion service, even though it meant maintaining three separate GitHub Actions workflows and Docker images.

03 The Trade-off

Accepted no real-time price streaming (60-second refresh cycle) and no user authentication layer in v1, trading these features for a dramatically simpler deployment footprint: a single Cloud Run service serving both the React frontend and Express API from a multi-stage Docker build, with zero managed WebSocket infrastructure and no auth complexity to operate.

04 The Outcome

A live, production-deployed dashboard covering 4 forex sessions (Sydney/Tokyo/London/New York), 28 currency pairs, 84 timezone options, and 5 PostgreSQL tables — with a 1-second session status engine, ATR-aware position sizing, a 28-pair correlation heatmap, and a ForexFactory-backed economic calendar updating every 3 minutes. Also deployed as a static GitHub Pages demo for offline visibility.

05 Coordinated

Sole engineer and designer across the full system: React 19 frontend (40+ components, 8 custom hooks, glass-morphism design system), Node/Express API (9 endpoints), PostgreSQL schema design (fx_global, 5 tables), Python OANDA pipeline and ForexFactory scraper, Docker containerization, Cloud Run deployment, and CI/CD across three independent repositories.

06 Where this goes next

Add WebSocket streaming to push price and session-status updates in real time without polling, introduce user profiles for saving preferred timezone and watchlist pairs, and extend the correlation engine to compute session-specific correlations (London-only vs. NY-only) rather than a single daily aggregate.

01 Chapter 1

The UX Challenge

The same currency pair behaves differently depending on which trading session is active. EUR/USD during the London–New York overlap is a different beast than EUR/USD during the quiet Sydney session. Volatility spikes, liquidity shifts, and economic releases cluster around specific hours — yet most forex tools treat all hours as equal.

Existing tools fall into one of two traps: they are either simple world-clock widgets with no analytical depth, or complex institutional terminals that require a Bloomberg subscription. Nothing in between offers session-aware analysis with integrated data pipelines at zero cost.

Problem Statement

Forex traders need a single dashboard that unifies session timelines, economic calendar events, position sizing, correlation analysis, and volatility monitoring — all updating in real time, all session-aware, all accessible from a phone at 3 AM.

Components

40+

React TSX

Custom Hooks

8

Reusable logic

Currency Pairs

28

Major + crosses

Timezones

84

Full global coverage

DB Tables

5

fx_global schema

Update Cycle

1s

Real-time clock

02 Chapter 2

Design System

FxSaarthi uses a glass-morphism aesthetic — translucent panels with subtle gradients, backdrop blur, and inset highlights floating over a dark background (#0f1419). Each trading session has a unique color so a glance at any chart or clock tells the trader which market is driving the action.

Session Color Palette

Sydney — #38bdf8 (sky blue) Tokyo — #f472b6 (pink) London — #facc15 (yellow) New York — #34d399 (green)

Responsive Breakpoints

Mobile (< 768px): single column, 8-tab bottom nav with snap-scroll Tablet (768–1024px): 2-column grid, tab nav Desktop (> 1024px): 4-quadrant Bento grid with fixed 52px navbar

Component Hierarchy

App.tsx (root orchestrator) Desktop (>= 1024px) → BentoDesktopLayout DesktopNavbar (52px fixed) Left Sidebar (20%): TimeCard, ActiveSessions, PairsToTrade Right Content Grid (80%): ForexChart, VolumeChart, EconomicCalendar, SessionClocks Mobile / Tablet (< 1024px) OverviewPanel, EconomicCalendar, ForexChart, SessionGuide WorldClockPanel, FXToolsPanel, BestPairsWidget BottomNavBar (8 tabs, snap-scroll)

03 Chapter 3

Implementation

40+ React components, 8 custom hooks, zero state management libraries. FxSaarthi is built entirely with React hooks — no Redux, no Context API, no Zustand. State flows top-down from App.tsx, which orchestrates timezone selection, real-time clock updates, and session status calculations.

HookResponsibility
usePWAInstallManages PWA install prompt across Chrome, Safari, and Firefox
useSessionAlertsBrowser notifications for session open/close/warning events
useReducedMotionDetects OS-level prefers-reduced-motion and disables animations
useViewportResponsive breakpoint detection for mobile/tablet/desktop layouts
useFXVolatilityFetches HV-20, ATR, SMA-30, BB Width with 1-hour cache
useFXPriceLive bid/ask/mid prices with 60-second auto-refresh
useFXCorrelation28-pair correlation matrix from PostgreSQL via Express API
useFXAvailableInstInstrument list for dropdowns and filters across all FX tools

Animation System

Every animation is built with Framer Motion 11.18.2 and respects prefers-reduced-motion via the useReducedMotion hook. All animations use GPU-accelerated properties (transform, opacity) with type: "tween" for predictable 60fps rendering.

Clock Update

100ms

Smooth second hand

App Cycle

1s

Session status check

Price Refresh

60s

Live bid/ask/mid

Vol. Cache

1hr

ATR, HV, BB Width

Accessibility-First Architecture

React Aria Components 1.13.0 provides automatic ARIA attributes, focus management, and keyboard navigation (Tab, Escape, Arrow keys) across all interactive elements. Screen readers receive semantic labels for every session bar, clock face, and calendar event.

04 Chapter 4

Data Pipeline

Three data sources converge into one database, served by one API, rendered in one UI. The pipeline architecture separates concerns: scraping runs on its own schedule, price ingestion on another, and correlation analysis runs daily. All write into the shared fx_global PostgreSQL database on Cloud SQL.

Data Pipeline Architecture

OANDA API
FX Pipeline (hourly)
oanda_candles
OANDA API
FX Pipeline (daily)
correlation_matrix
ForexFactory
Scraper (every 3 min)
economic_calendar_ff
fx_global (PostgreSQL)
Express API
React UI
TableSourceSchedulePurpose
economic_calendar_ffForexFactory Scraper3 minEconomic events: dates, currencies, impact, actual/forecast/previous
oanda_candlesOANDA via FX PipelinehourlyOHLC price data for 28 currency pairs
volatility_metricsFX Pipeline (computed)hourlyHV-20, ATR-14, SMA-30, Bollinger Band width
correlation_matrixFX Pipeline (computed)dailyPairwise correlation coefficients for all 28 pairs
best_pairs_trackerFX Pipeline (computed)dailyRanked pair recommendations: hedging, trending, reversal

CI/CD Pipeline

Three independent GitHub repositories, three GitHub Actions workflows, all auto-deploying on push to main. The dashboard also has a parallel GitHub Pages deployment for the frontend-only demo at github.io/Forex-Session-Dashboard/.

05 Chapter 5

Features Deep-Dive

24-Hour Session Timeline

Built with Recharts BarChart and a custom CustomBarShape renderer. Sessions are stacked in three layers: main sessions (90% row height), overlaps (40%), and killzones (40%). A blinking "Now" line pulses every second with a glow effect, position calculated via useMemo for zero transition overhead. Sessions split across midnight are rendered as p1/p2 segments. Timezone offset shifts all bar positions dynamically.

Economic Calendar

AG Grid table displaying events from the economic_calendar_ff table, refreshed every 3 minutes via the ForexFactory scraper pipeline. Countdown timers: red (< 2h), amber (2–6h), cyan (> 6h), grey (past). Multi-currency filter: USD, EUR, GBP, JPY, AUD, CAD, NZD, CHF, CNY. Impact filtering: High, Medium, Low. Quick filters: Yesterday, Today, Tomorrow.

Position Size Calculator

Risk-based lot sizing with live ATR data from the volatility_metrics table. The calculator uses useFXVolatility to fetch real-time ATR values, so recommended position sizes reflect current market conditions. Inputs: account balance, risk % (0.5–5% slider), stop loss pips, instrument. Outputs: lot size, risk amount in account currency, pip value. ATR-aware: suggests stop-loss based on current 14-period ATR.

Correlation Heatmap

A 28-pair matrix and network graph showing pairwise correlations. Data computed daily by the FX Pipeline and stored in correlation_matrix. Color scale: green (+0.7 to +1), grey (neutral), red (−0.7 to −1). Pair screener covers hedging, trending, and reversal categories with ranked best-pairs recommendations.

World Clocks

Four analog clocks — Sydney, Tokyo, London, New York — each with session-aware status indicators. Borders glow when the session is OPEN and pulse on WARNING. 100ms update interval for smooth second hand rotation with millisecond precision (second + ms / 1000). Session-colored accents: cyan, pink, yellow, green.

Volatility Monitor

Sortable grid showing all 28 instruments from the volatility_metrics table, color-coded by volatility regime. Metrics: HV-20, ATR-14, SMA-30, Bollinger Band Width. Row colors: green (low), yellow (medium), red (high volatility). Sortable by any column for quick pair discovery. Hourly refresh via FX Pipeline Cloud Run job.

06 Chapter 6

Session Logic & Timezone Engine

The core of FxSaarthi is its session status engine. Every second, App.tsx recalculates whether each session is OPEN, CLOSED, or WARNING (opening/closing within 15 minutes). The logic handles overnight sessions (Sydney crosses midnight UTC) by checking both "today" and "yesterday" ranges.

SessionUTC RangeKey OverlapKillzone
Sydney21:00 – 06:00Asia-London 07:00–09:00
Tokyo00:00 – 09:00
London07:00 – 16:00London-NY 12:00–16:0007:00–10:00 UTC
New York12:00 – 21:0012:00–15:00 / 18:00–20:00 UTC

Timezone Conversion

All session times are stored as UTC hours (0–24+, where > 24 indicates next-day ranges). The ForexChart adjusts bar positions with left = (session_utc_start + offset) % 24. SessionClocks use Intl.DateTimeFormat with the timeZone parameter for locale-accurate display. Users choose from 84 timezone options covering every major financial center.

07 Chapter 7

Technology Stack

Frontend

React 19.2TypeScript 5.5Vite 6.4.1Framer Motion 11.18.2React Aria 1.13.0RechartsAG GridTailwind CSSPWAService Worker

Backend & Data

Node.jsExpress.jsPostgreSQL (Cloud SQL)PythonOANDA APIForexFactory ScraperCloud SchedulerDockerGoogle Cloud RunGitHub Actions CI/CDGitHub Pages
EndpointDescription
/api/calendar/eventsEconomic events with date/currency/impact filters
/api/fx/prices/currentLive bid/ask/mid for a single instrument
/api/fx/prices/allAll 28 instrument prices
/api/fx/volatility/:instHV-20, ATR, SMA-30, BB Width for instrument
/api/fx/correlation-matrixFull pairwise correlation matrix
/api/fx/best-pairsRanked pair recommendations by category
/api/fx/instrumentsAvailable instrument list

Repository Architecture

Forex-Session-Dashboard — React + Express + Docker → Cloud Run Service ForexFactory-Calendar-Scraper — Python + Docker → Cloud Run Job (every 3 min) DataPipeLine-FX-APP — Python + Docker → Cloud Run Jobs (hourly + daily)