-
Notifications
You must be signed in to change notification settings - Fork 0
Architecture
Our TextPenguin project will be a SPA. SPAs are apps that do not require page reloading during use, so as a user navigates through the website, the data will not have to be reloaded. Angular will be used as the frontend and Django will be used as a backend using Django REST framework. Since SPAs are fairly easy to debug with Chrome, it should help during development.
https://www.textpenguin.com/analyzed
https://www.textpenguin.com/recentlyUsed
https://www.textpenguin.com/resources
https://www.textpenguin.com/about
https://www.textpenguin.com/login
https://www.textpenguin.com/login_create
We will be implementing a REST API. We will be using the Django REST framework as it provides built in support for creating REST APIs.
login(UserName, Password): hashes the inputted password and checks the database an entry with a username that matched the inputted username, and a password that makes the hash
logout(): logs out the current signed in user (no parameters) signup(UserName, Password): first checks to see if a user already exists with the given username, if not it adds a user to the database
isLoggedIn(): returns the username of the currently signed in user and returns null if no user is signed in
createProject(ProjectName, UserName, ListOfDocuments): creates a new project with the given name, under the user’s account. A list of documents can also be included (the list may be empty or just have one document) and these documents are associated with the project
updateProject(ProjectName, UserName, ListOfDocuments, NewProjectName): edits an already created project. This could be adding more documents or changing the name of the project.
deleteProject(ProjectName, UserName, ListOfDocuments): A way to delete a project in the database
Login View: This view displays text fields for the username and password of the user. The user enters their credentials to the website.
Forgot Password View: This view displays a text field for the users email. The user can enter their email to recover their password.
Account Creation View: This view is where users can enter their credentials to create an account on the website.
Browser Extension Menu View: This view is the main menu of the browser extension. On this view, users select which algorithm they wish to run on their webpage.
Browser Extension SA view: This view allows users to input preferences about how they want the Sentiment Analysis algorithm to run on their webpage.
Browser Extension TF-IDF View: This view allows the user to select preferences about how the TF-IDF algorithm will run on the webpage.
Home View: This view will either default to a blank gray middle screen or will show the document that the user is trying to analyze. This view allows the user to change the page to the Recently Used, Resources, or About page. The user can create a new project from this view and view the files in the current project they are working on. The user can upload a document from their computer by searching their computer, dragging the file from the computer, or by entering the URL. The user can set the parameters for the algorithms by either pressing the buttons to the right of either Term frequency-inverse document frequency, Sentiment Analysis, and Latent Direchlet Allocation. The user can then analyze the document with the parameters they have set.
Tf-idf parameters view: This view allows the user to input the parameters for the Term frequency-inverse document frequency algorithm. They can choose whether they would like to print the full output to the file and input the stop-words that they would like ignored.
Sentiment Parameters View: This view allows the user to input the Train vs. Test Ratio, the Number of Topics, How many topics they want printed, if they want to print the full output to the file, and the stop-words they want ignored when the document is analyzed with sentiment analysis.
Lda Parameters View: This view allows the user to input the Train vs. Test Ratio, if they want to print the full output to the file, and the stop-words they want ignored when the document is analyzed with Latent Direchlet Allocation.
Create Project View: This view allows the user to name and create a new project (which acts like a folder). The user can input the name of the new project they want to create.
View Files View: This view allows the user to see the other files that are located in the project if the file they are currently working on is in a project. The names and extensions are displayed in this view.
Output View: This view will display the document the user is having analyzed. The user can navigate between the Recently Used, Resources, and About pages. The user can create a new project and view the files in the project if one exists. When the gray box on the right is clicked the analysis for each algorithm will appear.
Tf-idf Output View: This view allows the user to see the output of the Term Frequency-Inverse Document Frequency algorithm. The user can download the results.
Sentiment Output View: This view allows the user to see the output of the Sentiment Analysis algorithm. The user can download the results.
Lda Output View: This view allows the user to see the output of the Latent Direchlet Allocation algorithm. The user can download the results.
Resources View: This view displays links to see the algorithms and python libraries that were used in order to analyze their documents. The user can click the links to be sent to their origin. The user can navigate to the Home, Recently Used, and About Pages.
About View: This view shows the user information about the project and the creators. The user can navigate to the Home, Recently Used, and Resource Pages.
Recently Used View: This view will show a preview of a document from each of the projects that the user has worked on thus far. The user can create a new project. The user can right-click a ready made project to get a dropdown menu. The user can navigate to the Home, Resources, and About pages.
New Project View: This view allows the user to create a new project. The user can input a name for the project. The user can browse their computer for files they want to put in the project.
Recently Used Right-Click View: This view shows a dropdown menu to delete or rename the project.
Users Table
- UserID (Int, unique primary key)
- UserName (Varchar)
- Password (Varchar)
Projects Table
- ProjectID (Int, unique primary key)
- ProjectName (Varchar)
- UserID (Int, foreign key)
- CreationDate (Datetime)
- LastEditedDate (Datetime)
Documents Table
- DocumentID (Int, unique primary key)
- DocumentText (MediumText)
- ProjectID (Int, foreign key)
- DateEdited (Datetime)
- Query to get a user’s documents
- Does require a join
- Query to get a user’s projects
- If we want to know the user’s name, does require a join
- Query to get a project’s documents and date information
- Does require a join
- Query to get a count of documents in a project
- No join needed
- Query to delete everything associated with a particular user from all tables
- Does require a join