D2. Design Document

Architecture Diagram

Image Sources:

https://upload.wikimedia.org/wikipedia/commons/1/1f/Python_logo_01.svg

https://upload.wikimedia.org/wikipedia/commons/8/83/AnantP%40javascript.png

https://upload.wikimedia.org/wikipedia/commons/thumb/8/8e/Nextjs-logo.svg/207px-Nextjs-logo.svg.png

https://user-images.githubusercontent.com/6509926/70553550-f033b980-1b40-11ea-9192-759b3b1053b3.png

https://a0.awsstatic.com/libra-css/images/logos/aws_logo_smile_1200x630.png

https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.reddit.com%2Fdev%2Fapi%2F&psig=AOvVaw2eFWMd1zOQwgv92xVGX-uT&ust=1677519651216000&source=images&cd=vfe&ved=0CA8QjRxqFwoTCJiejunds_0CFQAAAAAdAAAAABAQ

Platform Selection

TechnologiesProsCons
JavaScript/TypeScript ✅-Used commonly for web development so necessary for our web app
-Supports many frontend frameworks that will make it easier to build functional components
-Very prone to bugs/issues as Javascript itself is a loosely-typed language, but by
using Typescript rather than Javascript, which supports static/strong typing which will combat this issue and prevent bugs
Python ✅-Necessary for our app in order to run the NLTK Python library as well as other
Python libraries such as pandas, numpy, and matplotlib
-There exists multiple popular backend frameworks in Python such as Flask, Django, etc
Next.js ✅-Open-source framework built on top of React, thus has all the added benefits of React as well as an easy migration from React to NextJS if needed
-Provides server-side rendering capability by default unlike React to load web apps faster initially
-Well-maintained documentation
-Less community support than the general ReactJS framework
Server-Side Rendering and a Web App ✅-NextJs supports Server-Side Rendering, thus our web app will be rendered accordingly
-Server-Side Rendering renders much faster initially than Client-Side Rendering for dynamic websites
-Slower to load than Client-Side Rendering with apps that have many features/interactions which isn’t true for our application as of yet
FastAPI ✅-Allows for a much quicker, direct way to build an API in Python
-Can be maintained and easily tested since FastAPI has a built-in data validation feature
-Supports features that allow testing for API requests
-Supports asynchronous requests
-Much newer compared to Flask which was brought out in 1999
-Has a smaller community support
Flask-Popular open-sourced Python backend framework with a lot of support and
-Considered to be more “light-weight” to use compared to other Python frameworks including Django, etc 
-Does not provide a built-in data validation feature
-Lacks support for asynchronous requests
AWS ✅-Client Recommended
-Complex
-Takes a while to get configured and running compared to Firebase
Firebase-Client also recommended
-Multiple team members have familiarity with Firebase
-Easy to use and understand with extensive documentation
-Provides all services required for the app including dbms, storage, and hosting
-Pay as you go service
-Rigid format in terms of reading/writing to database
DynamoDB ✅-DynamoDB is a NoSQL database used by AWS, since we will be be using AWS for both hosting and database, this will be our database
S3 ✅-S3, a feature of AWS, is specifically designed to store files, thus this will be how we store any files we may or may not need to store
Pandas ✅-Popular Python library in the data science world used to develop on datasets to create dataframes
NumPy ✅-Widely-used and heavily supported Python library that
supports mathematical functions allowing us to modify our dataframe, numpy is a dependency of pandas
Matplotlib ✅-Extensive and well-supported Python library that will allow us to model and plot/graph our dataframes
NLTK ✅-Popular Python library that will allow us to tokenize comments/titles/sentences and then run a sentiment analysis to get a score between [0,1] inclusive to determine the sentiment between negative to positive

Specific hardware or OS being built for?: No.

No Client Restrictions

Sources:

https://radixweb.com/blog/nextjs-vs-react#next

https://scythe-studio.com/en/blog/client-side-vs-server-side-rendering

https://www.turing.com/kb/fastapi-vs-flask-a-detailed-comparison

https://www.codecademy.com/article/introduction-to-numpy-and-pandas

https://www.monocubed.com/blog/top-python-frameworks/

Access to reddit API and cleaning/wrangling reddit api data -> https://towardsdatascience.com/how-to-use-the-reddit-api-in-python-5e05ddfd1e5c