{"id":29193953,"url":"https://github.com/shoyeb45/lan-messenger-java-p2p-chat","last_synced_at":"2025-07-02T03:37:18.669Z","repository":{"id":292282697,"uuid":"980391820","full_name":"Shoyeb45/lan-messenger-java-p2p-chat","owner":"Shoyeb45","description":"🔥 Real-time P2P chat application for LAN networks built with Java Socket Programming.  Cross-platform messaging with auto-discovery, persistent storage, and modern Swing GUI.  Perfect for local network communication without internet dependency.","archived":false,"fork":false,"pushed_at":"2025-06-07T06:30:55.000Z","size":2082,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T07:43:08.759Z","etag":null,"topics":["chat-application","cross-platform","gui-application","java","java-networking","java-swing","lan-chat","lan-messenger","local-network","multithreading","netwo","p2p","peer-to-peer","socket-programming","swing-gui","tcp","udp"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shoyeb45.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-09T03:53:31.000Z","updated_at":"2025-06-07T06:39:55.000Z","dependencies_parsed_at":"2025-05-09T05:23:28.269Z","dependency_job_id":"2a3a7afd-7656-4b9a-baf6-edbb1b537dc0","html_url":"https://github.com/Shoyeb45/lan-messenger-java-p2p-chat","commit_stats":null,"previous_names":["shoyeb45/lan-messanger","shoyeb45/lan-messenger-java-p2p-chat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Shoyeb45/lan-messenger-java-p2p-chat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shoyeb45%2Flan-messenger-java-p2p-chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shoyeb45%2Flan-messenger-java-p2p-chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shoyeb45%2Flan-messenger-java-p2p-chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shoyeb45%2Flan-messenger-java-p2p-chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shoyeb45","download_url":"https://codeload.github.com/Shoyeb45/lan-messenger-java-p2p-chat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shoyeb45%2Flan-messenger-java-p2p-chat/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263071300,"owners_count":23409255,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chat-application","cross-platform","gui-application","java","java-networking","java-swing","lan-chat","lan-messenger","local-network","multithreading","netwo","p2p","peer-to-peer","socket-programming","swing-gui","tcp","udp"],"created_at":"2025-07-02T03:37:18.045Z","updated_at":"2025-07-02T03:37:18.654Z","avatar_url":"https://github.com/Shoyeb45.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **LAN Messenger: Real-Time Peer-to-Peer Chat Application**\n\n![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge\u0026logo=openjdk\u0026logoColor=white)  ![Java Swing](https://img.shields.io/badge/Java%20Swing-%23007396.svg?style=for-the-badge\u0026logoColor=white)  ![Socket Programming](https://img.shields.io/badge/Socket%20Programming-%2334A853.svg?style=for-the-badge\u0026logoColor=white)  ![Multithreading](https://img.shields.io/badge/Multithreading-%23FF6F00.svg?style=for-the-badge\u0026logoColor=white)  ![Real-time Messaging](https://img.shields.io/badge/Real--time%20Messaging-%239C27B0.svg?style=for-the-badge\u0026logoColor=white)  ![LAN Networking](https://img.shields.io/badge/LAN%20Networking-%2300BCD4.svg?style=for-the-badge\u0026logoColor=white)  ![P2P Communication](https://img.shields.io/badge/P2P%20Communication-%23F44336.svg?style=for-the-badge\u0026logoColor=white)  ![Cross-platform GUI](https://img.shields.io/badge/Cross--platform%20GUI-%232196F3.svg?style=for-the-badge\u0026logoColor=white)\n\nA **powerful peer-to-peer Java chat application** designed for seamless communication between devices on the same Local Area Network (LAN). Built with advanced **Socket programming**, **multithreading**, and an intuitive **Swing GUI** for cross-platform compatibility.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/LANMLogo.png\" alt=\"LAN Messenger Logo\"\u003e\n\u003c/p\u003e\n\n---\n\n## 🚀 Key Features\n\n### ✨ **What Makes LAN Messenger Special?**\n\n🔥 **Zero Internet Required** - Works entirely on your local network  \n⚡ **Real-time Communication** - Instant message delivery with TCP protocol  \n🔍 **Auto Friend Discovery** - Automatically find other users on your network  \n💾 **Persistent Chat History** - All conversations saved locally and securely  \n🎨 **Modern Single-Page Interface** - React-inspired design with smooth navigation  \n📱 **Fully Responsive** - Adapts to any screen size and resolution  \n🌐 **Cross-Platform Compatible** - Works on Windows, macOS, and Linux  \n\n---\n\n## 📦 Quick Downloads\n\n**Ready-to-use installers for popular operating systems:**\n\n💻 **[Windows Installer (.exe)](https://yourhost.com/lanmessanger/installer.exe)** - One-click installation  \n🍎 **[macOS App Bundle (.dmg)](https://yourhost.com/lanmessanger/lanmessenger.dmg)** - Drag and drop installation  \n\n**Need support for other platforms?** Contact us at: [shoyebff45@gmail.com](mailto:shoyebff45@gmail.com)\n\n---\n\n## 🎯 Core Features Deep Dive\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/demo1.png\" alt=\"LAN Messenger Start Page\"\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eClean and intuitive start page\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n### 1. **Modern Single-Page Application (SPA)**\nBuilt with a contemporary approach similar to modern web applications, featuring:\n- **State Management**: React-inspired state handling using Java interfaces and classes\n- **Smooth Navigation**: Seamless page transitions without window reloads\n- **Enhanced UX**: Improved accessibility and user experience\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/demo2.png\" alt=\"Navigation Interface\"\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eIntuitive navigation bar for easy access to all features\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n### 2. **Intelligent Friend Discovery**\nAdvanced network scanning capabilities:\n- **UDP Protocol**: Lightning-fast user detection on the same network\n- **Real-time Updates**: Automatically refreshes available users\n- **Zero Configuration**: Works out-of-the-box without manual setup\n\n\u003cp style=\"display: flex; gap: 4px; justify-content: center;\"\u003e\n  \u003cimg src=\"./public/images/readme/demo3.png\" width=\"500\" alt=\"Friend Discovery\"\u003e\n  \u003cimg src=\"./public/images/readme/demo4.png\" width=\"200\" alt=\"User List\"\u003e\n\u003c/p\u003e\n\n### 3. **Secure Local Storage**\nYour data remains private and secure:\n- **JSON Storage**: Efficient data serialization using GSON library\n- **Local-Only**: All data stored exclusively on your device\n- **Persistent History**: Conversations and friend lists automatically saved\n\n\u003cp style=\"display: flex; gap: 10px; justify-content: center;\"\u003e\n  \u003cimg src=\"./public/images/readme/data1.png\" width=\"300\" alt=\"Data Structure\"\u003e\n  \u003cimg src=\"./public/images/readme/data2.png\" height=\"190\" width=\"300\" alt=\"Local Storage\"\u003e\n\u003c/p\u003e\n\n### 4. **Manual Friend Addition**\nFlexible friend management:\n- **IP Address Support**: Add friends directly using their IP address\n- **Friend Requests**: Secure friend request system\n- **Contact Management**: Easy-to-use friend list interface\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/demo5.png\" alt=\"Add Friend Interface\"\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eSimple and secure friend addition process\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n### 5. **Responsive Design**\nAdapts to any screen configuration:\n- **Dynamic Layouts**: Automatically adjusts to window resizing\n- **Multi-Resolution Support**: Works on various screen sizes\n- **Consistent Experience**: Maintains functionality across different dimensions\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/demo6.png\" alt=\"Responsive Design\"\u003e\n\u003c/p\u003e\n\n### 6. **Real-Time Messaging**\nExperience instant communication:\n- **TCP Protocol**: Reliable message delivery\n- **Multi-threading**: Smooth performance without UI freezing\n- **Live Status Updates**: See when friends are online and available\n\n---\n\n## 🏗️ Project Architecture\n\n**Modular design for maximum maintainability and scalability:**\n\n```plaintext\n📁 LAN-Messenger/\n├── 📁 lib/                        # External JAR dependencies\n├── 📁 public/                     # Static assets and images\n│   └── 📁 images/\n│       ├── 📁 app/               # Application icons and graphics\n│       └── 📁 readme/            # Documentation images\n└── 📁 src/\n    └── 📁 main/\n        └── 📁 java/\n            └── 📁 com/\n                └── 📁 lanmessanger/\n                    ├── 📁 app/           # Application entry point and configuration\n                    ├── 📁 database/      # Data persistence and management\n                    ├── 📁 models/        # Data models and entity schemas\n                    ├── 📁 network/       # Core networking functionality\n                    │   ├── 📁 client/           # Client-side communication\n                    │   ├── 📁 clientHandler/    # Connection management\n                    │   ├── 📁 discovery/        # Network discovery logic\n                    │   └── 📁 server/           # Server-side operations\n                    └── 📁 ui/            # User interface components\n                        ├── 📁 components/        # Reusable UI components\n                        │   ├── 📁 addFriendPage/\n                        │   ├── 📁 chatPage/\n                        │   ├── 📁 navBar/\n                        │   └── 📁 scannerPage/\n                        ├── 📁 pages/            # Application pages\n                        ├── 📁 router/           # SPA-style navigation\n                        ├── 📁 state/            # Centralized state management\n                        └── 📁 utils/            # Helper utilities\n```\n\n### 📋 **Architecture Overview**\n\n| Component | Responsibility | Key Features |\n|-----------|----------------|--------------|\n| **`app/`** | Application lifecycle and global configuration | Launch logic, settings management |\n| **`network/`** | Core networking operations | Socket programming, P2P connections, discovery |\n| **`ui/`** | User interface and user experience | Swing components, responsive design |\n| **`models/`** | Data structures and persistence | Entity definitions, JSON serialization |\n| **`database/`** | Local data management | Friend lists, chat history, user preferences |\n\n---\n\n## 🛠️ Technology Stack\n\n### **Core Technologies**\n- **☕ Java 17+** - Modern Java features and performance optimizations\n- **🎨 Java Swing** - Cross-platform GUI framework (`javax.swing`)\n- **🌐 Java Networking** - Socket programming with TCP/UDP protocols (`java.net`)\n- **⚡ Collections Framework** - Efficient data structure management\n- **📄 Gson Library** - JSON serialization and deserialization (`com.google.gson`)\n- **🎯 Ikonli FontAwesome** - Modern icon pack (`org.kordamp.ikonli`)\n\n### **Development Tools**\n- **💻 VS Code IDE** - Modern development environment\n- **📚 Git \u0026 GitHub** - Version control and collaboration\n- **🔧 Maven** - Dependency management and build automation\n\n---\n\n## 🚀 Quick Start Guide\n\n### **Prerequisites**\nEnsure you have Java 17 or higher installed:\n```bash\njava --version\n```\n\n### **Installation \u0026 Setup**\n\n1. **Clone the Repository**\n   ```bash\n   git clone https://github.com/Shoyeb45/lan-messanger.git\n   cd lan-messenger\n   ```\n\n2. **Development Setup (VS Code)**\n   - Install [Extension Pack for Java by Microsoft](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack)\n   - Navigate to `src/main/java/com/lanmessanger/Main.java`\n   - Click the **Run** button above the main method\n\n   \u003cp align=\"center\"\u003e\n     \u003cimg src=\"./public/images/readme/runMain.png\" width=\"450px\" alt=\"Running the application in VS Code\"\u003e\n   \u003c/p\u003e\n\n3. **Alternative Build Methods**\n   ```bash\n   # Using Maven (if pom.xml is configured)\n   mvn clean compile exec:java\n   \n   # Direct compilation (for simple setups)\n   javac -cp \"lib/*:src\" src/main/java/com/lanmessanger/Main.java\n   java -cp \"lib/*:src\" com.lanmessanger.Main\n   ```\n\n### **Contributing**\n\nWe welcome contributions! Here's how to get started:\n\n1. **Create a Feature Branch**\n   ```bash\n   git checkout -b feature/your-feature-name\n   ```\n\n2. **Implement Your Feature**\n   - Write clean, documented code\n   - Test thoroughly on multiple platforms\n   - Follow existing code style conventions\n\n3. **Submit Your Changes**\n   ```bash\n   git add .\n   git commit -m \"Add: your feature description\"\n   git push origin feature/your-feature-name\n   ```\n\n4. **Create a Pull Request**\n   - Include detailed description of changes\n   - Add screenshots for UI changes\n   - Reference any related issues\n\n---\n\n## 🔧 How It Works\n\n### **Network Architecture**\n\nLAN Messenger implements a sophisticated **peer-to-peer networking model**:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/P2PLANMessanger.png\" width=\"500\" alt=\"P2P Network Architecture\"\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eDecentralized P2P communication between LAN Messenger instances\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n**Key Networking Features:**\n- **TCP Protocol**: Reliable message delivery with connection-oriented communication\n- **UDP Discovery**: Fast and lightweight user detection broadcasts\n- **Multi-threading**: Concurrent handling of multiple connections\n- **Dual Role Architecture**: Each instance acts as both client and server\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/EachInstance.png\" width=\"450\" alt=\"Client-Server Architecture\"\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eEach instance simultaneously operates as client and server\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n### **User Interface Architecture**\n\nBuilt with a modern, component-based approach:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./public/images/readme/uilogic.png\" width=\"550\" alt=\"UI Architecture\"\u003e\n  \u003cp align=\"center\"\u003e\u003cem\u003eHierarchical component structure with centralized state management\u003c/em\u003e\u003c/p\u003e\n\u003c/p\u003e\n\n**UI Design Principles:**\n- **Single Page Application**: Smooth navigation without window refreshes\n- **Component Reusability**: Modular design for maintainable code\n- **State Management**: Centralized application state similar to modern web frameworks\n- **Responsive Layout**: Dynamic adaptation to different screen sizes\n\n---\n\n## 🧪 Testing Guide\n\n### **Local Testing Setup**\n\n**Requirements:**\n- Two or more devices on the same Wi-Fi network\n- LAN Messenger installed on each device\n\n**Step-by-Step Testing:**\n\n1. **Launch Application**\n   - Open LAN Messenger on both devices\n   - Ensure both devices are connected to the same network\n\n2. **Establish Connection**\n   - On Device A: Navigate to \"Add Friend\" page\n   - Enter the IP address of Device B\n   - Click \"Add Friend\"\n\n3. **Accept Friend Request**\n   - Device B will receive a friend request notification\n   - Accept the request to establish connection\n\n4. **Test Messaging**\n   - Send messages between devices\n   - Verify real-time delivery and persistence\n   - Test various message types and lengths\n\n**Success Indicators:**\n- ✅ Real-time message delivery\n- ✅ Message persistence after app restart\n- ✅ Online/offline status updates\n- ✅ Stable connection during extended use\n\n---\n\n## 💻 Platform Support\n\n| Platform | Status | Notes |\n|----------|---------|-------|\n| **Windows 10/11** | ✅ Full Support | Native installer available |\n| **macOS** | ✅ Full Support | DMG package available |\n| **Linux (Ubuntu/Debian)** | ✅ Full Support | JAR executable |\n| **Linux (Other Distros)** | ✅ Compatible | May require Java installation |\n\n### **System Requirements**\n- **Java Runtime**: Version 17 or higher\n- **RAM**: Minimum 512MB available\n- **Network**: Active LAN/Wi-Fi connection\n- **Storage**: 50MB free space\n\n---\n\n## 📚 Additional Resources\n\n### **Learning Resources**\n- [Java Socket Programming Guide](https://www.baeldung.com/a-guide-to-java-sockets)\n- [Java Swing Tutorial by Bro Code](https://www.youtube.com/@BroCodez)\n- [Multithreading in Java](https://docs.oracle.com/javase/tutorial/essential/concurrency/)\n\n### **Documentation**\n- [Java Networking API](https://docs.oracle.com/javase/8/docs/api/java/net/package-summary.html)\n- [Gson Documentation](https://github.com/google/gson/blob/master/UserGuide.md)\n- [Maven Build Lifecycle](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html)\n\n---\n\n## 🙏 Acknowledgments\n\n### **Special Thanks**\n- **[Professor Zabi](https://www.linkedin.com/in/syedzaabii/)** - Academic guidance and mentorship\n- **[Baeldung](https://www.baeldung.com/)** - Comprehensive Java Socket programming tutorials\n- **[Bro Code](https://www.youtube.com/@BroCodez)** - Excellent Java Swing video tutorials\n- **AI Assistants** - Code review, debugging assistance, and optimization suggestions\n- **[Linus Torvalds](https://github.com/torvalds)** - For creating Git, enabling collaborative development\n\n### **Open Source Libraries**\n- **Google Gson** - JSON serialization library\n- **Ikonli** - Icon pack integration\n- **Java Development Kit** - Core runtime and development tools\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for complete details.\n\n**Key Points:**\n- ✅ Commercial use allowed\n- ✅ Modification and distribution permitted  \n- ✅ Private use encouraged\n- ❗ No warranty provided\n\n---\n\n## 🔗 Connect \u0026 Support\n\n**Found this project helpful?** ⭐ **Star the repository** to show your support!\n\n**Questions or Issues?** 📧 **[shoyebff45@gmail.com](mailto:shoyebff45@gmail.com)**\n\n**Want to Contribute?** 🚀 **Check out our [Contributing Guidelines](#contributing)**\n\n---\n\n**Keywords:** LAN Messenger, Java Chat Application, P2P Messaging, Local Network Communication, Socket Programming, Real-time Chat, Cross-platform Messaging, Network Discovery, Peer-to-Peer, Java Swing GUI, TCP/UDP Protocol, Multithreading, Local Area Network, Instant Messaging, Java Networking","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoyeb45%2Flan-messenger-java-p2p-chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshoyeb45%2Flan-messenger-java-p2p-chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshoyeb45%2Flan-messenger-java-p2p-chat/lists"}