{"id":13635404,"url":"https://github.com/eqba1/erwin","last_synced_at":"2026-04-02T11:39:22.187Z","repository":{"id":167207660,"uuid":"381442726","full_name":"eqba1/Erwin","owner":"eqba1","description":"A Client-Server Chat Application using Python","archived":false,"fork":false,"pushed_at":"2021-06-29T17:18:24.000Z","size":156,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-08-02T00:22:20.829Z","etag":null,"topics":["chat","chat-application","client-server","flask","python","socket-programming"],"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/eqba1.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}},"created_at":"2021-06-29T17:17:01.000Z","updated_at":"2022-04-16T17:33:29.000Z","dependencies_parsed_at":"2023-06-30T01:00:44.257Z","dependency_job_id":null,"html_url":"https://github.com/eqba1/Erwin","commit_stats":null,"previous_names":["eqba1/erwin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eqba1%2FErwin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eqba1%2FErwin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eqba1%2FErwin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eqba1%2FErwin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eqba1","download_url":"https://codeload.github.com/eqba1/Erwin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223790267,"owners_count":17203353,"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":["chat","chat-application","client-server","flask","python","socket-programming"],"created_at":"2024-08-02T00:00:45.148Z","updated_at":"2026-04-02T11:39:22.131Z","avatar_url":"https://github.com/eqba1.png","language":"Python","readme":"\n![alt text](./Screenshot.png)\n\n**Erwin** is minimal open-source messenger that implemented with Flask Framework and Socket programming with python\n\n\n## Table of contents\n* [Run](#How-to-Run)\n* [Doc](#Document-of-Server-Program)\n* [License](#License)\n\n## How to Run\nyou can use this command to install requirements:\n```bash \n$ pip install -r requirements.txt\n```\n\nWe have two Program. server and client\n* server\n\nTo run server program go to the **./Server** directory in the root of project and use this command:\n```bash\n$ cd ./Server\n$ python Server.py -h \nusage: server [-h] [-ip ip] [-p [1-65535]]\n\noptional arguments:\n  -h, --help    show this help message and exit\n  -ip ip        Set Server IP Address (default: 127.0.0.1)\n  -p [1-65535]  Set Server Port Number (default: 30008)\n\n# or simply use \n$ python Server.py\n\n```\n\n* client\n\nFor implementation of Client application we use Flask framework, so you can use Flask command to run it\n\u003e noraml\n\nTo Run client application in Development mode you shoud set some global variable in your machine for Flask framework.\nchange diractory to **./Client** then following below command \n```shell\n$ cd ./Client\n$ export FLASK_APP=GClient.py\n$ export FLASK_ENV=deployment\n$ python3 -m flask run -p 3000\n# you can simply changing port number. in this example is 30000\n```\n\nthen open the browser and joy!\n\n\u003e shell script\n\nAlso i write a bash script to simply run application.\nchagne directory to **./Client** and run bash script file\n```bash\n$ cd ./Client\n$ ./run.sh\noutput:\n * Serving Flask app 'GClient.py' (lazy loading)\n * Environment: deployment\n * Debug mode: off\n...:  * Running on http://127.0.0.1:30000/ (Press CTRL+C to quit)\n```\nIf you want run another client on your machine you can simply change the port number in **run.sh** file.\n\n### Document \n#### Sub Module\n* [argparse](https://docs.python.org/3/library/argparse.html)\nThe argparse module makes it easy to write user-friendly command-line interfaces. The program defines what arguments it requires, and argparse will figure out how to parse those out of sys.argv. The argparse module also automatically generates help and usage messages and issues errors when users give the program invalid arguments.\n\n```python\n# Server.py\nimport argparse as arg \n\ndef argumentPars():\n    parser = arg.ArgumentParser(prog='server', add_help=True)\n\n    parser.add_argument(\"-ip\", help=\"Set Server IP Address (default: 127.0.0.1)\", type=str)\n\n    parser.add_argument(\"-p\", help=\"Set Server Port Number (default: 30008)\", type=str)\n\n    args = parser.parse_args()\n\n    if(args.sip == None and args.sp != None):\n        return args.sp, \"127.0.0.1\"\n    elif(args.sp == None and args.sip != None):\n        return 30008, args.sip\n    elif(args.sp == None and args.sip == None):\n        return 30008, \"127.0.0.1\"\n\n    return args.sp, args.sip\n\n```\n\n* [logging](https://docs.python.org/3/howto/logging.html)\nLogging is a means of tracking events that happen when some software runs. The software’s developer adds logging calls to their code to indicate that certain events have occurred. An event is described by a descriptive message which can optionally contain variable data (i.e. data that is potentially different for each occurrence of the event). Events also have an importance which the developer ascribes to the event; the importance can also be called the level or severity.\n\n```python\n# ./Log/logger.py\nimport logging\n\nformat = \"%(asctime)s: %(message)s\" \nlogging.basicConfig(format=format, level=logging.INFO, datefmt=\"%H:%M:%S\")\n\ndef warn(msg):\n    logging.warn(msg)\n\ndef info(msg):\n    logging.info(msg)\n    \n# Server.py\nimport Log.logger as logger \nlogger.warn(msg)\n```\nand other submodule that i use:\n* [SocketServer](./Server/SocketServer.py)\n\n[threading](https://docs.python.org/3/library/threading.html)\n\n\n* [Protobuf](https://github.com/protocolbuffers/protobuf/tree/master/python)\n    * [Totuiral](https://developers.google.com/protocol-buffers/docs/pythontutorial)\n\ncommand for compile the protoc:\n```bash\n$ cd ./protoc\n$ protoc --python_out=./test ./Server.proto \n```\n\n## License\n\nMIT 2021","funding_links":[],"categories":["GitHub"],"sub_categories":["Run:"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feqba1%2Ferwin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feqba1%2Ferwin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feqba1%2Ferwin/lists"}