Building the backend
In this section, we will be looking at how to create the following APIs for our app:
/api/tweet
: This API is responsible for fetching a Twitter user and obtaining their data./api/nlp
: This API is responsible for running sentiment analysis on the obtained user data.
These APIs will be consumed by the frontend components and will be used to create different visualizations and analyses. Let's start by creating the API to fetch a Twitter user's data.
Building the Twitter API
In this section, we will build an API that makes it easy to obtain tweets in which a Twitter user is mentioned. From each of the tweets, we will obtain their metadata, such as the text, the name of the sender, the numbers of likes and retweets, the device used to tweet, and the time the tweet was created.
To build the Twitter API for fetching a Twitter user's data and structure it to our taste for easy consumption in the frontend, we need to install a...