Skip to content

ask77nl/videos-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

Test assignment demonstrating a simple Node.js microservice. It fetches lists of media objects from different sources, normalizes them and returns the resulting list via a REST API.

Installation and start-up

This is a standard node.js microservice. Use the following npm commands:

  • npm run lint - runs the eslint and should be preformed before each check in
  • npm start - starts the server
  • npm run debug - starts the server with node's built-in debugger
  • npm run build - transpiles the source code with babel
  • npm run serve - starts the babel-transpiled server

Server runs by default on port 4100. Use http://localhost:4100/v1/api/videos?sorted=true to get a sorted JSON list of videos.

Modules

Module separation follows 'Clean Architecture' principles by Martin Fowler The microservice conists of the following modules:

  • Controllers Express endponts that accept requests via the network. The main goal is to map incoming parameters for a Search Logic function, execute Search Logic and return the result to the consumer.

  • Models Thin models are responsible for data mapping and normalization between external sources and Search Logic.

  • Services/Search Logic Search functions accept incoming parameters, sanitize then and perform all required data requests. Search logic is the place for all business logic. It is operating independently of any data sources formats or interfaces.

  • Services/Data Requests Commands, that perform network requests to different services and map incoming data for Search Logic consumption

Technologies

This is an Express.js service that utilizes Babel to support JavaScript ES6 and ES7 features. It enforces the AirBnb JavaScript styleguide.

It uses these JavaScript libraries:

  • config
    • for environment based network configuration
  • winston
    • for logging
  • express
    • for HTTP server
    • for middleware
  • lodash
    • for data manipulation
  • dot-object
    • for data transformation

About

Videos backend sample

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published