Skip to content

Pramuspl/stoka-backend

Repository files navigation

⚠️ The project has not been maintained since December 2021. ⚠️

NestJS API for managing stock data. This is purely a hobby project.

Features

  • Supports both Rest API and GraphQL
  • Username/Password/JWT authentication and authorization
  • Searching financial instruments of different types and traded on multiple markets
  • Adding instruments to a personal collection
  • Retrieving and storing historical price data. Can be trigerred manually or by a CRON job
  • 🚧 WIP: Alert on price reaching a predefined value (prelude to stop loss and similar)

The application utilises 4 external APIs to retrieve stock data:

  • Alpha Vantage
  • Quandl
  • Markestack
  • GPW (Polish Stock Exchange)

Module description

  • Alpha Vantage/Quandl/Marketstack/GPW - retrieve financial instruments data from external APIs and return it in a standardised format
  • Search - retrieve combined results from the external APIs
  • Symbol - handles CRUD operations on symbols and the corresponding price data
  • Auth - handles authentication using username/password and JWT. It also provides guards to protect endpoints
  • User - handles user creation and retrieval
  • Scheduler - updates the prices of all existing symbols on predefined periods

Originally, the project was running on GCP VM using pm2 process manager

Run to get host IP: cat /etc/resolv.conf

Setting up service on the VM:

  • sudo npm install pm2@latest -g
  • pm2 start dist/main.js --name stoka_service --watch (pm2 restart, reload, stop delete)
  • copy .env file
  • npm i on package updates

About

An API in NestJS for managing stock data

Resources

Stars

Watchers

Forks