Examples menu

๐Ÿ’ฌ Chat Room

Chat: Lobby

Custom scopes isolate each room. Messages in "lobby" never leak to "general" โ€” each room has its own broadcast channel built with Scope::build().
Session-scoped usernames persist across tabs. Your username is stored in SESSION scope, so switching rooms or opening a new tab keeps the same identity.
Presence + typing indicators update in real time. When a user disconnects, the onDisconnect hook removes them from the room's user list.
addScope() lets a context join a broadcast channel mid-flight. The room page starts in TAB scope for private input, then adds the room scope for shared messages.
SQLite persistence keeps message history across server restarts. Each room's messages are stored in chat.db and the last 50 are loaded on connect โ€” no in-memory state required.
Multi-room architecture โ€” open two rooms side by side. Each room's scope is independent, so typing in Lobby has no effect on General.
Lobby
User76F9 (you)
User62FA 15:36:31
first!
UserFBD1 02:53:12
1
UserFBD1 02:53:14
123
SwiftOwl 10:13:01
11
SwiftOwl 10:13:12
123123123
SwiftOwl 10:13:19
ๅ‘
UserCDA0 14:57:39
asd
User19E9 16:58:38
dsadsa
UserC927 21:35:22
yello
Unknown 01:08:51
nice
User8AE6 03:25:56
whatadoo
User65CB 06:24:05
vcnc
User7C0E 11:09:56
oi
User6161 01:34:08
111
User6161 01:34:12
222
User4E1F 08:20:51
d
User4E1F 08:20:57
dddd
KeenLynx 01:50:44
fh
User85AE 08:49:22
็š„ๆ’’ๅคง่‹ๆ‰“
User85AE 08:49:26
้˜ฟๅคงๆ’’ๅ“‡ๅ“‡ๅ“‡ๅ“‡
UserDDA7 21:06:29
hello
Unknown 21:07:09
is anyone available for chat
Unknown 21:07:17
hi
User6F61 09:05:49
What's cooking, good lookin'
User20F6 05:15:31
u8iy
User1A7C 08:13:12
11
UserD380 11:39:52
test mate
UserD380 11:40:05
o
UserD380 11:40:10
pp
UserD380 11:40:20
oo
UserADD2 15:50:16
Re
UserADD2 15:50:17
Ee
UserADD2 15:50:20
Dd
User264C 03:20:16
eee
Unknown 20:18:05
waasssuuuupp
User1857 22:48:36
ๆฅไบ†ๆฅไบ†
UserD776 01:38:00
1
User51D9 07:45:07
asdfasd
User51D9 07:45:09
asdfasdfasdfasdfasdf
User2CFB 11:49:00
' OR 1=1--
User859B 11:50:30
' OR 1=1-- STRIX-SQLI-CHECK
UserEE18 15:27:31
<img src=x onerror=alert(1)>

โšก Signals

username string SESSION

Persists across tabs. Same identity whether you switch rooms or open new tabs.

messageInput string TAB ""

Current message draft. Private to this tab.

typingIndicator string Custom

Custom room scope. Shows "User is typing..." to everyone in the same room.

๐ŸŽฏ Actions

sendMessage

Appends message to the room, clears input, resets typing indicator, and broadcasts to room.

updateTyping

Sets the typing indicator with username and broadcasts to room.

๐Ÿ‘ Views

chat_room.html.twig

Sidebar room list + chat panel with message list, user presence, and typing indicator. Uses onDisconnect for cleanup.