/URT

united remote quiz

Primary LanguagePHP

UNITED REMOTE TEST (URT)

I'm in charge to build a REST microservice that list the languages used by the top trending public repos on GitHub.

Problem

Github API doesn't include anyway to get top 100 trending repos, they have a web page that can be found here and it only return 25 repos.

Solution

we could use scrapping and get elements from the web page but Luckily after some search i found a nice article 🥳 that can be found here. The solution use Github Archive database and query all repositories which had being stared three times over all the records of the archive in one hour (return about 80 trending repos), after that to detect the main language of each result they fetch the repo using Github API and get the information needed. Finally they provide an endpoint that i will use in this project 😍

Structure

This project built using PHP Lumen Micro Framework and follow PSR

Features

The features currently implemented:

  • list of languages used by the trending public repos on GitHub.
  • Number of repos using this language.
  • The list of repos using the language.
  • Framework popularity over the 100 repos.(in progress)
  • Secure the microservice.(in progress)

Installation

Clone reposotiry:

git clone https://github.com/malohtie/URT.git

Navigate to folder then install the dependencies using composer:

composer install

Start the local development server:

php -S localhost:8000 -t public

Navigate to http://localhost:8000/api/trending and you should see your json result like this.

Imgur

Unit tests

To run unit tests simply execute this command. Make sure you're in the project directory

/vendor/bin/phpunit