thatshailesh / modbox

Benford law API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Trading volume distribution using BF law

Benford's law stock API using Nestjs.

Requirements

A few things to note in the project:

  • Github Actions Workflows - Pre-configured Github Actions to run automated builds and publish image to Github Packages
  • Dockerfile - Dockerfile to generate docker builds.
  • Docker-compose - Docker compose script to build and start container.
  • OpenAPI 3.0 Spec - A starter template to get started with API documentation using OpenAPI 3.0. This API spec is also available when running the development server at http://localhost:3000/swagger-api
  • .env file for configuration - Change server config like app port, mongo url etc
  • Jest - Using Jest for running test cases

Getting Started

  • Clone the repo
  • cd /modusbox-test && npm install

Configuring env variables

Create .env files and add the relevant values for the variables. Note: Find used env vars in .sample-env

Development

Start dev server

npm start

Running the above commands results in

  • 🌏API Server running at http://localhost:3000
  • ⚙️Swagger UI at http://localhost:3000/swagger-api

Packaging and Deployment

Build and run with docker

docker-compose build
docker-compose up

Deployment

Deployment is automated with Github Actions and deployed on heroku

Heroku Public Url

https://modusbox.herokuapp.com/

Testing the application

Unit test

npm run test

E2E test

npm run test:e2e

Coverage

npm run test:cov

About

Benford law API


Languages

Language:TypeScript 94.9%Language:JavaScript 3.9%Language:Dockerfile 1.2%