{"id":30770235,"url":"https://github.com/samuelcandido/restapi-python","last_synced_at":"2025-09-04T23:05:47.611Z","repository":{"id":308654628,"uuid":"1032951704","full_name":"SamuelCandido/RestAPI-Python","owner":"SamuelCandido","description":"Validacao de WEB II","archived":false,"fork":false,"pushed_at":"2025-08-07T05:00:12.000Z","size":48,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"Master","last_synced_at":"2025-08-07T06:17:32.696Z","etag":null,"topics":["jwt","python","rest-api","swagger","yaml"],"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/SamuelCandido.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}},"created_at":"2025-08-06T04:50:15.000Z","updated_at":"2025-08-07T05:00:16.000Z","dependencies_parsed_at":"2025-08-07T06:17:48.718Z","dependency_job_id":"2a186f01-2b10-4128-9e57-d58f3f37d7a2","html_url":"https://github.com/SamuelCandido/RestAPI-Python","commit_stats":null,"previous_names":["samuelcandido/restapi"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/SamuelCandido/RestAPI-Python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelCandido%2FRestAPI-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelCandido%2FRestAPI-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelCandido%2FRestAPI-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelCandido%2FRestAPI-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SamuelCandido","download_url":"https://codeload.github.com/SamuelCandido/RestAPI-Python/tar.gz/refs/heads/Master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SamuelCandido%2FRestAPI-Python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273685604,"owners_count":25149722,"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-09-04T02:00:08.968Z","response_time":61,"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":["jwt","python","rest-api","swagger","yaml"],"created_at":"2025-09-04T23:03:26.441Z","updated_at":"2025-09-04T23:05:47.595Z","avatar_url":"https://github.com/SamuelCandido.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rest API - Comandas e Usuários\n\nAPI RESTful desenvolvida em Flask para gerenciamento de usuários, comandas e autenticação JWT.  \nInclui documentação interativa via Swagger UI.\n\n## Funcionalidades\n\n- Cadastro, consulta e remoção de usuários (Controller → Service → DAO)\n- Autenticação via JWT (login)\n- Cadastro, consulta, atualização e remoção de comandas com produtos (Controller → Service → DAO)\n- Documentação Swagger UI\n\n## Instalação\n\n1. Clone o repositório:\n   ```sh\n   git clone https://github.com/SamuelCandido/RestAPI-Python.git\n   cd Rest\n   ```\n\n2. Instale as dependências:\n   ```sh\n   pip install -r requirements.txt\n   ```\n\n3. Execute a aplicação:\n   ```sh\n   python app.py\n   ```\n\n## Documentação Swagger\n\nAcesse [http://localhost:8080/apidocs](http://localhost:8080/apidocs) para visualizar e testar os endpoints.\n\n## Exemplos de Uso\n\n### Cadastro de Usuário\n\n```json\nPOST /RestAPIFurb/usuarios\n{\n  \"nome\": \"joao\",\n  \"telefone\": \"478888888\",\n  \"senha\": \"123\"\n}\n```\n\n### Login\n\n```json\nPOST /RestAPIFurb/login\n{\n  \"nome\": \"joao\",\n  \"senha\": \"123\"\n}\n```\n\n### Cadastro de Comanda\n\n```json\nPOST /RestAPIFurb/comandas\n{\n  \"idUsuario\": 1,\n  \"produtos\": [\n    {\"nome\": \"X-Salada\", \"preco\": 30}\n  ]\n}\n```\n\n### Atualização de Produtos da Comanda\n\n```json\nPUT /RestAPIFurb/comandas/1\n{\n  \"produtos\": [\n    {\"id\": 2, \"nome\": \"X-Bacon\", \"preco\": 35}\n  ]\n}\n```\n\n### Remoção de Usuário\n\n```json\nDELETE /RestAPIFurb/usuarios/1\n```\n\n### Remoção de Comanda\n\n```json\nDELETE /RestAPIFurb/comandas/1\n```\n\n## Observações\n\n- O banco de dados é SQLite e já está configurado em `config.py`.\n- O Swagger UI está integrado e lê o arquivo `swagger/swagger.yaml`.\n- Para endpoints protegidos, envie o token JWT no header:\n  ```\n  Authorization: Bearer \u003cseu_token\u003e\n  ```\n- Todos os acessos ao banco são feitos via DAOs (`UsuarioDAO`, `ComandaDAO`).\n\n## Dependências\n\nVeja o arquivo [`requirements.txt`](requirements.txt):\n\n```\nflask\nflask_sqlalchemy\nflask_marshmallow\nmarshmallow-sqlalchemy\nflask-jwt-extended\nflasgger\nflask-cors\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelcandido%2Frestapi-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelcandido%2Frestapi-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelcandido%2Frestapi-python/lists"}