A powerful microservice backend API router for the Oracle Chrome extension.
The backend API has the following API endpoints that the Chrome extension hits up for complicated information processing and natural language processing. Provided is the set of API endpoint inputs and outputs, along with the types generally required of the payload.
POST /user
- Input:
JSONObject
- {email:
string
, googleId:string
}
- {email:
- Output:
200
- User is in the system404
- User is not in the system
- Input:
POST /users
- Input:
JSONObject
- {email:
string
, googleId:string
, history:[HistoryItem]
}
- {email:
- Output:
200
- User was successfully added
- Input:
POST /nlp
- Input:
JSONObject
- {googleId:
string
, webpage:string
}
- {googleId:
- Output:
NLPResultList
- Input:
The backend currently has one microservice that it depends on - the NLP microservice, which actually parses through the webpage data, runs NLP and turns it into the actionable data that is then used for the rendering of the information cards from within the extension.
The following custom types that were defined on the API endpoints are defined as follows:
JSONObject
: A JSON serialization representation of an object/dictionaryHistoryItem
: A Chrome HistoryItem https://developer.chrome.com/extensions/history#type-HistoryItemNLPResultList
: [{metadata:{type:string
, term:string
, category:string
}, data:?}]- type could be a string from the following:
google-maps
google-calendar
youtube-video
twitter-tweet
wikipedia-information
yelp-information
uber-request
- data depends on the type
google-maps
:string
- data is a URL string that directly leads to a Google Map
youtube-video
:string
- data is a URL string that directly leads to a Youtube video
twitter-tweet
:JSONObject
- data is a JSONObject that directly leads to the relevant Twitter tweet
- {author:
string
, tweet:string
, authorImage:string
}
wikipedia-information
:string
- {name:
string
, description:string
, images:[string]
}
- {name:
yelp-information
:JSONObject
- {name:
string
, description:string
, ratings:float
, images:[string]
}
- {name:
- type could be a string from the following:
The NLP Microservice is invoked by the Oracle backend by using ZeroMQ and TCP sockets for microservice communication and sending this JSON schema payload through (tcp socket being available at localhost:8888
:
{userId:string, webpageText:string}