{"id":27942045,"url":"https://github.com/secretdeveloperisme/qtchatapp","last_synced_at":"2025-10-28T02:01:41.461Z","repository":{"id":290965431,"uuid":"869654616","full_name":"secretdeveloperisme/QtChatApp","owner":"secretdeveloperisme","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-09T13:59:58.000Z","size":272,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T11:32:53.158Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/secretdeveloperisme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-10-08T16:54:43.000Z","updated_at":"2024-10-09T14:00:01.000Z","dependencies_parsed_at":"2025-05-01T16:34:12.027Z","dependency_job_id":"244f861b-16d5-436d-b447-929b6fb9a0ae","html_url":"https://github.com/secretdeveloperisme/QtChatApp","commit_stats":null,"previous_names":["linhplus/qtchatapp","secretdeveloperisme/qtchatapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/secretdeveloperisme/QtChatApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretdeveloperisme%2FQtChatApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretdeveloperisme%2FQtChatApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretdeveloperisme%2FQtChatApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretdeveloperisme%2FQtChatApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/secretdeveloperisme","download_url":"https://codeload.github.com/secretdeveloperisme/QtChatApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/secretdeveloperisme%2FQtChatApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281371797,"owners_count":26489526,"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","status":"online","status_checked_at":"2025-10-28T02:00:06.022Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-05-07T11:26:03.369Z","updated_at":"2025-10-28T02:01:41.421Z","avatar_url":"https://github.com/secretdeveloperisme.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Qt Chat Application**\n\nA simple chat application developed using C++ and Qt, supporting basic chat features such as group messaging and message history retrieval. This project demonstrates the use of TCP/IP for client-server communication and SQLite for message storage.\n## **Application UI**\n**Chat user interface** \\\n![Chat UI](Documents/Chat_UI.png)\n\n**Server control user interface** \\\n![Server Control UI](Documents/ServerControl_UI.png)\n\n## **Key Features**\n- **Group Chat**: Send and receive messages in chat groups.\n- **Message History**: Retrieve past messages from a group.\n- **Lightweight Communication**: Custom packet structure for efficient message exchange over TCP.\n\n## **Technologies Used**\n- **C++** (for business logic)\n- **Qt Framework** (for UI and TCP communication)\n- **SQLite** (for database storage)\n- **TCP/IP Protocol** (for network communication)\n\n\n## **Class Structure**\n\n### **1. ChatClient**\nHandles client-side operations such as sending and receiving messages, and retrieving message history from the server.\n\n### **2. ChatServer**\nManages client connections, broadcasts messages to appropriate groups, and handles message storage.\n\n### **3. ChatDatabaseManager**\nResponsible for performing database operations (message storage and retrieval, user and group management).\n\n### **4. MessagePacket**\nRepresents a packet used to send and receive data over TCP/IP. It encapsulates the message content, operation codes, and delimiters.\n\n### **5. Message**\nRepresents an individual message with details like `id`, `ownerId`, `groupId`, `content`, and `createdDate`.\n\n## **Packet Structure**\n\nThe communication between the client and server is handled using a simple packet structure:\n\n### **Packet Format**\n| Section           | Size          | Description                                                        |\n|-------------------|---------------|--------------------------------------------------------------------|\n| Start Section      | 2 bytes       | A fixed sequence `\\n\\r` indicating the start of a packet.           |\n| Opcode             | 1 byte        | Represents the operation being performed (e.g., SEND, REQUEST).     |\n| JSON Message       | Variable      | JSON-formatted string with the message or group data.               |\n| End Section        | 2 bytes       | A fixed sequence `\\r\\n` marking the end of the packet.              |\n\n### **Opcodes**\n- `SEND (0x12)`: Send a message.\n- `REQUEST_MESSAGES (0x13)`: Request past messages from a group.\n- `GET_MESSAGES (0x14)`: Retrieve and send past messages.\n- `REQUEST_GROUPS (0x15)`: Request a list of groups.\n- `GET_GROUPS (0x16)`: Retrieve and send the list of groups.\n\n### **Example Packet**\nA packet to send a message:\n```\n\\n\\r 0x12 {\"ownerId\":1,\"groupId\":5,\"content\":\"Hello!\"} \\r\\n\n```\n\n## **Database Structure**\n![Database Schema](Documents/ChatApplication-Database.png)  \nThe application uses SQLite for message storage with tables for:\n- **Users**: Stores user details.\n- **Groups**: Stores group details.\n- **Messages**: Stores message content with fields like `id`, `ownerId`, `groupId`, `content`, and `createdDate`.\n\n## **Future Enhancements**\n- **User Authentication**: Implement login functionality.\n- **File Sharing**: Add support for file sharing in group chats.\n- **Notifications**: Implement real-time notifications for new messages.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretdeveloperisme%2Fqtchatapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsecretdeveloperisme%2Fqtchatapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsecretdeveloperisme%2Fqtchatapp/lists"}