ladymeyy / npmDependenciesTreeService

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Exercise

NodeJS has a managed packages environment called npm. A package is a functional NodeJS module with versioning, documentation, dependencies (in the form of other packages), and more.

This repository contains a NodeJS server with a /package endpoint. When passed a package name and version, the endpoint returns the dependencies of that package.

Prerequisites

Getting Started

At the project root run:

docker-compose up --build

Then you can try the /package endpoint.

curl -s http://localhost:4001/package/react/16.13.0 

Missing Things (in order to make it production ready:

  • Returns only naive version (doesn't consider the Semantic Versioning )
  • A proper logger
  • Metrics (e.g - amount of incoming requests, request time handling etc.. )
  • Tests unit tests - with mocking the Redis && e2e tests with a dedicated docker for testing
  • Load tests for being sure about scaling possibilities
  • Healthcheck route
  • Adding the most frequently requested packages to cache (their entire tree structure)
  • Compress the json before sending the response
  • Better error handling

About


Languages

Language:JavaScript 94.8%Language:Dockerfile 5.1%