{"id":41622109,"url":"https://github.com/m4rrec0s/desafio-tecnico-python","last_synced_at":"2026-01-24T13:56:38.588Z","repository":{"id":304831800,"uuid":"1013849416","full_name":"m4rrec0s/desafio-tecnico-python","owner":"m4rrec0s","description":"API que coleta posts baseada na API pública JSONPLACEHOLDER. Testes com agente Copilot.","archived":false,"fork":false,"pushed_at":"2025-07-15T13:06:40.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-16T05:08:11.897Z","etag":null,"topics":["fastapi","python"],"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/m4rrec0s.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-07-04T15:09:33.000Z","updated_at":"2025-07-15T13:35:07.000Z","dependencies_parsed_at":"2025-07-16T07:51:57.330Z","dependency_job_id":"c6bbe131-2c56-452d-bc6e-32f77ffd6cd6","html_url":"https://github.com/m4rrec0s/desafio-tecnico-python","commit_stats":null,"previous_names":["m4rrec0s/desafio-tecnico-python"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/m4rrec0s/desafio-tecnico-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4rrec0s%2Fdesafio-tecnico-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4rrec0s%2Fdesafio-tecnico-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4rrec0s%2Fdesafio-tecnico-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4rrec0s%2Fdesafio-tecnico-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m4rrec0s","download_url":"https://codeload.github.com/m4rrec0s/desafio-tecnico-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m4rrec0s%2Fdesafio-tecnico-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28729411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["fastapi","python"],"created_at":"2026-01-24T13:56:38.158Z","updated_at":"2026-01-24T13:56:38.584Z","avatar_url":"https://github.com/m4rrec0s.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSONPlaceholder API Consumer\n\nA simple FastAPI backend that consumes the JSONPlaceholder public API to retrieve posts.\n\n## Features\n\n- **GET /** - Root endpoint with welcome message\n- **GET /posts/{id}** - Retrieve a specific post by ID from JSONPlaceholder API\n- Asynchronous HTTP requests using `httpx`\n- Proper error handling with 404 responses for non-existent posts\n- Built with FastAPI for automatic API documentation\n\n## Requirements\n\n- Python 3.8+\n- FastAPI\n- httpx\n- uvicorn\n\n## Installation\n\n1. Clone the repository:\n```bash\ngit clone \u003crepository-url\u003e\ncd desafio-tecnico-python\n```\n\n2. Install dependencies:\n```bash\npip install -r requirements.txt\n```\n\n## Running the Application\n\n### Using Python directly:\n```bash\npython main.py\n```\n\n### Using uvicorn:\n```bash\nuvicorn main:app --reload --host 0.0.0.0 --port 8000\n```\n\nThe application will start on `http://localhost:8000`\n\n## API Documentation\n\nOnce the server is running, you can access:\n\n- **Interactive API documentation (Swagger UI)**: http://localhost:8000/docs\n- **Alternative documentation (ReDoc)**: http://localhost:8000/redoc\n\n## API Endpoints\n\n### GET /\n\nReturns a welcome message.\n\n**Response:**\n```json\n{\n  \"message\": \"Welcome to the JSONPlaceholder API Consumer!\"\n}\n```\n\n### GET /posts/{id}\n\nRetrieves a post by ID from the JSONPlaceholder API.\n\n**Parameters:**\n- `id` (int): The post ID to retrieve\n\n**Response (Success):**\n```json\n{\n  \"userId\": 1,\n  \"id\": 1,\n  \"title\": \"sunt aut facere repellat provident occaecati excepturi optio reprehenderit\",\n  \"body\": \"quia et suscipit...\"\n}\n```\n\n**Response (Error - 404):**\n```json\n{\n  \"detail\": \"Post not found\"\n}\n```\n\n## Examples\n\n### Get welcome message:\n```bash\ncurl http://localhost:8000/\n```\n\n### Get post by ID:\n```bash\ncurl http://localhost:8000/posts/1\n```\n\n### Test non-existent post:\n```bash\ncurl http://localhost:8000/posts/999\n```\n\n## Development\n\nThe application is structured as a single file (`main.py`) for simplicity, containing:\n\n- FastAPI application instance\n- Root endpoint handler\n- Post retrieval endpoint with error handling\n- Asynchronous HTTP client using httpx\n\n## Error Handling\n\n- **404 Not Found**: When a post doesn't exist in JSONPlaceholder\n- **500 Internal Server Error**: For network or other HTTP errors\n\n## External API\n\nThis application consumes the JSONPlaceholder API:\n- Base URL: https://jsonplaceholder.typicode.com\n- Endpoint used: `/posts/{id}`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4rrec0s%2Fdesafio-tecnico-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm4rrec0s%2Fdesafio-tecnico-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm4rrec0s%2Fdesafio-tecnico-python/lists"}