Skip to content

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

Notifications You must be signed in to change notification settings

KalbarczykDev/github-repositories-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

Stars

Watchers

Forks

Languages