{"id":21547010,"url":"https://github.com/lexxai/goit_python_web_hw_04","last_synced_at":"2026-05-11T16:36:49.101Z","repository":{"id":192779570,"uuid":"687394165","full_name":"lexxai/goit_python_web_hw_04","owner":"lexxai","description":"GoIT, Python WEB, Homework number 04. HTTPServer, SOCKET.","archived":false,"fork":false,"pushed_at":"2023-09-07T01:10:11.000Z","size":368,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T01:44:56.675Z","etag":null,"topics":["docker","homework","httpserver","python","socket","web"],"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/lexxai.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}},"created_at":"2023-09-05T09:13:09.000Z","updated_at":"2023-09-24T22:13:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"caa1663c-7928-4342-92fc-3923c5b2d255","html_url":"https://github.com/lexxai/goit_python_web_hw_04","commit_stats":null,"previous_names":["lexxai/goit_python_web_hw_04"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lexxai/goit_python_web_hw_04","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexxai%2Fgoit_python_web_hw_04","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexxai%2Fgoit_python_web_hw_04/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexxai%2Fgoit_python_web_hw_04/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexxai%2Fgoit_python_web_hw_04/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lexxai","download_url":"https://codeload.github.com/lexxai/goit_python_web_hw_04/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lexxai%2Fgoit_python_web_hw_04/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32903648,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":["docker","homework","httpserver","python","socket","web"],"created_at":"2024-11-24T06:13:54.041Z","updated_at":"2026-05-11T16:36:49.085Z","avatar_url":"https://github.com/lexxai.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# goit_python_web_hw_04\n\n## RUN WEB SERVER\n\n```\n python  webapp/app.py\n```\n\n## INDEX\n\n![Index](doc/app-index.png)\n\n## MESSAGE\n\n### MESSAGE FORM\n\n![Index](doc/app-message.png)\n\n \n## SOCKET SAVE STORAGE JSON \n\n### RUN SREVERS in Threads with WATHCDOG timer\nWATHCDOG\n\n```\n  logger.info(\"run  WATHCDOG timer for servers in threads\")\n    while True:\n        for name, th in threads.items():\n            if not th.is_alive():\n                logger.error(f\"thread crashed, restart - {th.name}\")\n                th = servers_boot[name](name)\n                threads[name] = th\n        time.sleep(2)\n```\n\n### LOG\n```\npython main.py\n2023-09-06 03:12:05,142 [ MainThread ] run_threads\n2023-09-06 03:12:05,145 [ MainThread ] run  WATHCDOG timer for servers in threads\n2023-09-06 03:12:05,145 [ SOCKET_SERVER ] Start Socket server\n2023-09-06 03:12:06,180 [ HTTP_SERVER ] Start HTTP server at port: 3000\n127.0.0.1 - - [06/Sep/2023 03:12:18] \"GET / HTTP/1.1\" 200 -\n127.0.0.1 - - [06/Sep/2023 03:12:18] \"GET /style.css HTTP/1.1\" 200 -\n127.0.0.1 - - [06/Sep/2023 03:12:18] \"GET /logo.png HTTP/1.1\" 200 -\n127.0.0.1 - - [06/Sep/2023 03:12:25] \"GET /message.html HTTP/1.1\" 200 -\n127.0.0.1 - - [06/Sep/2023 03:12:26] \"GET /style.css HTTP/1.1\" 200 -\n127.0.0.1 - - [06/Sep/2023 03:12:26] \"GET /logo.png HTTP/1.1\" 200 -\n127.0.0.1 - - [06/Sep/2023 03:12:59] \"POST /message HTTP/1.1\" 200 -\n2023-09-06 03:12:59,811 [ HTTP_SERVER ] {\"2023-09-06 03:12:59.809891\": {\"username\": \"Тестовий користувач\", \"message\": \"Повідомлення 1\"}}\n2023-09-06 03:12:59,817 [ SOCKET_SERVER ] Received data: {'2023-09-06 03:12:59.809891': {'username': 'Тестовий користувач', 'message': 'Повідомлення 1'}} from: ('127.0.0.1', 64030)\n2023-09-06 03:12:59,819 [ SOCKET_SERVER ] Send data: {\"STATUS\": \"OK\"} to: ('127.0.0.1', 64030)\n2023-09-06 03:12:59,820 [ HTTP_SERVER ] SAVED OK\n127.0.0.1 - - [06/Sep/2023 03:13:14] \"POST /message HTTP/1.1\" 200 -\n2023-09-06 03:13:14,654 [ HTTP_SERVER ] {\"2023-09-06 03:13:14.653878\": {\"username\": \"Тестовий користувач\", \"message\": \"Повідомлення 2\"}}\n2023-09-06 03:13:14,670 [ SOCKET_SERVER ] Received data: {'2023-09-06 03:13:14.653878': {'username': 'Тестовий користувач', 'message': 'Повідомлення 2'}} from: ('127.0.0.1', 51094)\n2023-09-06 03:13:14,671 [ SOCKET_SERVER ] Send data: {\"STATUS\": \"OK\"} to: ('127.0.0.1', 51094)\n2023-09-06 03:13:14,671 [ HTTP_SERVER ] SAVED OK\n127.0.0.1 - - [06/Sep/2023 03:13:20] \"POST /message HTTP/1.1\" 200 -\n2023-09-06 03:13:20,618 [ HTTP_SERVER ] {\"2023-09-06 03:13:20.614063\": {\"username\": \"Тестовий користувач\", \"message\": \"Повідомлення 3\"}}\n2023-09-06 03:13:20,638 [ SOCKET_SERVER ] Received data: {'2023-09-06 03:13:20.614063': {'username': 'Тестовий користувач', 'message': 'Повідомлення 3'}} from: ('127.0.0.1', 64437)\n2023-09-06 03:13:20,642 [ HTTP_SERVER ] SAVED OK\n2023-09-06 03:13:20,648 [ SOCKET_SERVER ] Send data: {\"STATUS\": \"OK\"} to: ('127.0.0.1', 64437)\n```\n\n![Index](doc/storage-json.png)\n\n### RESULT MESSAGES SENT\n\n![Index](doc/app-message-done.png)\n\n## DOCKER\n\n## dockerfile\n\n```\nFROM python:3.11-slim\nENV APP_HOME /app \nWORKDIR $APP_HOME\nCOPY . .\nEXPOSE 3000/tcp\nVOLUME $APP_HOME/storage\nENTRYPOINT [ \"python\", \"main.py\" ]\n```\n\n### BUILD\n```\ndocker build . -t lexxai/web_hw_04\n```\n\n### RUN\n```\ndocker run -it -d --rm -p 3000:3000  -v web_hw_04_volume:/app/storage  --name web_hw_04  lexxai/web_hw_04 \n```    \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexxai%2Fgoit_python_web_hw_04","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flexxai%2Fgoit_python_web_hw_04","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flexxai%2Fgoit_python_web_hw_04/lists"}