Made using the python framework Flask, this is a frontend + backend clone of twitter. Of course, it does not have ALL the functionalities Twitter has, but it can do the functions that are quintescential to Twitter, namely:
- Login and logout functionalities with a login and cookie manager system.
- Creating own account and update and customize (with setting own profile pictures and image management system).
- CRUD operations on all your tweets.
- Retweeting other perople's tweets.
- Looking up other users profile.
Have tried to keep the UI as similiar as that of Twitter. Is not mobile responsive yet so is better to view it in landscape on laptop or desktop. The reason this hasn't been done yet is that this project's primary purpose was not to create a fronend site but rather create a fully functional generic social media website
According to the current functionalities there are 5 tables in the schema. The User has all the info on the user, the Post links the creted posts to their author as:
User.id --> {author} --> Post.user_id
The Retweets have a different table that the Posts as they point to instances within the Post themselves. Their connection is given as:
Post.id --> {ori_post} --> Retweet.tweet_id
User.id --> {retwitter} --> Retweet.user_id
The Timelinr table keeps track of all the posts and the retweets that were created since day zero. Their relationship is given as:
Post.id --> {from_post} --> Timeline.post_id
Retweet.id --> {from_retweet} --> Timeline.retweet_id
The Bookmark keeps track of all the posts that the user saves as a bookmark, Their relationship is given as :
Post.id --> {saved_post} --> Bookmark.post_id
User.id --> {saved_by} --> Bookmark.user_id
NOTE : This portion is yet to be implemented The Bookmark Table joins the User table with the Posts that the user saves. Relationship given as:
User.id --> {by_user} --> Bookmark.user_id
Post.id --> {saved_post} --> Bookmark.post_id
The complete schema structure is given below:
To Access the database in more detail, go here
- The database has been built on SQLite browser using SQLAlchemy so is not currently scalabe. But due to Flask's upwards compatibility, can be shifted to PostgreSQL whenever needed.
- The login management system hashshes the passwords and follows a strict cookie management and uses flask_login_manager to time the user sessions and hence provides intermediate level of protection.
- Built using a virtual environmen so can be easily downloaded and run on your local machine.
- Clone this repo
- Install Dependencies
pip install -r requirements.txt
- Provide the full root path of the file
database.db
over here if required - Run the application
python run.py
- Username : JaneDoe
- Email : test@test.com
- Password : Admin123
- Add follow user/following functionality.
- Add ability to like posts
- Add 'forgot password' functionality.
Although this is not a fully fledged open source project, it never hurts to get some help :) Go through the Issues listed. Most of them are beginer friendly and should be good enough for your first PR!