This repository contains the backend code for the final project of Fall 2020 Internet Engineering course. In this project, we were instructed to build a twitter-like website. We called our version "Boobier" after a special seabird (more information here), and it's pretty much like Twitter. The frontend of this project is available here. The whole project is deployed on Heroku Cloud Application Platform.
We chose to write the backend in GoLang since it was the course syllabus, and our database of choice was MongoDB because of its simplicity.
Here are the features that our website is capable of:
We currently have three databases: one for users, another for tweets, and the last one for keeping the hashtags.
Until now, we have considered five objects to be modeled: users, tweets, owners (explained later), hashtags, and events.
Each user U
has the following fields:
U
.bcrypt
package.ObjectID
s where each id refers to a tweet.Owner
s which represents the profilesU
has followed or users that follow U
.Events
and it keeps track of three things:
U
's tweets were likedU
's tweets were retweetedU
U
's actions.Each tweet T
is made of these fields:
Owner
object which represents the tweet owner.Owners
.CommentTweet
objects.The CommentTweet
model contains all the Tweet
fields except for the
Parent
and the Comments
.
Each owner model is representing a user and only has the Username
,
Profile picture
, Name
, Bio
, and IsFollowing
fields. The IsFollowing
field indicates whether the user requesting this object follows the target
user or not. For instance, all U
's followers has this field equal to
true
for them.
Only records the name of a hashtag, the tweets which it belongs to, and the number of times it was used in general.
Three different actions are considered to be an Event
: Like, Retweet, and
Following as explained before and each event has the following fields:
Like
, a Retweet
, or a Follow
action.Like
and Retweet
events shows the actual tweet.The actual requests and corresponding responses can be seen in the code itself and doesn't need much of an explanation.
We tried to implement text-based search much like Twitter itself so our search algorithm supports the following examples:
You can generate the docs of the backend to get a better sense of
requests and responses. To generate these docs (automatically with the
help of swag), first install the package
and then run swag init
, change the listening hostname to localhost
and then, the resulting documentation is available at
this link.
There are many many bugs to be reported, suggestions to be told, ideas to be shared, and other forms of feedback to be told. Any form of these contributions would be a huge help to us improving this project. Thank you in advance.
You can test our website at Boobier.
Our Team: