Skip to content

jose-barroso/chatapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗨️ ChatApp – Local Web Chatroom using Spring Boot & WebSockets

Java Spring Boot WebSocket License

ChatApp is a simple local network chatroom application built with Java 17, Spring Boot, and WebSockets. It enables real-time, bidirectional messaging between clients on the same LAN using STOMP over WebSocket.


🚀 Technologies Used

  • ☕ Java JDK 17
  • 🌱 Spring Boot 3.5.3
  • 🔄 WebSocket (STOMP protocol)
  • 🧩 SockJS (WebSocket fallback)
  • ✍️ Lombok
  • 📦 Maven

⚙️ Features

  • 💬 Real-time messaging over LAN
  • 🔁 Bi-directional communication using WebSockets
  • 🕒 Timestamped messages
  • ⚡ Lightweight Spring-based architecture
  • 🎨 Fully functional front-end (HTML, CSS, JS)

📁 Project Structure

chatapp/
├── src/
│   └── main/
│       ├── java/com/jose/chatapp/
│       │   ├── config/WebSocketConfig.java       # WebSocket configuration
│       │   ├── controller/ChatController.java    # Message handler
│       │   ├── model/ChatMessage.java            # Message model
|       |   └── ChatappApplication.java           # main()
│       └── resources/static/
│           ├── index.html                        # Web UI
│           ├── app.js                            # Front-end logic
│           └── main.css                          # Stylesheet
├── pom.xml                                       # Maven dependencies and build
└── README.md                                     # Project documentation

▶️ How to Run

✅ Prerequisites

  • Java 17+
  • Maven

🚦 Steps

git clone https://github.com/your-username/chatapp.git
cd chatapp
mvn spring-boot:run

Then open http://localhost:8080 in your browser.


📡 How It Works

  1. Clients connect to the WebSocket endpoint at /ws (with SockJS fallback).
  2. Messages are sent to /app/chat.
  3. The server adds a timestamp and broadcasts the message to all subscribers on /topic/messages.
  4. The front-end receives and displays messages in real time.

🔐 Limitations & Security Notes

  • Works only on the local network (LAN).

  • ❌ No authentication or message persistence.

  • ⚠️ Messages are not encrypted — use only for learning or internal LAN communication.

  • Can be extended with:

    • JWT Authentication
    • HTTPS support
    • User login system
    • Chat rooms

🌱 Future Improvements

  • 👥 Private & group chats (chat rooms)
  • 🔐 User authentication & login
  • 🔒 Encrypted TLS communication
  • 💡 Front-end revamp (React, Angular, etc.)
  • 💾 Message history persistence

📝 License

MIT License © José Barroso


About

Web chat made in java, made with Spring Boot and Web Sockets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors