Project case study · Letter
Letter: a real-time chat application with Next.js and STOMP
Sourav Kumar Nayak built Letter, a real-time messaging application with a Next.js frontend that uses STOMP over SockJS to communicate with a chat backend.
Project overview
Letter is a real-time chat application. Its frontend repository documents Next.js 15, React 19, TypeScript, Tailwind CSS, STOMP.js, and SockJS. Listed features include JWT-based login, online/offline user status, message history, protected routes, and topic-based messaging. The README points to a separately hosted backend container; it does not document the backend database schema.
Architecture and system design
The Next.js frontend integrates with a backend API configured through NEXT_PUBLIC_API_URL and uses STOMP over SockJS for real-time messaging. The README describes separate API responsibilities for authentication, message retrieval and sending, and user management. A separate backend Docker image is linked from the repository.
- Next.js and React interface: Provides the typed chat interface and user-facing application routes.
- JWT authentication: The README documents login, protected routes, and token refresh behavior.
- STOMP over SockJS: Supports real-time messaging, topic subscriptions, and reconnection behavior.
- Backend API: Handles authentication, message operations, and user management; its deployment is linked separately.
Next.js chat frontend
-> Backend API (authentication and message operations)
-> STOMP over SockJS (real-time topics)
-> User interface updatesThis summarizes the frontend and backend responsibilities documented by the project; it is not a code excerpt.
Engineering decisions and challenges
Combining API requests with live messaging
The documented client uses an API for account and message operations, alongside STOMP subscriptions for real-time updates.
Handling connection interruptions
The README lists automatic reconnection and SockJS transport as part of the real-time client experience.
Keeping endpoint configuration external
The frontend reads its API endpoint from NEXT_PUBLIC_API_URL, allowing deployment environments to provide their backend URL.
Technology stack
This project is part of Sourav Kumar Nayak's portfolio as a Java Developer, Spring Boot Developer, AI Automation Engineer, and Full-Stack Developer. The linked repository provides the source and project-specific setup details.