Hello! This is an API that helps you to find out if a GitHub user has one or more languages in one of its repos.
After giving to the endpoint a username and one or more languages to search for, this service will search for users by the given username, then, it will check the languages of all repos these users have and return some info about the user along with the languages you first mentioned.
Example... If you search for the user 'celsopalmeiraneto' and languages 'javascript and erlang', as of Nov 22nd 2018, you will have the info about Celso and will notice that he has JavaScript on his repos, but not erlang.
As this service does scan all repos, for all users found, it will probably run over the GitHub's API quota very fast!!! If you search, for example, for the user 'google', it will consume all hourly limit on the blink of an eye, as it will search for all users with 'google' in the name, trust me, there a bunch of them.
-
Clone this repo in your local machine.
-
Download, install and run Docker.
-
Open your terminal and navigate to the directory where you downloaded this repo.
-
If you have a CLIENT_ID and CLIENT_SECRET of a GitHub app or want to set a custom timeout, create a copy of the file
.env.example
as.env
and fill the environment variables.On Windows, run:
copy .env.example .env
; On MacOS or Linux, run:cp .env.example .env
-
Run the following command:
docker build -t gh-search .
Don't forget to copy the "." at the end. -
Run the command
docker run -p <port>:3000 -d gh-search
, replace<port>
with an available port in your computer. -
Now you can consume the API using the port you defined. Check the API for more info.
Here you will find a simple Hello World message!
:username
- The username to search for.
:languages
- A comma separated list of languages.
In my computer, I used the port "3001", to test I would use:
http://127.0.0.1:3001/search/users/celsopalmeiraneto/languages/javascript, erlang
Where http://127.0.0.1:3001
is the host and port, and /search/users/celsopalmeiraneto/languages/javascript, erlang
is the method I am calling.
- Implement integration tests.
- Replace the Promise.All with serial operations. GitHub does not recommend parallel calls to its API.
- Implement caching of the requests.