A real-time desktop messaging application built using Java, Swing, Socket Programming, Multithreading, JDBC, and MySQL.
ChatSphere enables multiple users to communicate instantly through a client-server architecture while maintaining persistent chat history in a MySQL database.
- Secure user authentication using MySQL
- Real-time one-to-one messaging
- Multi-client support using multithreading
- Persistent chat history storage
- Automatic chat history retrieval
- Dynamic user list loaded from database
- Client-server architecture using Java Sockets
- Modern Swing-based desktop interface
- Reconnect and refresh support
- Java Swing
- Java
- Socket Programming
- Multithreading
- MySQL
- JDBC
Client (Swing GUI)
|
| Socket Connection
|
Chat Server (Multithreaded)
|
| JDBC
|
MySQL
- User logs in using valid credentials.
- Client connects to the Chat Server.
- Server creates a dedicated thread for the client.
- Messages are exchanged in real time.
- Messages are stored in MySQL.
- Previous conversations are loaded automatically when a chat is opened.
The login interface allows users to authenticate using credentials stored in the MySQL database.
Real-time private messaging between connected users through a multithreaded socket server.
Previously exchanged messages are automatically loaded from the database when a conversation is opened.
git clone https://github.com/azhann-01/ChatSphere.git
cd ChatSphereCreate a MySQL database:
CREATE DATABASE ChatSphere;Update database credentials inside:
src/database/DBConnection.java
javac -cp "lib/*" -d . src/**/*.javajava -cp ".;lib/*" server.ChatServerjava -cp ".;lib/*" gui.LoginFrameAfter importing the database, you can log in using:
| Username | Password |
|---|---|
| admin | admin123 |
| alice | alice123 |
| bob | bob123 |
| charlie | charlie123 |
- Object-Oriented Programming
- Socket Programming
- Client-Server Architecture
- Multithreading
- Database Connectivity
- GUI Development
- Concurrent User Handling
- User Registration
- Password Hashing
- Online/Offline Status
- Message Timestamps
- File Sharing
- Group Chats
- Dark Mode
- End-to-End Encryption
Md Azhan
Computer Science Engineering Student
GitHub: https://github.com/azhann-01


