Loading project...
Loading project...
Project
A real-time messaging application that allows users to connect, chat, and share messages instantly.
Overview
Features
User registration and login using Better Auth. Private messaging between users. Group conversations with multiple participants. Real-time message delivery using WebSockets. Online and offline presence indicators. Typing indicators during conversations. Message read receipts. Friend requests and friendship management. File and media sharing using Cloudinary. Message pagination for loading conversation history.
Implementation
I built the application using Next.js and TypeScript for the frontend and backend. Better Auth handles user authentication, while PostgreSQL and Prisma manage user accounts, conversations, messages, and friendships. I used WebSockets to establish persistent connections between the client and server. This allows the application to deliver messages, update online presence, and display typing indicators without repeatedly requesting new information. Cloudinary handles media storage, and message pagination makes it possible to load older messages without fetching an entire conversation at once.
Challenges
One challenge was managing real-time communication while keeping the database and user interface consistent. When users send messages, the application needs to save them, deliver them to the correct conversation, and update the interface without unnecessary delays. I worked on separating persistent data from temporary real-time events. Messages and conversation details are stored in PostgreSQL, while WebSockets handle immediate updates such as new messages, typing indicators, and online status. Another challenge was handling conversations with many messages. I introduced pagination so older messages could be loaded gradually instead of retrieving everything at once.
What I learned
Building Linky helped me understand WebSockets beyond basic examples. I learned more about managing real-time connections, organising database relationships, handling user sessions, and keeping the frontend synchronised with backend events. It also showed me how much planning is needed when several features depend on one another in a real-time application.