The application retrieves information about a user's public GitHub repositories (excluding forks). For each repository, it returns:
- repository name,
- owner's login,
- list of branches with branch names and the last commit SHA.
If the specified user does not exist, the application returns a 404 response in the format:
{
"status": 404,
"message": "User not found"
}The application was built using:
- Java
- Quarkus 3
- GitHub's REST API as an external data source
- Includes an integration test verifying the happy path scenario
- Java 17 or higher
- Maven 3.8+
- Internet access when running the application
Note: GitHub has a rate limit for unauthorized requests. If higher limits are required, you can configure authentication with a token in the application.properties file. However, this is not mandatory.
Minimal required configuration in the application.properties file:
# src/main/resources/application.properties
github-api/mp-rest/url=https://api.github.comTo quickly start the application in development mode:
mvn quarkus:devThe application will be accessible at:
http://localhost:8080
Build the project:
mvn clean packageRun the generated JAR file:
java -jar target/quarkus-app/quarkus-run.jarAfter running, the application will be accessible at:
http://localhost:8080
An integration test is provided in the GitHubResourceIT class. Run it with:
mvn testThe test verifies:
- If the endpoint
/github/{username}returns a list of repositories (non-forks). - If each repository has a name, an owner, and a list of branches with the last commit SHA.
Endpoint: GET /github/{username}
Example URL:
http://localhost:8080/github/k4t4uExample response:
[
{
"repositoryName": "app-brainGym",
"ownerLogin": "k4t4u",
"branches": [
{
"branchName": "main",
"lastCommitSha": "e9f35054d4ae5a1f0c727a277fa130c01a444a08"
}
]
},
{
"repositoryName": "ideas100",
"ownerLogin": "k4t4u",
"branches": [
{
"branchName": "master",
"lastCommitSha": "013ea931488226677a9c6e05e034897b125b9b62"
},
{
"branchName": "test1",
"lastCommitSha": "1d9fb69c12842f5adce74d78c347ca830189fa2c"
}
]
}
]The application returns a 404 status with:
{
"status": 404,
"message": "User not found"
}- Pagination is not implemented for GitHub requests and responses.
- Only one integration test (happy path) is provided. In a production environment, more detailed tests and error handling would be recommended.
- The project uses reactive programming with the Mutiny library (
Uni<T>andMulti<T>).