tssovi / popular-github-repo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Popular GitHub Repository Service

[Add a concise tagline describing your service in a few words]

Description

  • Provide a clear description of what your service does, the problem it solves, and its primary features.

Installation for Local Executions

  1. Prerequisites:
    • Python
    • FastAPI
    • Docker
  2. Clone the repository:
    git clone https://github.com/tssovi/popular-github-repo.git
  3. Create a virtual environment:
    python -m venv env
    source env/bin/activate
  4. Install dependencies:
    pip install -r requirements.txt

Development & Workflow with Docker Compose

The following Makefile commands are provided to manage and interact with the application. Ensure you have both Docker and Docker Compose installed.

  • Start the API in detached mode:
    make up
  • Stop and remove containers, networks, volumes, and images:
    make down
  • Build the Docker images:
    make build
  • Run the API container:
    make start-api
  • Run tests:
    make run-test
  • Clean up test artifacts:
    make clean

API Endpoints

  • /is-popular (POST)

    • Description: Determines if a GitHub repository is popular based on its stargazers and forks counts.
    • Parameters:
      • owner (str): The owner of the repository.
      • repo (str): The name of the repository.
    • Example Request (JSON):
      {
          "owner": "facebook",
          "repo": "react"
      }
    • Example Response (JSON):
      {
          "repository": "facebook/react",
          "is_popular": true,
          "score": 12345,  
          "response_time": 0.231
      }
  • /health (GET)

    • Description: Performs a basic health check of the service.
    • Example Response (JSON):
      {"status": "OK"}

About


Languages

Language:Python 88.4%Language:Makefile 7.9%Language:Dockerfile 3.7%