This app will find out how many stars a GitHub user has across all their public repositories.
I will use:
GitHub API
to get information about user and repositoryNodeJs
to handle the HTTP requests and retrieve the number of stars from given repositoryredis
as a caching layer to speed things up!
- Currently this app can retrieve stars for one particular repository by providing user name and repository name.
- For API testing I used Nock so that I can mock the GitHub api response and my tests don't rely on actual GitHub api. I have used async and await for the first time so was not sure how to first write the test and then implement the code to pass them.
- Next step is to research about redis-async as I am using
async
andawait
for asynchronous request and redis-async will allow me to use async and await for making request to redis client.
git clone git@github.com:reenz/github-repos-stars.git
npm install
to download the dependenciesnpm start
to run- open the browser and type
localhost:3000/username/reponame
to retrieve stars npm test
to run the tests
git clone git@github.com:reenz/github-repos-stars.git
npm install
to download the dependenciesdocker-compose --build
to build imagedocker-compose up -d
run in detached mode- open the browser and type
localhost:8080/username/reponame
to retrieve stars docker-compose run web npm test
to run the tests