Skip to content
NathanFrank285 edited this page Apr 23, 2021 · 4 revisions

Front end Routes

/Dashboard

Logged in

  • GET /dashboard
    • only for logged in users

Not Logged in

  • GET /
    • splash page, info about site, exclusively for logged out users, only option is to login which then redirects you to Dashboard login

/Price

  • GET /Price
    • returns a list of coins (each row a component with name, ticker, price, change, market cap, watchlist button) on the platform
      • each component links to the coins

Back end Routes

/Watchlist

  • GET /watchlist
  • POST /watchlist/<int:coinId>
  • DELETE /watchlist/<int:coinId>

/Coindetail && Searchbar

  • GET /price/<str:coinName>
    • includes price graph, 24h coin data

/Portfolio

  • GET /portfolio
  • POST /portfolio/:coinId
    • on a purchase or sale, check if the user already owns the coin, if they do, recalculate average cost with the new current quantity and rolling average price with the new purchase quantity and price
    • Buying: Calcing new cost per share
      • Order of operations: old avg. price / old quantity = total cost per share(tcps)
      • tcps + (new quantity * new price) = new total cost per share(ntcps)
      • ntcps/old quantity + new trade quanity = new avg. price
    • Selling: Calcing new cost per share
      • avg. cost should be the same, just subtract the number of coins being sold
  • DELETE /portfolio/:coinId

Clone this wiki locally