Skip to content

sadokmtir/github-repo

Repository files navigation

GITHUB API

To run the app just type npm iand then docker-compose up.

The backend will run on: http://localhost:4000. You can always change it from the docker-compose file. It will also run on watch mode for better development experience.

Testing:

  • Jest was used for unit testing and Supertest was used for API testing.
  • two unit tests are implemented and one functional(integration) test for the Rest API, tests reside in the test folder.

To run the test npm run test.

All different APIs filters are implemented within the API tests, check them for clearer overview.

REST API:

Using custom stream

This endpoint get all the repos page by page and return the result of each page on an ongoing stream. Less footprint on memory, performance and latency were the motivations behind this implementation. (All requests without specified amount which is top query param here are returning custom stream).

Using simple response

As here we have a limited number this won't result on huge chunk of date and latency we could pump the result out once we have it.

Some General Notes:

  • This project was created using typescript and does not include an explicit build step (for transpiling typescript to js), it is done using the ts-node (https://github.com/TypeStrong/ts-node) which eliminates the burden of figuring out the error line on the actual typescript file (it has a nice source map support).

Next Steps:

  • If would invest more time I would add caching to this solution probably using redis.

About

Gets list of github repos from a start date

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published