This is a real-time chat application built with a Spring Boot backend and a Next.js frontend. It uses WebSockets for instant message delivery.
/backend-springboot: Contains the Spring Boot application for the chat server./frontend-nextjs: Contains the Next.js application for the chat client.
Before you begin, ensure you have the following installed:
- Java Development Kit (JDK) 21 or later
- Apache Maven
- Node.js (which includes npm) or Yarn / pnpm / Bun
The backend server handles WebSocket connections, user management, and message broadcasting.
To run the backend:
- Navigate to the backend directory:
cd backend-springboot - Run the Spring Boot application using Maven:
The backend server will typically start on
mvn spring-boot:run
http://localhost:8080.
The frontend provides the user interface for chatting.
To run the frontend:
- Navigate to the frontend directory:
cd frontend-nextjs - Install the dependencies:
npm install # or # yarn install # or # pnpm install # or # bun install
- Start the development server:
The frontend application will typically start on
npm run dev # or # yarn dev # or # pnpm dev # or # bun dev
http://localhost:3000. Open this URL in your browser.
- Java 21
- Spring Boot 3
- Spring WebSocket
- Maven
- Lombok
- Next.js 15
- React 19
- TypeScript
- Tailwind CSS
- SockJS Client
- StompJS
- Shadcn/ui (components like Card, Button, Input, etc.)
- The Next.js frontend connects to the Spring Boot backend via WebSockets (using SockJS and StompJS).
- Users enter a username to join the chat.
- When a user sends a message, it's sent to the backend over the WebSocket connection.
- The backend broadcasts the message to all connected clients.
- The frontend receives the message and displays it in the chat interface.
- Real-time messaging using WebSockets.
- User-friendly interface built with Next.js and Tailwind CSS.
- Simple username-based entry to chat rooms.
- Scalable backend built with Spring Boot.
- Modern tech stack including Java 21, Next.js 15, and React 19.