{"id":27353964,"url":"https://github.com/viniciusfinger/pychat","last_synced_at":"2025-07-25T09:41:28.246Z","repository":{"id":197823110,"uuid":"685985050","full_name":"viniciusfinger/pychat","owner":"viniciusfinger","description":"Chat via terminal using Python, threads and network sockets","archived":false,"fork":false,"pushed_at":"2023-10-02T16:05:22.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T21:18:29.682Z","etag":null,"topics":["network-socket","python3","thread"],"latest_commit_sha":null,"homepage":"","language":"Python","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/viniciusfinger.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}},"created_at":"2023-09-01T13:13:23.000Z","updated_at":"2024-06-09T09:31:22.000Z","dependencies_parsed_at":"2023-10-02T21:57:34.585Z","dependency_job_id":null,"html_url":"https://github.com/viniciusfinger/pychat","commit_stats":null,"previous_names":["viniciusfinger/pychat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fpychat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fpychat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fpychat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viniciusfinger%2Fpychat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viniciusfinger","download_url":"https://codeload.github.com/viniciusfinger/pychat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631765,"owners_count":21136563,"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":["network-socket","python3","thread"],"created_at":"2025-04-12T21:18:31.695Z","updated_at":"2025-04-12T21:18:32.158Z","avatar_url":"https://github.com/viniciusfinger.png","language":"Python","readme":"\n# Pychat 🐍💬\n\nUm chat no terminal usando Python + sockets de rede\n\n## Como usar 🤔\n\nUsando o terminal navegue até o diretório que contém os arquivos `chat_server.py` e `chat_client.py`.\n\nPrimeiro inicie o servidor usando o comando `python3 chat_server.py [Porta]`. Caso não insira nenhuma porta, o servidor iniciará na porta `19000`.\n\nPara iniciar o cliente, use o comando `python3 chat_client.py [IP do servidor] [Porta]`.\n\nPara ver os possíveis comandos, digite `@AJUDA`.\n \n## Arquitetura ⚙️\nO chat está arquitetado no modelo client-server, ou seja, no meio de todos os clients temos o servidor fazendo o recebimento e distribuição das mensagens.\n\nNo `chat_client.py` temos a thread principal do sistema rodando a leitura do terminal e o envio de mensagens ao servidor enquanto em uma thread separada temos o socket escutando as mensagens que estão chegando de outros clients através do servidor. \n\nNo `chat_server.py` a thread principal é reponsável por escutar novos clients querendo se conectar. Quando um client novo se conecta, uma thread nova se cria. Essa nova thread ficará responsável por ouvir a mensagem que está sendo enviada pelo client e redistribui-la para os outros clients conectados no servidor.\n\nPara redistribuir as mensagens, foi seguido o padrão publisher/subscriber, onde todos os clients mantidos em uma lista chamada `clients_listening` são os subscribers e o servidor é o publisher.\n\n## Contribuindo ⚒️\n\nContribuições são sempre bem-vindas!\n\nPara enviar suas alterações, clone o projeto, crie sua branch, faça as devidas alterações e/ou melhorias e então abra um pull request para ser verificado. \n## Referência\n\n - [Javachat](https://github.com/viniciusfinger/javachat)\n - [Socket - Python docs](https://docs.python.org/3/library/socket.html)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusfinger%2Fpychat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviniciusfinger%2Fpychat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviniciusfinger%2Fpychat/lists"}