Skip to content

fetz-selby/GithubRepoExplorer

Repository files navigation

Getting Started

This project was bootstrapped with Create Next App.

Available Scripts

In the project directory, you can run:

npm run dev

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

npm run component

Launches the test window (Cypress).

npm run build

Builds the app for production to the build folder.

App Info

This is a mobile and desktop-friendly app for viewing GitHub users/organization and their repositories. It performs a query search on the given text and returns the first 5 best matches. If there's no matching or similar username, a message is displayed to inform you of the outcome. Also, when there is a connection loss or something wrong with the implementing API, a friendly message is displayed to keep you informed.

API

The app utilizes the GitHub API for fetching the users and repositories. The GET request URLs are /search/users and users/{username}/repos respectively.

Setup

Please modify the .env file and set the TOKEN value. This is required by GitHub for the requests.

App Flow

Screenshot 2023-12-06 at 18 02 30

App State

The chart was created with XState Screenshot 2023-12-06 at 18 14 44

How to use the app

  • Enter a GitHub username in the search field, press Enter, or click on the Search button. Some basic info that the shows about the user is the avatar, username, and the type. The type could either be user or organization.
Screenshot 2023-12-06 at 21 30 01
  • On clicking on any of the users shown will show the repositories of that user. It's an accordion-based component that expands to show the details. The details contained in a repository item include name, description, language, and when last the repo was updated.
Screenshot 2023-12-06 at 21 31 28

State views

(idle)

Screenshot 2023-12-06 at 21 33 38

(loading)

Screenshot 2023-12-06 at 21 34 52

(complete)

Screenshot 2023-12-06 at 21 36 23

(empty)

Screenshot 2023-12-06 at 21 37 11

(error)

Screenshot 2023-12-06 at 21 38 18

Libraries Used

SWR - for fetching (has caching features similar to react-query)

MUI - for styling

Cypress - for testing

Moment - for formatting the date

Octokit - Github API request

Browse App

Click here to browse the App

About

App that allows you to search for github users and view their repositories

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published