Stock Trading Backend made with Python Flask
POST /api/login
Parameter | Type | Description |
---|---|---|
email |
string |
Required. Your email |
password |
string |
Required. Your password |
POST /api/register
Parameter | Type | Description |
---|---|---|
email |
string |
Required. Your email |
password |
string |
Required. Your password |
uname |
string |
Required. Your user name |
Log Out
POST /api/logout
Test Auth Token
POST /api/token_test
pass bearer token for testing token
Get new Auth token
POST /api/new_token
Add new asset
GET /api/add_stock
Parameter | Type | Description |
---|---|---|
name |
string |
Required. name of asset |
balance |
string |
Required. balance of asset |
Get user portfolio
GET /api/get_stock
Sell Stock
GET /api/sell_stock
Parameter | Type | Description |
---|---|---|
aid |
string |
Required. asset Id |
amount |
string |
Required. amount to sell |
Sell Stock
GET /api/buy_stock
Parameter | Type | Description |
---|---|---|
aid |
string |
Required. asset Id |
amount |
string |
Required. amount to buy |
Get Price
Socket /
Send name of cryptocurrency to get latest price
Install requirements
pip3 install -r requirements.txt
To run tests, run the following command
python3 test.py
To deploy this project run
npm run deploy
Start the server
python3 app.py