Skip to content

My app is based on 8 concepts and 8 corresponding data model:

User, Websession< User >, Post or Diary< User >, Point< User >, Comment< Post|Comment,User >, Friend< User >, Tag< User >, FriendSuggestion< User >

Data Model

ConceptUser
purposeinfo about users
statesusername: set User-> set (Username, Password)
ConceptWebsession
purposeinfo about an authenticated session
statesusername: one Websession -> one User
ConceptDiary
purposeInfo about the diary
statespost: set Diary-> set (Content, Image, User)
ConceptPoint
purposeInfo about users' points
statespoints: set Point-> set User
ConceptComment
purposeinfo about a comment on another comment or a post
statescomments : set Comment -> set (User, Content, Target:Comment
ConceptFriend
purposeinfo about friendship
statesfriend: set User -> set User; friendRequest: User -> (User,status)
ConceptTag
purposeInfo about tags
statestags: set User -> set [ String ]
ConceptFriendSuggestion
purposeInfo about similar users
statessuggestion: set User -> set [ User ]

Github and Deployment

https://github.com/amirika20/backend

https://backend-one-puce.vercel.app/

Design reflection

I ended up bringing up one concept that I removed after the converging step, FriendSuggestion. I had a discussion with one of the TAs for assignment 3, and we concluded that the concept of friend and friend suggestion can be merged. The reason was I thought I did not need to define any state for friend suggestion, and I would be able to simply add an action to my friend concept. However, when I was implementing this action, I noticed that for friend suggestions some information from the Tag concept is needed, and I do not want to generate that every time a user requests a friend suggestion. Thus, I brought back the friend suggestion concept to my design so that I could store users who are similar to each other in a different data model. Additionally, since I need to get access to users' posts, I added actions, like enabling/disabling friend suggestions. By adding such actions, users can decide whether they permit me to process their information or not.

Also, while I was implementing the point concept, I decided to merge that with my user concept because simply I could add one more state for each user to store their points. However, I discussed this with a TA, and I decided to keep the point as a separate concept because it makes testing easy, additionally, if I want to add a new action in the future, I would need to change a few things.

One thing that I enjoyed in this assignment was integrating OpenAI API into my social app. In my second assignment, I wanted to integrate GPT into almost all of my concepts. However, in assignment 3 I noticed that this might be challenging to implement, and I even decided to use a deterministic algorithm for tag generation and friend suggestion. Nonetheless, I tried implementing OpenAI API for my Tag concept, and I found it easy and exciting.