COMP 4711: Final Project knowledge Base Final Report Version 1.0 Table of Contents Table of Contents 2 Team Information 3 Project Description 3 Technical Assumptions 3 Non - Technical Assumptions 3 Routes 4 Controllers 5 Views 7 Models 8 High Level Schedule 9 Potential Risks and Issues 10 Testing 10 Learnings 12 Appendix 13 ER Diagram 13 Sequence Diagram 13 Project Description For COMP 4711’s final course project, s tudents will be using NodeJS and Express to create a web application similar to a social media platform. This web application is called Knowledge Base (KB) and is catered to sharing information about certain topics and subjects. People can sign up for the site, post and answer questions on their topic of choosing, like other users’ profile, and message other users. Technical Assumptions a. The application will use NodeJS and Express as backend b. The application will be driven with views using a template (our group will use handlebars) c. The application’s database will use a SQL database (our group will use MySQL) d. The group will be using Git/GitHub for version control e. The project requires an API w ith endpoints corresponding to users, posts, discussions and profiles f. The group will need to incorporate authentication for users so that we can associate users with their data when the user interacts with the web application g. The group will need to use a third - party package, such as node mailer , or build infrastructure using AWS services (Lambda, API Gateway, SNS) for relaying message contents Non - Technical Assumptions a. The application will follow an MVC architecture b. The professor will supply image s (e.g. profile pictures, application’s icon) that are used within the application c. The project will comply with the timeline and any issues that arise will be resolved quickly d. The group will correctly allocate roles and responsibilities accordingly so we can meet deadlines as expected Routes / This route will be linked to index method in authController and render the login page /login This route will be linked to login method in authController and render the login page. If successful, it will redirect to the landing page /register This route will be linked to register method in authController and render the register page. If first part of registration checks pass, it will redirect to the about page /about This route is linked from the register method from authController. It renders when registration checks passes. If second part of registration checks pass, registration information is stored into the DB and redirected to landing page /post This route will be linked to post method in postController. If successful, information is stored in the DB and redirected back to the landing page /post/:pagination This route is linked from the getPosts method in postController. This renders posts made by other users from the DB. /post/:postId/replies This route is linked from the getReplies method in postController. This renders replies from other uses from the DB. /post/reply This route is linked from the postReply method in postController. This inserts and updates the DB with the user’s reply to a post /landing This route will be linked to landing method in appController. This renders the landing page. /edit This route is linked to editProfile method in the appController. /messaging This route is linked to messaging method in appController. This renders the message page. /message This route is linked to the sendMessage method in messageController. /message/:conversationId This route is linked to the getMessage method in messageController. Gets a specific conversation with another user and displays the message page /conversations This route is linked to the getConversations method in messageController /sendEmail This route is linked to the sendEmail method in the messageController /like This route is linked to the like and getLikes method in the authController /search This route is linked to the search method in the authController /searchbytopic This route is linked to the searchByTopic method in the authController Controllers appController Responsible for rendering different web pages of the application landing Displays landing page and renders the user’s information from the DB editProfile Updates the user’s information in the DB countUserMessage Counts the number of messages the cur rent user has in their private messages page messaging Displays the messaging page authController Responsible for creating new user profile and login feature of the app index Displays login page with no session ID login Sends post request to DB to verify user login information. If successful, it redirects to the landing page with user’s information register Post new user’s information to the DB. Goes from the login page, then redirected to the about page, then once registration is successful, redirected to the landing page search Matches the user’s input into the search bar and outputs the related discussion posts onto the page searchByTopic Matches the user’s input into the search bar and outputs the related discussion posts onto the page like Selects the appropriate user’s profile and increments the number of likes that user profile has getLikes Retrieves the number of likes a specific user profile has about Displays the about page postController Handles post requests from user to DB post Creates a new post for a user and inserts it into the DB getPost Gets the requested post from the DB and displays the results with the appropriate pagination number getReplies Gets the requested replies for the specific post and displays the results postReply Creates a new reply to a specified post and inserts/updates it into the DB messageController Responsible for displaying/sending messages in the app sendMessage Creates a new message and inserts into the DB and displays it on the messaging view getMessage Fetches the messages between two users from the DB and displays it on the messaging view getConversation Fetches all the conversations a user has and displays it on the messaging view createConversation Selects all of the user’s current conversations with other users sendEmail Retrieves the user’s email information and sends their message contents to their email address Views *grey - coloured cells are folders within the (main) views folder in project structure about.hbs Displays the about page which contains the second part of user’s registration landing.hbs Displays the user’s landing page with user profile, post area, and discussion area messaging.hbs Displays the user’s messaging page register.hbs Displays the register page which contains the first part of user’s registration userprofile.hbs Displays the user’s profile, which contains their information from when the user registered. layouts | main - layout.hbs Shows main signup and sign - in page partials | app | discussionPartial.hbs Displays other users’ discussion posts | editprofilePartial.hbs Displays the necessary fields for user to edit their profile | logoutPartial.hbs Displays the logout button | messagePartial.hbs Displays the user’s private message with another user. | postPartial.hbs Displays the post area found in the landing page | profileCardPartial.hbs Displays the user’s profile information found in the landing page | userCardPartial.hbs Displays a user’s user information to be displays in the messaging page auth | aboutPartial.hbs Displays the about page in the second part of registration | loginPartial.hbs Displays the login portion of the navigation bar | logoutPartial.hbs Displays the logout button | registerPartial.hbs Displays the register page which contains the first part of user’s registration Models Table Name Attribute Type iduser (PK) bigint(20) name varchar(45) firstname varchar(45) user lastname varchar(255) password varchar(45) imageurl varchar(255) about varchar(255) country varchar(45) dob date id (PK) bigint(20) conversations sender (FK) bigint(20) recipient (FK) bigint(20) id (PK) bigint(20) content text replies post (FK) bigint(20) replier (FK) bigint(20) id (PK) bigint(20) subject varchar(100) content text posts topic varchar(100) creator (FK) bigint(20) date timestamp replies bigint(20) messages id (PK) bigint(20) text text sender (FK) bigint(20) conversation (FK) bigint(20) High Level Schedule Dates Description Nov 10 - 16 1. Made a list of tasks to be accomplished. 2. Team Members choose their preferred task and role. 3. Together as a team, finish the initial report document. Nov 17 - 23 1. Team Meetings 2. Complete the alpha version of application Nov 24 - 30 1. Team Meetings 2. Complete the beta version of application Dec 1 - 7 1. Testing 2. Deployment Potential Risks and Issues a. Outside factors could push back estimations/tasks b. Scope of project may widen, and main MVPs not completed c. Integration with 3rd party site/cloud resource (e.g. hosting) could fail if left to the last minute d. Unfamiliarity with languages/resources could slow down processes e. Depending on the number of concurrent users we need the infrastructure to be scalable Testing As a result, from the testing process, we will document how each use case should work with steps and an expected result. Resources that will be required for o ur testing are: ● Test user accounts ● Test data ● Mobile phones Within this list are Features and test cases that are within the scope of our test plan. Action Inputs Expected Output https://domainname.co Launch Application m https://domainname.com/ Enter invalid username & and any username id: invalid Password and hit the login button password:****** Username Does not exist Enter valid username & and incorrect username id: valid Username and Password Password and hit the login button password:****** Does not exist Enter valid username & and valid username id: valid https://domainname.com/l Password and hit the login button password:****** anding Register New User with a username username id: valid that already exists password:****** Username Already exists Register New User with a valid https://domainname.com/r username and password username id: valid egister post that is more than Post a message post that is too long 255 chars post is too long post that is 255 chars https://domainname.com/p Post a valid message or less ost Send a private message to an invalid Specified user cannot be user username: invalid user found Send a private message to a valid user username: valid user Message has been sent https://domainname.com/p Click on your profile click profile button rofile https://domainname.com/p Click on another user's profile click profile button rofile Click on the logout button click logout button https://domainname.com/ This application will undergo multiple iterative smoke testing processes. Our plan is comprised of a set of non - exhaustive tests done by each developer. As developers, we are responsible for verifying that the feature that we are working on is stable enough before further development or moving on to the next feature. In addition to this, our team will be using the GitHub pull request model to ensure that each changeset is reviewed, ultimately deciding if their changes need more work or if it’s suitable for merging. Learnings 1. What did you learn from the project, in terms of knowledge? This project reinforced the concept of the MVC architecture that we learned from lecture and lab. From our code, you can see that we had all the necessary folders that follow the MVC project structure: “controllers” that gets and passes data from the datab ase and outputs it to a view and communicates , “views” that show what the end user sees, i.e. HTML/CSS, “model” that directly interacts with the database and holds the logic to retrieve information from the database. Some of our group members also learne d new things for this project such as: JWT tokens (for authentication), sockets (for instant messaging), session variables, and git (specifically requesting a pull request). 2. What worked and what didn’t? For the most part, our group’s web application work ed well. The only problem we ran into was timing out within the app when we launched the application. We had to continuously log back in if we took to long during testing/demo. Appendix ER Diagram Sequence Diagram * View in next page