Skip to content

Tomson01560/github-proxy

Repository files navigation

Github proxy app:

A light REST API application that acts as a proxy for the GitHub API. It retrieves a list of all non-forked repositories for a given GitHub user, along with their respective branches and the latest commit SHA for each branch.

Technologies used in this project:

  • Java 25 as main programming language

  • Spring Boot 4

  • Gradle with Kotlin DSL

  • Wiremock for testing

Architecture

  • The application follows a simple Controller-Service-Client architecture within a single package.
  • Built using Spring's synchronous RestClient.
  • External API calls are tested via integration tests using WireMock, ensuring zero usage of mock beans.

Prerequisites

  • Java 25 installed on your local machine.

How to run

./gradlew bootRun

Then application will start on http://localhost:8080

How to test

To run the integration tests (which use WireMock to emulate the GitHub API server without hitting real rate limits):

./gradlew test

Optional: You can view a detailed HTML test report by opening build/reports/tests/test/index.html in your browser after running the tests.

By running command in terminal: open build/reports/tests/test/index.html

API documentation

To get user repositories (non-forked repositories and their branches):

Request: GET /api/repositories/{username}

Example (cURL): curl -v http://localhost:8080/api/repositories/octocat

If correct it successful response should look like this:

[
  {
    "name": "hello-world",
    "ownerLogin": "octocat",
    "branches": [
      {
        "name": "master",
        "lastCommitSha": "7e068727fdb347b685b658d2981f8c85f7bf0585"
      }
    ]
  }
]

If user is not found and we're getting 404 error we should get output like this:

{
    "status": 404,
    "message": "User not found on GitHub"
}

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages