Skip to content

evahteri/github_starred_repositories_api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Github Starred Repositories API

The API retrieves user's starred repositories from Github and displays the number of starred (public) repositories and their info in JSON format.

Requirements

  • Python 3.10.12 or higher

Instructions

Configuration

  • Create a new OAuth app in Github developer settings.
  • Configure the Homepage URL to http://localhost:8000/
  • Configure Authorization callback URL to http://localhost:8000/callback
  • Generate a new client secret
  • Add your application's Client ID and Client secret to src/configuration.py
  • Install required packages with pip install -r requirements.txt

Running

  • Start server in src folder with python3 main.py
  • Create a GET request to http://localhost:8000/
  • Sign in with Github credentials
  • The application will use the token to fetch starred repositories
  • Shut down the server from command line with CTRL + C

Testing

  • Run tests in root folder with pytest
  • Run coverage run --branch -m pytest src && coverage report -m to get test coverage

Using the included Dockerfile

  • After adding the Client ID and Client Secret, run docker build -t <IMAGE_NAME> .
  • Start the container with sudo docker run -d --name <CONTAINER_NAME> -p 8000:8000 <IMAGE_NAME>
  • The API is now operating at http://localhost:8000/
  • Shut down the API with docker kill <CONTAINER_NAME>

Example

  • GET request with a browser should result in something like this, if the user has starred repositories:

example_run

References/sources used for development

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published