The GitHub Scrapper Project is designed to fetch and display information about non-fork repositories and their branches for a specific GitHub user.
- Fetches a list of non-fork repositories for a GitHub user.
- Retrieves branch information for each repository.
- Provides a user-friendly response with repository names, owners, and branch details.
- Clone the repository to your local machine.
git clone https://github.com/brajankw/githubscrapper.git
- Navigate to the project directory.
cd githubscrapper
- Build and run the project using your preferred Java development environment.
- Launch the application and make a GET request to the appropriate endpoint.
- Provide the username of the GitHub user whose repositories you want to retrieve.
- The application will fetch and display a list of non-fork repositories and their branch details.
- Java 17
- Spring Framework
- Spring WebFlux
- Lombok
- Jackson JSON library
- WebClient for making API requests
GET /repositories/{username}
Fetches non-fork repositories and their branch information for the given GitHub username.
The GitHub Scrapper Project includes a robust error handling mechanism to provide meaningful responses to different scenarios. Here's how errors are handled:
- If a GitHub user does not exist or endpoint returns 404, a
NotFoundException
is thrown. - The API responds with an HTTP 404 status code and an error message indicating the issue.
- If the request header's
Accept
value is not set toapplication/json
, aHeaderNotValidException
is thrown. - The API responds with an HTTP 406 status code and an error message indicating the issue.