/GithubSearcher-api

A backend api for searching and storing github users, issues, repositories in redis db.

Primary LanguageTypeScript

Github Searcher

Description

Write an "Search" Backend API endpoint which eventually collect the data from Github & stores it in REDIS.

Requirements

  • Express
  • TypeScript
  • Redis
  • Swagger
  • Create Api Endpoint: Receives a POST request with search type(users or repositories or issues) & search text(mandatory).
  • The results will be fetched from the GitHub API & cache it for atleast 2 hours.
  • Create Api Endpoint: Clear Backend Caching
  • Add Caching so that the same request is not called again.
  • Add Swagger Documentation
  • Add Caching so that the same request is not called again.

Setting up the project

Install dependencies

npm install

Run the server

npm run serve

visit the url: http://localhost:8000/api-docs

What's in my mind

  • I could have used a swagger jsdoc library to generate the swagger documentation.
  • For Express.js I would rather use NestJS a moder framework support typescript out of the box, and generate swagger documentation,redis, best practices, and much more.
  • Generate types and interfaces for the responses for the frontend since we are using swagger.
openapi-generator generate -i swagger.json -g typescript-axios -o generated --skip-validate-spec --enable-post-process-file