{"id":19518676,"url":"https://github.com/mahdi-eth/real-time-chat-app","last_synced_at":"2025-04-15T21:45:50.372Z","repository":{"id":254666910,"uuid":"847208951","full_name":"mahdi-eth/real-time-chat-app","owner":"mahdi-eth","description":"A real-time chat application built with Go, WebSockets, and Redis. This project demonstrates how to implement a scalable chat system with real-time messaging capabilities and chat history management. The application features a WebSocket service for real-time communication and a history storage service that manages chat history efficiently.","archived":false,"fork":false,"pushed_at":"2024-08-25T06:56:14.000Z","size":10,"stargazers_count":21,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T21:45:04.872Z","etag":null,"topics":["docker","go","golang","real-time","redis","socket","websockets"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mahdi-eth.png","metadata":{"files":{"readme":"README.MD","changelog":"history-storage-service/.env","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}},"created_at":"2024-08-25T06:49:41.000Z","updated_at":"2025-02-09T07:16:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"2cf547c0-8894-4fc7-8f65-3b24ebb667d9","html_url":"https://github.com/mahdi-eth/real-time-chat-app","commit_stats":null,"previous_names":["mahdi-eth/real-time-chat-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahdi-eth%2Freal-time-chat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahdi-eth%2Freal-time-chat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahdi-eth%2Freal-time-chat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mahdi-eth%2Freal-time-chat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mahdi-eth","download_url":"https://codeload.github.com/mahdi-eth/real-time-chat-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249161075,"owners_count":21222464,"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":["docker","go","golang","real-time","redis","socket","websockets"],"created_at":"2024-11-11T00:13:53.233Z","updated_at":"2025-04-15T21:45:50.352Z","avatar_url":"https://github.com/mahdi-eth.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Real-Time Chat Application\n\nWelcome to the **Real-Time Chat Application**! This project showcases a real-time chat system implemented using Go, WebSockets, and Redis. It is designed to demonstrate scalable and efficient real-time messaging and chat history management. \n\n## Overview\n\nThis application consists of three main components:\n\n1. **WebSocket Service**: Handles real-time messaging between users. It also fetches chat history when a new user joins.\n2. **History Storage Service**: Stores chat messages in Redis and provides an endpoint to fetch chat history.\n3. **Redis**: Acts as a message broker and storage backend for chat messages.\n\n## Features\n\n- **Real-Time Messaging**: Enables instant communication between users using WebSockets.\n- **Chat History Management**: Stores and retrieves chat messages in chronological order.\n- **Dockerized Services**: Each component runs in its own Docker container for easy deployment and scalability.\n\n## Architecture\n\n1. **WebSocket Service**:\n   - Handles WebSocket connections.\n   - Publishes new messages to the Redis `chat_channel`.\n   - Fetches chat history from the History Storage Service and sends it to clients on connection.\n\n2. **History Storage Service**:\n   - Subscribes to Redis `chat_channel`.\n   - Saves incoming messages to the `chat_history` list in Redis.\n   - Provides an HTTP endpoint to fetch chat history.\n\n3. **Redis**:\n   - Acts as a message broker with Pub/Sub functionality.\n   - Stores chat history with no expiration.\n\n## Getting Started\n\n### Prerequisites\n\n- Docker and Docker Compose installed on your machine.\n- Basic understanding of Go, WebSockets, and Redis.\n\n### Setup\n\n1. **Clone the Repository**:\n   ```bash\n   git clone https://github.com/mahdi-eth/real-time-chat-app.git\n   cd real-time-chat-app\n   ```\n\n2. **Build and Start Services**:\n   ```bash\n   docker-compose up --build\n   ```\n   This command will build Docker images for the WebSocket and History Storage services, and start all services defined in the docker-compose.yml file.\n\n3. **Testing the Application**:\n- Open your WebSocket client (such as WebSocket King Client or postman) and connect to ws://localhost:8080/ws.\n\n- Send messages and see real-time communication in action.\n\n- New connections will receive chat history automatically.\n\n\u003chr\u003e\n\nThank you for checking out the Real-Time Chat Application. We hope you find it useful and informative!\n\nHappy coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahdi-eth%2Freal-time-chat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmahdi-eth%2Freal-time-chat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmahdi-eth%2Freal-time-chat-app/lists"}