free4chat
# free4chat [free4.chat](https://free4.chat/) โ real-time voice + text chat. No sign-up, no server to run. Open a room and talk. > โ ๏ธ Personal project / experimental. Use at your own risk. ## Features - ๐๏ธ Voice chat in rooms - ๐ฌ Text chat with emoji - ๐ File & image transfer (inline preview) - ๐ฅ๏ธ Screen sharing - ๐ค Luna โ optional AI assistant (mention `@luna` to invoke) - ๐ No accounts, no persistent data - โฑ๏ธ Rooms automatically close after 2 hours - ๐ก๏ธ Cloudflare Turnstile bot protection ## Privacy free4chat is built around two principles: **no data outlives the conversation**, and **you don't need to trust any server**. **What we don't store:** - No accounts, no sign-up, no identity - Messages exist only in participants' browser memory โ close the tab and they're gone - Files and images are transferred via WebRTC data channels, never written to any database - Voice is relayed through Cloudflare's media nodes but never recorded **What does persist (and why it's fine):** - A `room name โ meeting ID` mapping is kept in Cloudflare KV with a 30-day TTL so rejoining the same room name works. It contains no messages, no users, no content. - When Luna AI is enabled, messages sent to `@luna` are transmitted to an external AI model (Cloudflare AI Gateway โ `@cf/zai-org/glm-4.7-flash`) for processing. The last 20 messages of conversation context are retained in a Durable Object for the lifetime of the room session only. Luna is opt-in and disabled by default. - Your nickname is saved in browser `localStorage` for convenience. Clear it anytime. The Worker's only job is to issue a short-lived auth token โ after that, all communication is peer-to-peer or via Cloudflare's media plane with no application-layer logging. ## Tech Stack | Layer | Technology | | -------- | ------------------------------------------------------------------------------------ | | Frontend | Next.js 15, Tailwind CSS, Cloudflare RealtimeKit React SDK | | API | Next.js API routes deployed as Cloudflare Worker via `@opennextjs/cloudflare` | | AI | `BotSession` Durable Object โ Cloudflare AI Gateway โ `@cf/zai-org/glm-4.7-flash` | | Storage | Cloudflare KV (room metadata, rate limiting) + DO KV storage (Luna chat history) | | Media | Cloudflare RealtimeKit (WebRTC, audio, data channels, screen sharing) | | Security | Cloudflare Turnstile (full-page bot challenge) + origin whitelist + KV rate limiting | ## Stack History This project has gone through three stacks, always with the same product goal: | Branch | Stack | Why it changed | | ------------------------------ | -------------------------------- | --------------------------------------------------------------------------------- | | [`golang`](../../tree/golang) | Go + Pion WebRTC + coturn | Self-hosted infra is too much overhead for a personal project | | [`elixir`](../../tree/elixir) | Elixir + Membrane Framework | Maintaining a server cluster is still heavy for something this small | | **`cloudflare`** (this branch) | Cloudflare RealtimeKit + Workers | Fully serverless โ no servers to manage, file transfer built-in, free tier works | The product never changed. The ops burden did. The full story โ WebRTC internals, why each stack was chosen, where AI voice bots are headed โ is written up here: [**ไธไธช WebRTC ่ๅคฉๅฎค็ไธๆฌกๆผ่ฟ**](https://www.bmpi.dev/dev/free4chat/) (Chinese) ## Development See [DEVELOPMENT.md](./DEVELOPMENT.md) for local setup, deployment, and architecture notes. ## License MIT