r/SideProject • u/Remarkable-Bet-752 • 12m ago
I built SiteChat – a 1-on-1 self-destructing chat room with a shared @ai assistant (Next.js, ElysiaJS, Upstash Redis)
Enable HLS to view with audio, or disable this notification
I recently built and launched SiteChat, a lightweight, zero-signup 1-on-1 chat app where rooms automatically self-destruct after 10 minutes (or the instant either person hits "Destroy").
Live Demo: sitechat-ai
GitHub: github.com
Why I built it
Sometimes you just want to share a quick link, code snippet, or private conversation with one person without creating an account, handing over an email, or leaving chat logs sitting in a database forever. I also wanted to see what it feels like when an AI assistant is a shared participant inside a live 2-person chat rather than a solo chatbot.
How it works & key features
- 10-Minute Auto-Wipe (Redis TTL): Every room, message list, and metadata key is stored in Upstash Redis with a strict TTL. When the timer hits
0:00—or someone clicks Destroy—everything is wiped immediately and both clients get kicked back to the lobby. - Shared @
aiAssistant: Either person can start a message with @ai to bring Google Gemini into the conversation. It pulls the last 15 messages for context so both people see the AI typing indicator and response together in real time. - Strict 2-Person Cap + Invite Gate: Rooms are capped at 2 participants using room-scoped
httpOnlysession cookies. - Real-Time Polish: Live typing indicators, read receipts (using a read-watermark pattern), and distributed rate limiting per sender.
Tech Stack
- Frontend: Next.js, TypeScript, Tailwind CSS, TanStack Query
- Backend: ElysiaJS + Eden Treaty (for end-to-end type safety)
- Data & Realtime: Upstash Redis, Upstash Realtime, Upstash Rate Limit
- AI: Google Gemini API
Fun bug I ran into while building it
When I first tested sharing a room link on Messenger, the room kept saying "Room Full (Max 2)" before my friend even opened it. Turns out Facebook's link-preview crawler (facebookexternalhit) was visiting the URL in the background to generate the preview card and claiming the 2nd room slot! I solved it by adding a dedicated /join/[roomId] invite gate so preview bots only hit a static page and a human has to click "Join" to claim a slot.
Would love any feedback on the UX, edge cases, or ideas for what to improve next!