{"id":26178479,"url":"https://github.com/houshmand-2005/chat_app","last_synced_at":"2025-12-24T13:30:38.629Z","repository":{"id":224545442,"uuid":"711156818","full_name":"houshmand-2005/chat_app","owner":"houshmand-2005","description":"A WebSocket-based chat application built with FastAPI","archived":false,"fork":false,"pushed_at":"2024-02-26T13:59:29.000Z","size":1052,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"houshmand","last_synced_at":"2024-02-26T15:05:58.486Z","etag":null,"topics":["chatroom","websocket","websocket-chat"],"latest_commit_sha":null,"homepage":"","language":"Python","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/houshmand-2005.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}},"created_at":"2023-10-28T11:42:40.000Z","updated_at":"2024-02-26T15:06:03.866Z","dependencies_parsed_at":"2024-02-26T15:06:02.371Z","dependency_job_id":null,"html_url":"https://github.com/houshmand-2005/chat_app","commit_stats":null,"previous_names":["houshmand-2005/chat_app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fchat_app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fchat_app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fchat_app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fchat_app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houshmand-2005","download_url":"https://codeload.github.com/houshmand-2005/chat_app/tar.gz/refs/heads/houshmand","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243114719,"owners_count":20238648,"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":["chatroom","websocket","websocket-chat"],"created_at":"2025-03-11T21:28:49.219Z","updated_at":"2025-12-24T13:30:33.603Z","avatar_url":"https://github.com/houshmand-2005.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"/\u003eChat App\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003eA WebSocket-based chat application built with \u003ca href=\"https://github.com/tiangolo/fastapi\"\u003eFastAPI\u003c/a\u003e\n\u003c/p\u003e\n\n## Table of Contents\n\n- [Overview](#overview)\n  - [How It Works](#how-it-works)\n    - [Features](#features)\n- [How to run it?](#how-to-run)\n- [Samples](#samples)\n- [ToDo](#todo)\n\n# Overview\n\nThis project is a WebSocket chat application created using FastAPI. It allows users to chat with others [**asynchronously**](https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-is-the-difference) in **real-time**, **join groups**, **send** and **receive messages**, and more.\u003cbr\u003e\n\nFrontEnd Connect to websocket and api with raw JavaScript and for styling uses bootstrap and css\n\n## How It Works\n\nBy sending information with WebSockets, user can receive unread and new messages and send messages and also receive text changes such as edit and delete.\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"readme_files/unread_message.png\" width=\"710\" height=\"380\"/\u003e\n\u003c/div\u003e\n\nAlso broadcast 'changes' and 'Send Message' are similar to this\n\nyou can see how change broadcast work\u003csub\u003e (Codes have been shortened for display. See here for full codes: \u003ca href=\"backend/chat/views/websocket.py\"\u003ewebsocket.py\u003c/a\u003e)\u003csub\u003e\n\n```python\nasync def broadcast_changes(\n    group_id: int,\n    message_id: int,\n    new_text: str | None = None,\n    change_type: models.ChangeType,\n    db: Session,\n) -\u003e None:\n  ...\n  online_users = set(websocket_connections.keys())\n  await asyncio.gather(\n      *[\n          send_change_to_user(\n              member.user.id, changed_value, online_users=online_users\n          )\n          for member in group.members\n      ]\n  )\n\nasync def send_change_to_user(\n    user_id: int, change_data: dict, online_users: set\n) -\u003e None:\n  ...\n  await connection.send_text(json.dumps(change_data))\n\n```\n\n### Features\n\n- **Real-time WebSocket** chat\n- Written as **async**\n- User **authentication** and **authorization**\n- Group **creation** and **management**\n- **Sending** and **receiving** messages\n- **Editing** and **deleting** messages\n\n# How to run?\n\nwe need to get three docker images\n\n- 1.**Python** to run BackEnd and [Uvicorn](https://www.uvicorn.org/)\n- 2.**Nginx** to run FrontEnd\n- 3.**Postgres** to run DataBase\n\n```bash\n# clone the project\ngit clone https://github.com/houshmand-2005/chat_app\n# go to the folder\ncd chat_app\n# run project with docker\ndocker-compose up -d\n```\n\n# Samples\n\n\u003cimg src=\"readme_files/chat.png\"/\u003e\n\n\u003cimg src=\"readme_files/group_list.png\" height=\"310\" width=\"180\"/\u003e\n\n\u003cimg src=\"readme_files/login.png\" height=\"310\" width=\"310\"/\u003e\n\n\u003cimg src=\"readme_files/chat_unread.png\"  height=\"300\" width=\"210\"/\u003e\n\n\u003chr\u003e\nThis is list of available APIs:\u003cbr\u003e\n\u003cimg src=\"readme_files/api.png\" height=\"495\" width=\"570\"/\u003e\n\n# ToDo\n\nThese are the things I want to do\n\n- Add validation (like email validation username validation and ...)\n- Make schemas with [Pydantic](https://pydantic.dev/) for each model(now it is a little incomplete and some models don't have it)\n- Make FrontEnd more beautiful and make it more clear (This will probably be hard. I'm not very good at css and html😁)\n- Support sending photos and files\n- Support replay on message\n- Add a cache service for handel unread messages and more (Like **redis**)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoushmand-2005%2Fchat_app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoushmand-2005%2Fchat_app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoushmand-2005%2Fchat_app/lists"}