Skip to content

Instantly share code, notes, and snippets.

@zogreptile
Created February 6, 2019 16:38
Show Gist options
  • Save zogreptile/ad82d58274d18017c6f4a9ec18868b6f to your computer and use it in GitHub Desktop.
Save zogreptile/ad82d58274d18017c6f4a9ec18868b6f to your computer and use it in GitHub Desktop.

Flow

mini GitHub API client

First screen: owner (organization or user) name input and submit button.

Treat organizations as users: unconditionally use /users/${owner}/repos API.

On submit: show cards with repositories, filters, and sorting.

Only public repos of the owner are shown. Do not waste your time on auth.

Pagination: render "Load more" button at the bottom.

On card click: dialog with repo details is shown.

Cards

Pretty much resembles GitHub's repositories tab:

  • repo name
  • description
  • is repo a fork?
  • stars count
  • updated date
  • language

Filters

Multiple filters can be selected at the same time: they are applied in conjunction (&&). All filters should be implemented on the client, without using type parameter.

  • has open issues

For the sake of future compatibility, use ${prop}_count instead of ${prop}. Example: prefer open_issues_count over open_issues.

  • has topics

As of August 2017, the topics property for repositories is available in preview. You have to provide a custom media type in the Accept header: application/vnd.github.mercy-preview+json.

  • starred >= X times
  • updated after X date
  • type (all, forks, or sources)
  • language

Only one language can be selected at the time.

Do not hardcode language options: they should be determined using downloaded dataset and stay in sync.

Sorting

Order: ascending or descending. Only one of the following can be selected. Sorting should be implemented on the client, without using sort parameter.

  • repo name
  • stars count
  • open issues count
  • updated date

Dialog

  • link to repo on github.com
  • link to fork's source on github.com (only if repo is a fork)
  • contributors table (username | contributions) of the most active (top <= 3) contributors, with profile links
  • languages table (language | Kb) of the most used languages (more than 1Kb)
  • list of the most commented (top <= 5, only currently open) PRs, with links
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment