How 1-ken/fx-alert works
This is a trading analytics web app for monitoring instruments, configuring alerts, and reviewing market behavior through backtests and prediction scorecards. A trader’s alert workflow runs from the alert form through alert state and a market snapshot; analytics workflows submit backtest or prediction requests and present results. Authentication and bootstrap support the application’s account setup, while charting, subscriptions, and administration are distinct product areas. The graph follows the supplied tree and source index; unsampled modules are represented where their paths are known, but uncertain runtime connections are omitted.
Main entry points: create-alert-form.tsx Alert form · backtest/route.ts Backtest endpoint · predictions/route.ts Prediction endpoint · bootstrap-provider.tsx Bootstrap provider
Components 25
Market experience
- Dashboard
components/dashboard/dashboard-page.tsx - Instrument detail
components/instruments/pair-detail-page.tsx - Trading chart
components/charts/interactive-trading-chart.tsx
Alerting
- Alert form
components/alerts/create-alert-form.tsx - Alert state
hooks/alerts/use-alerts.ts - Market snapshot
hooks/snapshot/use-snapshot.ts - Alert endpoints
app/api/observer/alerts/route.ts - Triggered notifications
components/triggered-notification-listener.tsx
Analytics
- Backtest experience
components/analytics/backtest-page.tsx - Backtest data hook
hooks/analytics/use-backtest.ts - Backtest endpoint
app/api/analytics/backtest/route.ts - Historical data retrieval
lib/history-ensure.ts - Prediction scorecard
components/analytics/prediction-scorecard-page.tsx - Prediction data hook
hooks/analytics/use-prediction-scorecard.ts - Prediction endpoint
app/api/analytics/predictions/route.ts - Scorecard logic
lib/prediction-scorecard.ts
Account platform
- Authentication
lib/auth.ts - Bootstrap provider
components/bootstrap-provider.tsx - Bootstrap API client
lib/api/bootstrap.ts - Onboarding
components/onboarding/onboarding-page.tsx - Subscription controls
components/subscription/paywall-modal.tsx - Admin panel
components/admin/admin-panel.tsx
Other components
- Trader
- Analytics service
- Observer API
Connections 14
- Trader → Alert form: configures
- Alert form → Alert state: creates alerts
components/alerts/create-alert-form.tsx - Alert form → Market snapshot: reads snapshot
components/alerts/create-alert-form.tsx - Alert form → Bootstrap provider: reads account setup
components/alerts/create-alert-form.tsx - Trader → Dashboard: views markets
- Trader → Instrument detail: opens instrument
- Trader → Backtest experience: runs analysis
- Backtest endpoint → Historical data retrieval: ensures candles
app/api/analytics/backtest/route.ts - Backtest endpoint → Analytics service: forwards backtest
app/api/analytics/backtest/route.ts - Prediction endpoint → Scorecard logic: builds scorecard
app/api/analytics/predictions/route.ts - Prediction endpoint → Observer API: requests OHLC
app/api/analytics/predictions/route.ts - Authentication → Observer API: authenticates
lib/auth.ts - Bootstrap provider → Bootstrap API client: loads bootstrap
components/bootstrap-provider.tsx - Onboarding → Bootstrap API client: updates setup