kChat’s messaging model is straightforward: messages live in a SupabaseDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/korynthian/chatroom/llms.txt
Use this file to discover all available pages before exploring further.
messages table and the chat page polls that table every second, updating the view whenever new content arrives. There is no WebSocket or realtime subscription — the simplicity of the interval-based approach means the app works reliably across all browsers without any additional configuration.
Setting Your Username
The very first time you visit the chat page, kChat checkslocalStorage for a saved username. If none is found, a browser prompt asks you to enter one:
localStorage key username. If you dismiss the prompt without typing anything, the app defaults to "Secret". You can change your username at any time from the Settings page.
Sending a Message
Type your message in the input box at the bottom of the chat page and press Enter. kChat inserts the message into the Supabasemessages table using the JS client, attaching the current room ID and your username from localStorage:
displayMessages() is called immediately so your message appears without waiting for the next polling cycle.
Receiving Messages
Message fetching is handled by thedisplayMessages() function, which runs once on page load and then on a repeating 1000 ms interval:
messages table for the current room, ordered oldest-first:
room_id are fetched, so switching rooms (by navigating to a different #roomID= hash) automatically loads that room’s history on the next poll.
Auto-Scroll
After each fetch, kChat compares the new HTML content of the message container with what was previously rendered. If the content has changed — meaning at least one new message arrived — the container scrolls to the bottom automatically:Message Format
Each message is rendered as a<p> element containing the sender’s username in bold, the message text, and a localised timestamp derived from created_at:
toLocaleString(), so it reflects the viewer’s local timezone and locale settings automatically. If the room has no messages yet, the container displays "No messages yet." as a plain-text fallback.
Messages are never deleted automatically. Every message inserted into the
messages table remains there indefinitely. There is currently no in-app moderation or message-deletion UI, so pruning old messages must be done directly in the Supabase dashboard or via SQL.