Sentiment analysis is the processing of analyzing text and attempting to identify the emotion behind it. It's a fascinating and trending topic. However, I noticed there were no free web interfaces for performing sentiment analysis on a specific term. I decided to create this by performing a Twitter search for a specific term and gathering sentiment analysis details on that term by the Tweets that were discovered. Doxa is an ancient Greek word meaning "popular opinion".

I created the backend with Python and Flask. I used flask-graphql for a GraphQL endpoint. Whenever a GraphQL request was made, my Python script would fetch Twitter results, perform the sentiment analysis using VADER, and give the results back. I also stored the results in a Mongo database which stayed there for about 10 minutes. If another user made the same request within 10 minutes, they would get results instantly. I built the front-end using Next.js, and used Apollo Client for the GraphQL client. I also used Material-UI as a design framework, although I customized it heavily. I added a light theme and a dark theme. I detect if the user has a dark theme or light theme set, then change the theme accordingly. If neither is set, it defaults to light theme.

Doxa was a lot of fun to build. If I were to do it over, I'd probably use PostgreSQL instead of MongoDB. Mongo was nice to use at first, but when adding new features I had to constantly re think my schema and some things were very inefficient. The key-value pair structure of Mongo has a lot of great uses but it became too restrictive when trying to add new features.

with by Alexander Cardosi