https://github.com/sckonung/githubsearch
Simple GitHub repository searcch with using GitHub API
https://github.com/sckonung/githubsearch
github java mvc-architecture rest-api spring-boot
Last synced: 3 months ago
JSON representation
Simple GitHub repository searcch with using GitHub API
- Host: GitHub
- URL: https://github.com/sckonung/githubsearch
- Owner: scKonung
- Created: 2023-08-24T09:03:51.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-26T11:22:33.000Z (almost 3 years ago)
- Last Synced: 2025-01-28T19:16:00.253Z (over 1 year ago)
- Topics: github, java, mvc-architecture, rest-api, spring-boot
- Language: Java
- Homepage:
- Size: 82 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GitHub Repositories Search By Username
### 👨💻 Description
To use the application, you need to provide the GitHub username as a command-line argument. The application will then retrieve the user's repositories that are not forks and display their details in format:
```json
{
"name": "${repository_name}",
"ownerLogin": "${owner_login}",
"branches": [
{
"name": "${branche_name}",
"commitSha": "${last_commit_sha}"
}
]
}
```
### 💬: Response Format
- Header: “Accept: `application/json`”
- Body:
```json
{
"username":"${username}"
}
```
### ⁉️ Error Handling
The application handles different scenarios as specified in the acceptance criteria:
When user give username, which is not exict, application return:
- If the user does not exist, a `404` response is returned with an appropriate error message.
```json
{
"status": 404,
"message": "User with username:${username} not found in GitHub"
}
```
- If the `Accept` header is set to `application/xml`, a `406` response is returned with a message.
```json
{
"status": 406,
"message": "Unsupported xml type. Only JSON is supported."
}
```
### 👨🏫: Tecnology Stack
- Java 17
- Maven 4.0
- Spring Boot 3.1.2
### ✈️: Getting Started
1. Clone this repository to your local machine.
2. Navigate to the project's root directory and execute the following commands in your terminal:
```bash
./mvnw clean install
./mvnw spring-boot:run
```
3. Once the application is successfully started, you can access it by opening your web browser and going to: `http://localhost:8080/get`