Creating a real-time chat system from scratch using WebSockets, Prisma, and PostgreSQL.
I'm building a full-stack collaborative app inspired by tools like Notion and Slack. The vision? Real-time chat, shared documents, and even AI features like summarizing and explaining content.
This is Part 1 of the journey โ where I built the chat system that powers real-time communication between users in the same room.
๐ ๏ธ Tech Stack
- Frontend: React + Tailwind CSS
- Backend: Node.js + Express
- Database: PostgreSQL (via Neon)
- ORM: Prisma
-
WebSocket:
ws
library
โจ Features
- โ Signup / Login / Logout with JWT
- โ Join or create chat rooms
- โ Real-time messaging via WebSockets
- โ Typing indicators (whoโs typing?)
- โ Messages stored in PostgreSQL
- โ Secure token-based auth
Each chat room works like a real-time space where users can message, see typing activity, and stay synced with others instantly.
๐ผ๏ธ Preview
๐ง Key Learnings
- WebSocket architecture for multiple rooms requires clean message protocols and user-session tracking.
- Prisma makes schema modeling and database integration straightforward.
- Building a custom typing indicator system was surprisingly fun!
๐ฎ Whatโs Next?
The chat system is just the beginning. Hereโs whatโs coming up:
- ๐ Collaborative documents with Tiptap + Hocuspocus
- ๐ค AI integration for:
- Chat summarization
- Contextual explanations of documents
This is shaping up to be a real-time, AI-powered team workspace tool.
๐ GitHub Repo
๐ Check out the code on GitHub
Thanks for reading! This is part of a devlog-style series where Iโll be building the entire app in public. If you're interested in collaborative tools, AI integration, or full-stack dev, follow along. ๐
Top comments (0)