For the last iteration my goal was to begin to flush out the chat functionality. I used web sockets which create a bidirectional communication channel between users which works great for live information sharing. I have linked suggested users to individual sockets, which recieve user information so that the currently signed in user can create an individual socket with each different suggested person. I used socket.io and socket.io-client libraries to assist with this.
Some major issues that I stumbled upon were to find a way to route all the user information to unique sockets, I solved it used Redux and actions/reducers which are triggered by an OnClick attached to a chat button on each suggested user. I also struggled to find a way to create a unique room between two users which will be identical regardless of which user initiates the chat.
My goals for the next iteration is to handle the room creation functionality and also the ability to persist messages inside our database and efficiently retrieve them during user scroll. A far stretch requirement which would be nice to implement is the ability to search conversations.
For the last two weeks I was working on the deployment and the friend-recommending algorithm. Having the experience with assignment 5, I deployed the project relatively easier compared to all the struggle I had for the assignment. Finding the suitable algorithm was tricky, I looked up both K-Means and DBSCAN methods, and finally picked K-Modes (categorical version of K-means) as our friend-recommending algorithm.
The major issue was learning the K-means/K-modes and other clustering methods, and comparing between them to choose the beat suit one. I went for K-Modes because it will cluster all data points into clusters, but the downside is that with new data, we need to re-run the model to find the centroids again.
For the next iteration, I am going to link the profile page to the actual registered users and feed the data to the K-Modes methods, and helped to display the recommended friend on main page.
Last iteration I designed and build the UI for chat functionality. I made a footer fix at the bottom for the main page and let the chat button stay at the right bottom as well. The button can open the pop up window for the chat. After that I made user can choose which friend they wanna chat with by adding chat button for each friend index card. Since both cards and the bottom button share the control window's state, I use Redux to make achieve this feature.
The hard part is to understand teammates code and after that using a properly CSS to design the UI. I spent a lot of time to research how to put all things at where I wanted them to be. And also at first I didn't realize I need Redux to do the sharing state, so I just pass down the open/off Boolean from my Footer to the bottom right button. But later on the button on the each card force me to change my strategy.
For the next iteration I think I will keep helping my teammate to improve the chat functionality in order to make sure 2 users can chat properly.
For the past two weeks I worked on improving Login/Logout functionalities by combining jwt, localStorage and Redux so the logged in user info can be easily accessed between web pages; I also intergraded the Pyhthon script into our application, extract/pass real-time user info from MongoDB between Node.js and Phython script. Now our K-mode algorithm is able to run on the real data.
Salting and hashing user password is tricky which caused authentication fail after restart the server. I resolved this issue by adding a secret salt value instead of setting random seed every time; figuring out how to get Node.js talk to python script cost most of my time. I ended up extracting user info from MongoDB in Node.js first, then using file system write the data into a .csv file in the form of a matrix, finally running the python algorithm with data in the .csv file.
For the next sprint, I will work on how to display the result getting from phython (need to extract more user from Profile Page) on Main Page as well as generating recommended topics based on user info instead of randomly picking.
Due 10pm Aug 1st
Group members: