For our Backend Engineers. The core logic of our system lives here, communicating with DS, flowing downwards to FE.
production:
express
helmet
cors
knex
pg
jsonwebtoken
bcrypt
axios
development:
dotenv
sqlite3
cross-env
{
id: 1
username: "bob",
email: "[email protected]",
password: "pass123",
created_at: "1519211809934",
updated_at: "1519211809934"
}
{
ticker: "AMZN",
actionThresholds: {
TA: {
sell: 0.5,
hold: 0.25,
buy: 0.25
},
Sentiment: {
sell: 0.5,
hold: 0.25,
buy: 0.25
}
}
}
{
[
"AMZN",
"GOOG",
"JPM",
"AAPL"
]
}
- Log an existing user in
Expected Payload:
{
email: "[email protected]",
password: "pass123"
}
Returns:
{
token: "token"
user: {
username: "bob",
email: "[email protected]"
}
}
- Register a new user
Expected Payload:
{
email: "[email protected]",
username: "bob",
password: "pass123"
}
Returns:
{
token: "token"
user: {
username: "bob",
email: "[email protected]"
}
}
- Get a user's favorite stocks
Expected Header:
Authorization: "token from local storage or app state"
Returns:
{
[
{
"id": 1,
"ticker": "AAPL",
"created_at": "1519211809934",
"updated_at": "1519211809934",
"data": {
"actionThresholds": {
"TA": {
"sell": 0.13,
"hold": 0.66,
"buy": 0.21
},
"Sentiment": {
"sell": 0.5,
"hold": 0.25,
"buy": 0.25
}
}
}
},
...
]
}
- Add to a user's favorite stocks
Expected Header:
Authorization: "token from local storage or app state"
Expected Payload:
{
ticker: "AMZN"
}
Returns:
{
[
{
"id": 1,
"ticker": "AAPL",
"created_at": "1519211809934",
"updated_at": "1519211809934",
"data": {
"actionThresholds": {
"TA": {
"sell": 0.13,
"hold": 0.66,
"buy": 0.21
},
"Sentiment": {
"sell": 0.5,
"hold": 0.25,
"buy": 0.25
}
}
}
},
...
]
}
- Deletes a user's favorite stock
Expected Header:
Authorization: "token from local storage or app state"
Expected Payload:
{
ticker: "AMZN"
}
Returns:
{
[
{
"id": 1,
"ticker": "AAPL",
"created_at": "1519211809934",
"updated_at": "1519211809934",
"data": {
"actionThresholds": {
"TA": {
"sell": 0.13,
"hold": 0.66,
"buy": 0.21
},
"Sentiment": {
"sell": 0.5,
"hold": 0.25,
"buy": 0.25
}
}
}
},
...
]
}
- Returns all unique stocks' information that have been searched previously
Expected Header:
Authorization: "token from local storage or app state"
Returns:
{
[
{
id: 1,
ticker: "AMZN",
created_at: "1519211809934",
updated_at: "1519211809934",
data: {
actionThresholds: {
TA: {
sell: 0.38,
hold: 0.43,
buy: 0.19
},
Sentiment: {
sell: 0.5,
hold: 0.25,
buy: 0.25
}
}
}
},
...
]
}
- Returns a stock's information
Expected Header:
Authorization: "token from local storage or app state"
Expected Parameter: The ticker symbol of the stock Returns:
{
ticker: "AMZN",
actionThresholds: {
TA: {
sell: 0.5,
hold: 0.25,
buy: 0.25
},
Sentiment: {
sell: 0.5,
hold: 0.25,
buy: 0.25
}
}
}
- Returns the top 5 most searched for stocks
Expected Header:
Authorization: "token from local storage or app state"
Returns:
{
[
{
"rank": 1,
"ticker": "B",
"number_of_searches": 25,
"created_at": "1558663802271.0",
"updated_at": {
"id": 6,
"ticker": "B",
"created_at": "1558663802271.0",
"updated_at": "1558663818489.0"
}
},
...
]
}