Giter VIP home page Giter VIP logo

royalty-payments's Introduction

royalty-payments

System to record and calculate royalty payments owed to Rights Owners based on viewing activity of customers. The system is basically a REST api server and a store which can be an in-memory one or a redis cache.

HOW TOs

Prerequisites

To set up the project you need first to install: node and npm.

After that, just run:

npm ci

Available Env Vars

Name Description
LOG_LEVEL Defines the log level. It could be: info, error, warning, debug, fatal. Default value: info
PORT Specifies the port number in which the server will be listening. By default is 3000
REDIS_PORT If you are NOT running the app in local mode (See next section) you can specify the port number of the real redis cache using this env var. By default is 6379
REDIS_HOST If you are NOT running the app in local mode (See next section) you can specify the host name of the real redis cache using this env var. By default is 127.0.0.1

Testing the app

Running the following command the syntax will be checked against eslint (airbnb style guide) and all tests will be executed. A coverage report will be shown and the end of the command.

npm test

Running the app

Locally with in memory redis

Just execute this command:

npm run local

Against a real redis cache

Take into account that you could set up redis and the certain server properties through environment variables. To run the server against a real redis cache just execute this command:

npm start

API specification

In docs folder you can find the api definition in swagger.json file. It is written down in swagger 2.0. When the server is running the doc is also available in \docs endpoint.

Deployment

In the deployment folder there is a script which allows you to deploy the system in ecs fargate service. But first you will need to create the infrastructure which can be found in this repo. After that it is just a matter of execute deploy.sh. During the execution you will be prompted to enter your ECR URI, example: 201335378792.dkr.ecr.eu-west-1.amazonaws.com/royalty-ecr

royalty-payments's People

Stargazers

Nicolas Dedual avatar

Watchers

James Cloos avatar Miguel Ángel Pintor Moral avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.