{"id":28924161,"url":"https://github.com/odeassis/map-download-service","last_synced_at":"2025-08-06T11:17:47.716Z","repository":{"id":299835492,"uuid":"1004303979","full_name":"odeassis/map-download-service","owner":"odeassis","description":null,"archived":false,"fork":false,"pushed_at":"2025-07-01T19:52:51.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-01T20:46:11.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/odeassis.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-06-18T12:24:15.000Z","updated_at":"2025-07-01T19:52:54.000Z","dependencies_parsed_at":"2025-06-18T15:43:45.542Z","dependency_job_id":null,"html_url":"https://github.com/odeassis/map-download-service","commit_stats":null,"previous_names":["odeassis/map-download-service"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/odeassis/map-download-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odeassis%2Fmap-download-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odeassis%2Fmap-download-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odeassis%2Fmap-download-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odeassis%2Fmap-download-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/odeassis","download_url":"https://codeload.github.com/odeassis/map-download-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/odeassis%2Fmap-download-service/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269068068,"owners_count":24354410,"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-08-06T02:00:09.910Z","response_time":99,"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-06-22T10:08:37.571Z","updated_at":"2025-08-06T11:17:47.708Z","avatar_url":"https://github.com/odeassis.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Map Download API\n\nA simple Node.js service for downloading map files and retrieving map metadata. This service uses structured logging with request IDs for tracking and monitoring.\n\n## Features\n\n- **Structured Logging**: Uses Pino for structured logging with request IDs\n- **Two Simple Routes**: Download maps and get map metadata\n- **Error Handling**: Proper error handling with structured logging\n- **TypeScript**: Full TypeScript support with proper type definitions\n\n## Installation\n\n1. Clone the repository:\n   ```\n   git clone \u003crepository-url\u003e\n   ```\n2. Navigate to the project directory:\n   ```\n   cd map-download-api\n   ```\n3. Install dependencies:\n   ```\n   npm install\n   ```\n\n## Usage\n\nTo start the development server:\n\n```\nnpm run dev\n```\n\nTo build and start production server:\n\n```\nnpm run build\nnpm start\n```\n\nThe API will be available at `http://localhost:5045` (or your configured PORT).\n\n## API Endpoints\n\n### 1. Download Map\n\n- **Endpoint**: `GET /map/:map_id/download`\n- **Description**: Downloads the map file corresponding to the provided map ID\n- **Parameters**:\n  - `map_id`: The unique identifier for the map\n- **Response**: Returns the map file as `application/octet-stream`\n- **Headers**:\n  - `Content-Disposition`: attachment; filename=map-{map_id}.mbtiles\n  - `X-Request-ID`: Unique request identifier for tracking\n\n### 2. Get Map Metadata\n\n- **Endpoint**: `GET /map/:map_id/metadata`\n- **Description**: Returns metadata information for the specified map ID\n- **Parameters**:\n  - `map_id`: The unique identifier for the map\n- **Response**: JSON object containing map metadata\n- **Headers**:\n  - `X-Request-ID`: Unique request identifier for tracking\n\n## Environment Variables\n\n- `PORT`: Server port (default: 5045)\n- `STORAGE_BASE_PATH`: Base path for map storage (default: src/archives/maps)\n\n## Map Storage Structure\n\n```\narchives/\n  maps/\n    {map_id}.mbtiles          # Map tile files\n    metadata/\n      {map_id}.json          # Map metadata files\n```\n\n## Logging\n\nAll requests are logged with structured logging including:\n\n- Request ID for tracing\n- Request method and URL\n- User agent\n- Action-specific logging (download start/progress/completion, metadata retrieval)\n- Error logging with detailed context\n\n## Contributing\n\nFeel free to submit issues or pull requests for improvements.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodeassis%2Fmap-download-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fodeassis%2Fmap-download-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fodeassis%2Fmap-download-service/lists"}