🚀 About These Examples
Each example runs as a separate Swoole server instance on its own port. This lets you explore different php-via features in isolation, compare approaches, and run multiple examples simultaneously. The cards below show live status indicators—click any card to open the example in a new tab.
⚡ Real-time updates using Server-Sent Events (SSE) for instant synchronization
🎯 Flexible scoping - Global, Route, Tab, and Custom scopes for different sharing needs
🔄 Reactive signals that automatically sync state between server and UI
🤝 Multiplayer by default - many examples share state across all connected clients
⚡ Counter
/counter
Basic counter with increment button. Uses signals with data binding and actions. Shows SSE with debug sidebar.
🔢 Counter Basic
/counter-basic
Simplest counter example. Demonstrates minimal Via setup with inline Twig rendering and reactive signals.
👋 Greeter
/greeter
Interactive greeting buttons. Shows Twig templates, multiple actions, and signal updates with SSE.
✓ Todo List
/todo
Multiplayer todo app—one shared list for all clients! Uses route scope, CRUD operations, and mixed tab/route scoped signals.
🧩 Components
/components
Three independent counter components. Demonstrates component abstraction with namespaced signals and Twig partials.
💬 Chat Room
/chat
Multi-room chat system. Features custom room scopes, session-based usernames, typing indicators, and real-time broadcasting.
🎮 Game of Life
/gameoflife
Multiplayer Conway's Game of Life—everyone sees and controls the same board! Uses route scope, timer-based updates, and view caching.
🔔 Global Notifications
/notifications
System-wide notification banner. Demonstrates global scope with globalState() and broadcasting across all routes.
📈 Stock Ticker
/stocks
Multiplayer stock tracker—all clients see the same live prices! Uses route-scoped path parameters, ECharts visualization, and timer-based updates.
� Client Monitor
/monitor
Live connected clients viewer with identicons and server stats. Shows route scope broadcasting, render statistics, and real-time client monitoring.
🛣️ Path Parameters
/path-params
Dynamic routing showcase. Demonstrates path parameter extraction with multiple route patterns and inline styling.
📊 All Scopes Demo
/all-scopes
Complete scope comparison. Shows global, route, and tab scopes working together in a single multi-page application.