The API retrieves user's starred repositories from Github and displays the number of starred (public) repositories and their info in JSON format.
- Python 3.10.12 or higher
- 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
- 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
- Run tests in root folder with
pytest - Run
coverage run --branch -m pytest src && coverage report -mto get test coverage
- 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>
- GET request with a browser should result in something like this, if the user has starred repositories:
