kChat uses Supabase as its only backend. All application data — rooms, messages, and user profiles — is stored in a Supabase Postgres database. There is no custom server: the Supabase JavaScript client, loaded directly from a CDN, handles every query the app makes, from fetching room lists and displaying messages to inserting new ones in real time.Documentation 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.
Creating a Supabase project
Sign in to Supabase
Go to supabase.com and sign in with your account, or create a free one if you don’t have one yet.
Create a new project
Click New project from your organization dashboard. Give the project a name, set a secure database password, and choose the region closest to your users.
Wait for provisioning
Supabase will spin up your Postgres database and supporting services. This typically takes around two minutes. You’ll be redirected to the project dashboard once it’s ready.
Running the schema
Once your project is provisioned, open the SQL Editor from the left-hand sidebar in the Supabase dashboard and paste in the following SQL. Running it will create the three tables kChat depends on:rooms, messages, and profiles.
supabase.sql
Connecting kChat
With your credentials in hand, openchat.js and indextablenames.js and replace the placeholder values at the top of each file with your actual Project URL and anon public key.
chat.js powers the chat view (fetching and inserting messages, resolving the room name), while indextablenames.js powers the index page (listing all available rooms ordered by creation date).
Creating your first room
Therooms table starts empty. Before any chat is possible, insert at least one room. You can do this directly in the Table Editor or via the SQL Editor:
id (assigned automatically) can be passed as a URL hash to chat.html — for example, chat.html#roomID=1 — to open that room.
Row Level Security (RLS)
Supabase JS client
kChat loads the Supabase JavaScript client from a CDN in each HTML file. No build step ornpm install is required — just include the script tag before your own JS files:
supabase available as a global, which chat.js and indextablenames.js use to call supabase.createClient() and initialize the connection.