Skip to content

About

Provides repositories and their branches by username. Reactive multimodule REST application with api module generated from OpenAPI doc

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

10 Commits

Folders and files

Repository files navigation

Github repository

Provides repositories and their branches by username

How to run

Java 21 & Maven should be accessible on $PATH

mvn install
cd github-repository-service
mvn spring-boot:run

Request example

curl -i -X GET http://localhost:8080/repositories?username=morphlne

Response example

{
  "repositories":[
    {
      "repositoryOwnerLogin":"morphlne",
      "repositoryName":"graph-api-authentication",
      "branches":[
        {
          "branchName":"master",
          "lastCommitSha":"761a3bf3c68168dfebdf0db5cab5d8c295c91a23"
        }
      ]
    }
  ]
}

Swagger UI

Swagger UI is accessible on http://localhost:8080/swagger-ui.html and OpenAPI spec on http://localhost:8080/api.yaml

Project structure

Project consists of 2 submodules:

  1. github-repository-api

The API module is completely generated from OpenAPI specification using openapi-generator-maven-plugin

Run mvn verify to generate

  1. github-repository-service

The Service module is based on Spring WebFlux - Project Reactor adoption for Spring ecosystem

Important components of the Service module:

Github REST API

Github REST API is used as a source of information about repositories and branches

Github token

If you reached rate limit for unauthenticated user, you can provide token to get a higher rate limit

github.header.auth: YOUR_TOKEN_HERE

The simplest way to get token

  1. Go to https://github.com/settings/tokens
  2. Click Generate new token

More about authentication on docs.github.com

What's next

  • Add pagination support. For now, only the first 100 repositories and the first 100 branches in each repository will be returned
  • Retry on error & circuit breaker
  • Implement cache
  • Username validation (pattern)
  • Unit & integration tests

About

Provides repositories and their branches by username. Reactive multimodule REST application with api module generated from OpenAPI doc

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages