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.
-
Java 25 as main programming language
-
Spring Boot 4
-
Gradle with Kotlin DSL
-
Wiremock for testing
- 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.
- Java 25 installed on your local machine.
./gradlew bootRun
Then application will start on http://localhost:8080
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
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"
}