This project is a recruitment task developed to demonstrate proficiency in building RESTful APIs using Java and Spring Boot. The application interacts with the GitHub API to retrieve information about a specified user's repositories.
- Retrieve User Repositories: Fetches a list of public repositories for a given GitHub username.
- Optional Authentication: Supports the use of a GitHub personal access token to increase API rate limits.
- Java: Primary programming language.
- Spring Boot: Framework for building the application.
- Gradle: Build automation tool.
- Java Development Kit (JDK): Ensure JDK 8 or higher is installed.
- Gradle: Included in the project; no need for a separate installation.
- Clone the Repository:
git clone https://github.com/SecCodeSmith/Java-Springboot-simple-usage-github-api.git cd Java-Springboot-simple-usage-github-api - Run the Application:
- On Linux/macOS:
./gradlew bootRun
- On Windows:
gradlew.bat bootRun
- On Linux/macOS:
- Retrieve User Repositories:
- URL:
http://127.0.0.1:8080/api/user/{username} - Method: GET
- Headers:
Accept: application/jsonToken: {GITHUB_TOKEN}(Optional)
- URL:
curl -H "Accept: application/json" -H "Token: YOUR_GITHUB_TOKEN" http://127.0.0.1:8080/api/user/octocatThe API responds with a JSON array containing the user's public repositories, each with details such as repository name, description, and URL.