Coder Social home page Coder Social logo

baraka-test's Introduction

Running the service with Docker

  1. To run the service with Docker after cloning this repository, you have to first build the Docker image with this command:
docker build baraka-test --tag baraka-test-image

You can change baraka-test-image with other names if you want.

  1. Then to run the service, use this command:
docker run -p 3000:3000 baraka-test-image

Change baraka-test-image with the name you used in the first step.

  1. The service will then be available at:
http://localhost:3000

API Documentation

Get Portfolio by Stock Symbol
  • Method: GET
  • Endpoint: /portfolio/stocks
  • Query Parameters:
    • symbol โ†’ stock symbol, e.g. TSLA, AMZN

  • Example: /portfolio/stocks?symbol=TSLA
Get Portfolio by Bucket Name
  • Method: GET
  • Endpoint: /portfolio/buckets
  • Query Parameters:
    • name โ†’ bucket name, e.g. bucketA, bucketB

  • Example: /portfolio/buckets?name=bucketA

Notes

  1. The list of valid stock symbols are predetermined, please use one of these symbols below:
  • PBR
  • AAPL
  • NVDA
  • NIO
  • AMD
  • F
  • TSLA
  • AMZN
  • AMC
  • CCL

You can choose to modify this list by going to /configs/constants.js and changing the value of VALID_PRODUCT_SYMBOLS.

  1. The list of available buckets and their content are also predetermined, please use one of these buckets below:
  • Bucket A, containing these stocks:
    • PBR
    • AAPL
    • NVDA
    • NIO
    • AMD
  • Bucket B, containing these stocks:
    • F
    • TSLA
    • AMZN
    • AMC
    • CCL

You can choose to modify this list by going to /configs/buckets.js and changing the content of the buckets array.

  1. The list of trades happening with the various stocks are also predetermined. It's available at trades.json and you can modify the file content to change the calculation result given by the APIs.

baraka-test's People

Contributors

ismailnagib avatar

Watchers

 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.