Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Portfolio-application

A stocks portfolio backend application to trade and view stocks, view portfolio for a user and update stocks.

API routes:

  1. /api/v1/stocks/{stockId} (GET)

-> Gives the details of a stock with id 'stockId'

Screenshot 2024-01-21 at 2 55 21 AM
  1. /api/v1/stocks/upload (POST)

-> Parses the bhavcopy csv file and updates the current prices of all the stocks in the database.
-> To update the details of the stocks, go to Postman and under the POST request options, click on Body.
-> Since a csv file is to be processed, click on 'form-data'. This takes in a key value pair where the key is the file name variable accepted by the controller layer and the value is the csv file.
-> In my code, I am taking the file input by the variable name 'file' - so for the key part, type 'file' and check the adjacent box. Set the input type from Text to File.
-> Finally, upload the csv file in the value field and hit Send.
-> If the update was a success, an integer denoting the total number of records updated is returned as a response.

Screenshot 2024-01-19 at 2 13 55 AM
  1. /api/v1/trade (POST)

-> Takes userId, stockId, typeOfTransaction (buy/sell) and quantity of shares to establish a trade

Screenshot 2024-01-19 at 2 14 57 AM
  1. /api/v1/portfolio/{userId} (GET)

-> Takes userId as the request parameter and returns the current holdings of the user 'userId'

Screenshot 2024-01-19 at 2 16 01 AM

About

A stocks portfolio backend application to trade and view stocks, view portfolio for a user and update stocks.

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages