{"id":31551373,"url":"https://github.com/devjpmello/avaliacaog1-compnuvem","last_synced_at":"2025-10-04T18:42:09.576Z","repository":{"id":316495085,"uuid":"1063632361","full_name":"devJPMello/AvaliacaoG1-CompNuvem","owner":"devJPMello","description":null,"archived":false,"fork":false,"pushed_at":"2025-09-24T22:53:55.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T00:22:49.546Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devJPMello.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-24T22:45:04.000Z","updated_at":"2025-09-24T22:53:58.000Z","dependencies_parsed_at":"2025-09-25T00:22:51.061Z","dependency_job_id":"7165bcdf-42de-4f7c-ad5d-5e4f962bb0b2","html_url":"https://github.com/devJPMello/AvaliacaoG1-CompNuvem","commit_stats":null,"previous_names":["devjpmello/avaliacaog1-compnuvem"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/devJPMello/AvaliacaoG1-CompNuvem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devJPMello%2FAvaliacaoG1-CompNuvem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devJPMello%2FAvaliacaoG1-CompNuvem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devJPMello%2FAvaliacaoG1-CompNuvem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devJPMello%2FAvaliacaoG1-CompNuvem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devJPMello","download_url":"https://codeload.github.com/devJPMello/AvaliacaoG1-CompNuvem/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devJPMello%2FAvaliacaoG1-CompNuvem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358489,"owners_count":25973946,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"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":"2025-10-04T18:42:02.803Z","updated_at":"2025-10-04T18:42:09.538Z","avatar_url":"https://github.com/devJPMello.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sistema de Mensageria Distribuída (Flask + Docker Compose)\n\nEste projeto implementa um sistema de mensagens distribuído em **Python (Flask)**, onde 3 containers (app1, app2, app3) podem enviar e replicar mensagens entre si. \nAs mensagens são armazenadas em arquivos JSON dentro de um volume compartilhado, e cada serviço mantém também seu arquivo de log.\n\n## Estrutura do Projeto\n```\n/avaliacao/\n├── app/\n│   ├── app.py              # Código principal Flask\n│   ├── Dockerfile          # Dockerfile da aplicação\n│   └── requirements.txt    # Dependências\n├── docker-compose.yml      # Configuração do ambiente distribuído\n├── test.sh                 # Script de teste automatizado\n└── README.md               # Este arquivo\n```\n\n## Como Executar\n\n### 1. Subir o ambiente\n```bash\ndocker-compose up -d --build\n```\n\n### 2. Enviar mensagens\n```bash\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"message\":\"Olá do App1\"}' http://localhost:5001/send\n\ncurl -X POST -H \"Content-Type: application/json\" -d '{\"message\":\"Alo do App2\"}' http://localhost:5002/send\n```\n\n### 3. Consultar mensagens\n```bash\ncurl http://localhost:5001/messages\ncurl http://localhost:5002/messages\ncurl http://localhost:5003/messages\n```\n\n### 4. Testes automatizados\n```bash\nchmod +x test.sh\n./test.sh\n```\n\n### 5. Verificar arquivos no volume\n```bash\ndocker exec app1_container ls /messages_volume\ndocker exec app1_container cat /messages_volume/app1_messages.json\ndocker exec app1_container cat /messages_volume/app1_log.txt\n```\n\n### 6. Encerrar o ambiente\n```bash\ndocker-compose down\n```\n\n## Observações Técnicas\n- Cada container mantém seu próprio arquivo JSON (`\u003cservice\u003e_messages.json`) e log (`\u003cservice\u003e_log.txt`) no volume compartilhado.\n- A replicação ocorre apenas quando a mensagem é original (não replicada).\n- Logs de replicação são gravados no arquivo de log do container.\n\n## Tecnologias\n- Python 3.9\n- Flask (API REST)\n- Requests (comunicação entre containers)\n- Docker Compose (orquestração dos serviços)\n\n## Autores\nProjeto desenvolvido para fins acadêmicos na disciplina **Computação em Nuvem (G1 - 2025/2)**.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevjpmello%2Favaliacaog1-compnuvem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevjpmello%2Favaliacaog1-compnuvem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevjpmello%2Favaliacaog1-compnuvem/lists"}