Skip to content

A Spring Boot app for real-time notifications using WebSocket. It supports instant updates for chat, order tracking, collaboration, and alerts with a scalable design.

Notifications You must be signed in to change notification settings

18-RAJAT/Real-Time-Notifications-Springboot-Websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Real-Time Notifications System with Spring Boot and WebSocket

This repository demonstrates how to build a real-time notification system using Spring Boot and WebSocket. It is designed for instant updates in applications such as chat systems, order tracking, and admin-triggered notifications.


Features

  • Real-Time Communication: Bi-directional WebSocket communication between clients and the server.
  • Order Tracking System: Track order statuses in real-time with step-wise progress indicators.
  • Admin Dashboard: Allows admins to send bulk notifications or update order statuses.
  • Scalable Architecture: Designed for flexibility and growth, with optional integration for messaging queues.
  • Client Feedback System: Collect star ratings from users once orders are completed.


Flow1


Technologies Used

  1. Backend:
    • Spring Boot
    • WebSocket with STOMP for real-time communication
    • Maven for project management
  2. Frontend:
    • HTML, CSS, JavaScript for static clients
    • Font Awesome for icons
  3. Optional Enhancements:
    • Integration with RabbitMQ/Kafka for distributed messaging
    • RESTful APIs for further backend capabilities

Installation and Setup

Follow the steps below to set up and run the application:

Prerequisites

  • Java 17 or later installed
  • Maven installed
  • A web browser for testing the frontend clients

Steps

  1. Clone the repository:
    git clone https://github.com/18-RAJAT/Real-Time-Notifications-Springboot-Websocket.git
    cd Real-Time-Notifications-Springboot-Websocket
  2. Build the project:
    mvn clean install
  3. Run the application:
    mvn spring-boot:run
  4. Open the client files in a browser:
    • Client Page: Open client1.html from src/main/resources/templates/
    • Admin Panel: Open admin.html from the same directory

Screenshot 2024-12-24 134534

How It Works

WebSocket Connection

  • The server establishes WebSocket connections with clients using the STOMP protocol.
  • Clients subscribe to a notification topic (/status/notification) for real-time updates.

Order Tracker

  • Displays step-wise progress (e.g., "Order Received," "Order Dispatched").
  • Automatically updates client pages when order statuses are updated by the admin.

Admin Dashboard

  • Provides a simple interface for admins to trigger notifications.
  • Updates the status of orders in bulk or individually.

Rating System

  • Clients can rate their experience after an order is delivered.
  • Displays a star-based rating widget.

File Structure

src/
├── main/
│   ├── java/
│   │   └── com.rajat/
│   │       ├── config/
│   │       │   └── WebSocketConfig.java
│   │       ├── controller/
│   │       │   ├── NotificationController.java
│   │       └── NotificationSystemApplication.java
│   └── resources/
│       ├── static/
│       └── templates/
│           ├── admin.css
│           ├── admin.html
│           ├── admin.js
│           ├── client1.css
│           ├── client1.html
│           └── client1.js

About

A Spring Boot app for real-time notifications using WebSocket. It supports instant updates for chat, order tracking, collaboration, and alerts with a scalable design.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published