{"id":23177647,"url":"https://github.com/dimitrisniras/chat-app","last_synced_at":"2026-06-23T23:31:48.636Z","repository":{"id":257399493,"uuid":"858073331","full_name":"dimitrisniras/chat-app","owner":"dimitrisniras","description":"Simple Websockets Chat application using Rust","archived":false,"fork":false,"pushed_at":"2024-09-16T17:08:00.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T01:42:24.900Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dimitrisniras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-09-16T09:01:10.000Z","updated_at":"2024-09-16T17:08:01.000Z","dependencies_parsed_at":"2024-09-16T13:53:23.140Z","dependency_job_id":"b58f4fff-5a1a-4ded-99fb-b573944e2a1c","html_url":"https://github.com/dimitrisniras/chat-app","commit_stats":null,"previous_names":["dimitrisniras/chat-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dimitrisniras/chat-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrisniras%2Fchat-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrisniras%2Fchat-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrisniras%2Fchat-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrisniras%2Fchat-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimitrisniras","download_url":"https://codeload.github.com/dimitrisniras/chat-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimitrisniras%2Fchat-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34711176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-23T02:00:07.161Z","response_time":65,"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":"2024-12-18T06:35:58.490Z","updated_at":"2026-06-23T23:31:48.619Z","avatar_url":"https://github.com/dimitrisniras.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rust Chat API\n\nA scalable chat API built with Rust, utilizing WebSockets for real-time communication and MongoDB for persistent message storage.\n\n## Features\n\n- **Real-time chat:** Leverages WebSockets for instant message delivery and updates.\n- **Persistent storage:** Stores chat messages in a MongoDB database for future retrieval.\n- **Scalable architecture:** Designed with asynchronous programming and modular structure to handle a high volume of concurrent connections.\n- **Error handling:** Implements custom error types and centralized error handling for graceful error responses.\n- **Logging:** Utilizes structured logging for debugging and monitoring.\n- **CI/CD:** Integrates with GitHub Actions for automated build, test, and deployment.\n\n## Prerequisites\n\n- **Rust:** Make sure you have Rust and Cargo installed on your system. You can follow the instructions at [https://www.rust-lang.org/tools/install](https://www.rust-lang.org/tools/install)\n- **MongoDB:** You'll need a running MongoDB instance. You can download and install it from [https://www.mongodb.com/try/download/community](https://www.mongodb.com/try/download/community)\n\n## Setup\n\n1. **Clone the repository:**\n\n   ```bash\n   git clone \u003crepository-url\u003e\n   cd chat-app\n   ```\n\n2. **Set up environment variables:**\n\n    - Create a `.env` file in the project's root directory.\n    - Add the following environment variables:\n\n        ```bash\n        MONGODB_URI=\"mongodb://localhost:27017\"  # Replace with your MongoDB connection URI\n        MONGODB_DATABASE=\"chat_app\"              # Replace with your desired database name\n        MONGODB_COLLECTION=\"messages\"            # Replace with your desired collection name\n        SERVER_URL=\"127.0.0.1\"                   # Replace with your server's URL\n        SERVER_PORT=\"8080\"                       # Replace with your desired port number\n        RUST_LOG=\"info\"                          # Set the desired log level (info, debug, etc.)\n        ```\n\n3. **Build and run:**\n\n    ```bash\n    make build  # Build the project\n    make run    # Run the server\n    ```\n\n## Running with Docker\n\nYou can use Docker and Docker Compose to easily build and run the chat API in a containerized environment.\n\n### Requirements\n\n- **Docker:** Make sure you have Docker and Docker Compose installed on your system. You can follow the instructions at [https://docs.docker.com/get-docker/](https://docs.docker.com/get-docker/)\n\n### Steps\n\n1. **Build the Docker images:**\n\n   ```bash\n   make docker-build\n   ```\n\n2. **Start the containers:**\n\n    ```bash\n    make docker-up\n    ```\n\n3. **Access the application:**\n\n    - The chat API should now be accessible at `http://localhost:8080`.\n    - You can connect to the MongoDB instance using `mongodb://localhost:27017`\n\n4. **Stop the containers:**\n\n    ```bash\n    make docker-down\n    ```\n\n5. View logs:\n\n    ```bash\n    make docker-logs\n    ```\n\n## Usage\n\n1. **Connect to the WebSocket server:**\n\n    - Use a WebSocket client library or tool to connect to `ws://SERVER_URL:SERVER_PORT` (replace `SERVER_URL` and `SERVER_PORT` with the values from your `.env` file).\n\n2. **Send and receive messages:**\n\n    - The server expects messages in the following JSON format:\n\n        ```json\n        {\n            \"username\": \"your_username\",\n            \"content\": \"your_message\",\n            \"timestamp\": 1694844257\n        }\n        ```\n\n    - When a client sends a message, the server will broadcast the updated list of all messages to all connected clients.\n\n## Contributing\n\nContributions are welcome! Please feel free to open issues or submit pull requests.\n\n## License\n\nThis project is licensed under the Apache-2.0 License.\n\n**Remember:**\n\n- Replace placeholders like `\u003crepository-url\u003e`, `your_username`, and `your_message` with actual values.\n- Customize the `README.md` further to include any additional information relevant to your project, such as specific features, configuration options, or deployment instructions.\n\nFeel free to ask if you have any more questions or modifications!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrisniras%2Fchat-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimitrisniras%2Fchat-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimitrisniras%2Fchat-app/lists"}