๐ Stock Ticker
Real-time stock price simulation with live chart updates every 2 seconds.
Simulated market data updates every 2 seconds via a server-side OpenSwoole timer. Prices drift randomly and history is tracked for each symbol.
ROUTE scope on the dashboard means all viewers share the same rendered output. Per-stock detail pages use custom scopes so each symbol updates independently.
Lazy timers โ the price ticker only runs while at least one client is connected. Zero viewers means zero CPU cost.
Deep linking โ each stock has its own URL (
/stock/{symbol}). Navigate directly to a ticker or click through from the dashboard.Signal-driven charts on detail pages. Price history is stored in signals so the chart data updates live without re-rendering the entire page.
Apache ECharts renders sparklines on the dashboard and the full chart on detail pages. The chart library receives updated data via Datastar signals โ no manual JS refresh needed.
AAPL
Apple Inc.
$321.96
View Chart โ
GOOGL
Alphabet Inc.
$179.03
View Chart โ
MSFT
Microsoft Corp.
$586.07
View Chart โ
AMZN
Amazon.com Inc.
$21.03
View Chart โ
TSLA
Tesla Inc.
$92.02
View Chart โ
NVDA
NVIDIA Corp.
$684.05
View Chart โ
META
Meta Platforms Inc.
$2022.22
View Chart โ
NFLX
Netflix Inc.
$202.55
View Chart โ
โก Signals
price
string Custom Current formatted price for a stock symbol. Custom scope per symbol.
times
array Custom Timestamp array for the price history chart.
prices
array Custom Price array for the chart. Updated every 2 seconds by the server timer.
๐ Views
stock_dashboard.html.twig
ROUTE-scoped dashboard with sparklines for all 8 stocks. Shared by all viewers.
stock_detail.html.twig
Per-symbol detail page with full ECharts chart. Custom scope per stock symbol.
stock_not_found.html.twig
Fallback for unknown stock symbols.