Skip to content

Latest commit

 

History

History
69 lines (53 loc) · 1.02 KB

File metadata and controls

69 lines (53 loc) · 1.02 KB

GitHubRepositoriesService

REST API that fetches non-fork GitHub repositories for a given user and includes the branches with latest commit SHA.

Prerequisites

  • Java 21 or higher (LTS version recommended)
  • Maven 3.3.2 or higher

Usage

Cloning the Repository

git clone https://github.com/KalbarczykDev/GithubRepositoriesService.git
cd GithubRepositoriesService

Building the Project

./mvnw clean install

Running the Application

./mvnw spring-boot:run

The application will start on http://localhost:8080 by default.

Running the Tests

./mvnw test

Endpoint

GET /api/github/{username}/repositories

Example response:

[
  {
    "repositoryName": "Hello-World",
    "ownerLogin": "octocat",
    "branches": [
      {
        "name": "main",
        "lastCommitSha": "7fd1a60..."
      }
    ]
  }
]

Error response

{
  "status": "error",
  "message": "User not found: {username}"
}

License

MIT