Skip to content

galkin/atto-test-task

Repository files navigation

ATTO Test Task

Task description

This task implemented with SSE instead WS. Motivation:

  • Based on the requirements we need only events from Server, so WS as duplex protocol is overhead.
  • Based on the requirements we need auto-reconnection, SSE has that from the box.
  • Project evolving will require subscriptions in WS. REST routing is simpler for implementation.
  • Known SSE limitation resolved by using http2 and eventsource-polyfill
  • The last, but not the least coincap already has WS API

Other notices:

  • Scrapping timout decrised and added checking do we have new values.
  • Frontend implemented with React as render library without bundling via WebPack.

Development

Tooling

  • Node.js with LTS version. Right now 10.15.1
  • npm version 6.4.1
  • typescript for typechecking and support decorators, BigInt.

Project structure

Project structure based on The Entity-Control-Boundary Pattern

Boundaries

  • coincap - client for coincap api
  • http2-server - server with http2 support. In production should be protected by Nginx.

Entities

Classes with class-transformer decorators for models from Domain.

Controls

Scrapper

Store last assets values.

Configuration

We use The Twelve Factors manifest. Check .env.example file and create .env copy for local development.

Running

Develop mode

Run npm run watch. Auto any changes at src folder nodemon will restart application.

Standard mode

npm run start

Dockerized node

Run docker-compose up

Testing Approach

  • tslint is used for checking code style and TS best practice. Use npm run lint-fix for autofixing common tslint errors.
  • typescript is used for checking types.
  • jest is not implemented, but planned.

Deploy

This is test task. There are not autodeploy, but it can easily deploy to any Docker-based environment.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published