Skip to content

Arzu-N/websocket-graphql-chat

Repository files navigation

queryy mutation # Real-Time Chat Application

A real-time chat application built with Spring Boot, GraphQL, and WebSocket (STOMP + SockJS).


Features

  • Real-time messaging using WebSocket
  • GraphQL API for fetching and sending messages
  • REST-style GraphQL endpoint (/graphql)
  • Live chat updates via /topic/message
  • Simple frontend with HTML + JavaScript

Technologies

  • Java 21
  • Spring Boot
  • Spring GraphQL
  • Spring WebSocket (STOMP)
  • SockJS
  • HTML, JavaScript

API Overview

GraphQL Endpoint

POST /graphql

Example Query

{
  messages {
    sender
    content
  }
}
Example Mutation
mutation {
  sendMessage(sender: "Arzu", content: "Hello") {
    sender
    content
  }
}

WebSocket Endpoint

/ws

Topic

/topic/message

How it works

User sends message via WebSocket or GraphQL mutation Backend processes message Message is broadcast to all connected clients via /topic/message Frontend updates chat in real-time

📌 Author

Built by Arzu

screen

About

Realtime application using GraphQL,WebSocket and Spring Boot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors