{"id":49226495,"url":"https://github.com/internethealthreport/ihr-api","last_synced_at":"2026-04-24T08:00:53.308Z","repository":{"id":299354662,"uuid":"994704536","full_name":"InternetHealthReport/ihr-api","owner":"InternetHealthReport","description":"Internet Health Report API","archived":false,"fork":false,"pushed_at":"2026-04-24T06:06:36.000Z","size":240,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-24T07:24:19.067Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.ihr.live/ihr/api/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/InternetHealthReport.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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-06-02T11:01:00.000Z","updated_at":"2026-04-24T06:04:52.000Z","dependencies_parsed_at":"2025-06-16T05:37:04.891Z","dependency_job_id":"c4b19412-4e13-4fe8-8330-5461e804398c","html_url":"https://github.com/InternetHealthReport/ihr-api","commit_stats":null,"previous_names":["internethealthreport/ihr-api"],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/InternetHealthReport/ihr-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InternetHealthReport%2Fihr-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InternetHealthReport%2Fihr-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InternetHealthReport%2Fihr-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InternetHealthReport%2Fihr-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InternetHealthReport","download_url":"https://codeload.github.com/InternetHealthReport/ihr-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InternetHealthReport%2Fihr-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32214420,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":[],"created_at":"2026-04-24T08:00:42.051Z","updated_at":"2026-04-24T08:00:53.302Z","avatar_url":"https://github.com/InternetHealthReport.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IHR API\n\nThis project implements the IHR API, migrating from the [old API system](https://github.com/InternetHealthReport/ihr-django) to a more efficient architecture. It introduces a new database management system using [Alembic](https://alembic.sqlalchemy.org/en/latest/) and enhances the structure for creating new endpoints. The API is built on [FastAPI](https://fastapi.tiangolo.com/) and can be run in either a Python virtual environment or using Docker.\n\n---\n\n##  Getting Started\n\n### 1. Clone the Repository\n\n```sh\ngit clone https://github.com/InternetHealthReport/ihr-api.git\n```\n\n### 2. Create a `.env` File\n\nIn the project root directory, create a new `.env` file to define your specific database connection string, proxy path and page size (number of results to return per page.).\n\n`.env` content:\n\n```env\nDATABASE_URL=postgresql://\u003cusername\u003e:\u003cpassword\u003e@\u003chost\u003e:\u003cport\u003e/\u003cdatabase\u003e\nPROXY_PATH=ihr/api\nPAGE_SIZE=100000\nPOOL_SIZE=10\nMAX_OVERFLOW=5\nPOOL_TIMEOUT=10\nPOOL_RECYCLE=1800\nREQUEST_TIMEOUT=30\n```\n\n\n---\n\n## Running the Application\n\nYou can run this application in one of the following ways:\n\n* Using a Python virtual environment\n* Using Docker\n\n---\n\n## Option 1: Run in a Python Virtual Environment\n\n### Step 1: Create and Activate a Virtual Environment\n\n#### On Windows:\n\n```sh\npython -m venv venv\nvenv\\Scripts\\activate\n```\n\n#### On macOS/Linux:\n\n```sh\npython3 -m venv venv\nsource venv/bin/activate\n```\n\n### Step 2: Install Dependencies\n\n```sh\npip install -r requirements.txt\n```\n\n### Step 3: Run the Application\n\n```sh\nuvicorn main:app --host 0.0.0.0 --port 8000 --reload\n```\n\n---\n\n## Option 2: Run with Docker\n\n### Step 1: Build the Docker Image\n\n```sh\ndocker build -t ihr-api .\n```\n\n### Step 2: Run the Docker Container\n\n#### Using the local Docker Image\n\n```sh\ndocker run --name ihr-api -p 8000:8000 -d --env-file .env ihr-api\n```\n\n#### Using the Docker Hub\n\n```sh\ndocker run --name ihr-api --env-file .env --restart unless-stopped -p 8000:8000 -d -t internethealthreport/ihr-api:v{v_number}\n```\n\nWhere `v_number` is the version number.\n\n### (Optional) Step 3: Manage the Container\n\nStart an existing container:\n\n```sh\ndocker start \u003ccontainer-id\u003e\n```\n\nView logs:\n\n```sh\ndocker logs -f \u003ccontainer-id\u003e\n```\n\n## Access the API\n\nOnce running, you can access:\n- API: **[http://localhost:8000](http://localhost:8000)**\n- Interactive Docs (Swagger UI): **[http://localhost:8000/docs](http://localhost:8000/docs)**\n\n---\n\n# Documentation\n\nThe `docs/` folder contains detailed documentation for various aspects of the project. Below is a list of available documentation files and their descriptions:\n\n### 1. [Project Structure](docs/project_structure.md)\nProvides an overview of the project's file and folder structure, organized according to the **Service-Controller-Repository** architectural pattern.\n\n### 2. [Project Architecture](docs/project_architecture.md)\nExplains the **Service-Controller-Repository** architecture adopted by the project, highlighting the responsibilities of each layer and how they interact.\n\n### 3. [Database Migration](docs/database_migration.md)\nDetails how to manage database migrations using Alembic, including TimescaleDB-specific features like hypertables and compression policies.\n\n### 4. [Adding a New Endpoint](docs/add_new_endpoint.md)\nA step-by-step guide on how to add a new endpoint to the application.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternethealthreport%2Fihr-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finternethealthreport%2Fihr-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finternethealthreport%2Fihr-api/lists"}