A Instagram Blog application clone made using flask and sqlite database
pip install -r "requirements.txt"
flask --app main --debug run to run the flask app
Kshitij Roodkee
I am a web enthusiast and open source contirubutor who is excited to learn coding.
This project gives us hand on experience on the working of flask and databases to create a web app the keypoints to learn was using queries , passing data in flask .
- Jinja2 : It is a tempelating engine which gives us power to use python in html
- WTForms : it is used to validate and build forms that are more secure and easy to use.
- Werkzeug : It is used to enhance login security and save the user password as hashes
- SQLAlchemy : It is used to work with queries on a sqlite database
- flask_ckeditor : To give a rich editing experience while writing the blog
- Flask_login : It is used to implement login and logout feature.
- Flask : It is a web framework .
The project architecture could be divided into
- Templates : It contains all the views/html files
- Static Folder : It contains Css and images folder ( user profile picture)
- Routes : Their are mainly
- “/posts” route: which shows all the post available in the database
- “/feed/” route which shows specific post depending upon if user follows that author or not
- “/add/posts” route: for adding blog post
- “/user/” route: shows user profile and stats
- “/follower/” route: shows user followers list
- “/following/” route : shows user following list
- “/user/dashboard” route: shows user setting can be used to update user profile setting here
- “/posts/edit/” route: for editing posts
- “/posts/delete/ route: for removing posts
- Classes :Their are three classes or model implemented
- Posts : to maintain Posts
- Users : to maintain Users
- LikePost : to maintain likes on the post
- Forms : The forms are main feature to get the user input: The different forms implemented are:
- LoginForm : To be used for login
- SearchForm : To implement Search Functionality
- FollowForm: To submit follow request
Features Implemented :
- Users Customised Feed : A user is able to create his/her own feed by determining whom to follow . This feature is implemented using by creating a relationship between users Many to Many and querying on this relationship.
- Likes : A user can determine the credibility of a post bhy seeing the likes . This feature is implemented by creating a db model that keeps in count the no. of likes on that post
- Archive : A user can archive a post or unarchive a post depending upon his/her needs. This feature is implemented using a check of 0 and 1 count associated with the post where 1 means archived and 0 means unarchived.
- Login and Logout: Access to pages are maintained . A user can only see global posts if he/she is not logged in . Rest all pages need to be logged in . It is implemented using flask_login module.
- Search : A user is able to search another user and also able to search post content. This is implemented using simple query on db
- Follow and Unfollow: A user is able to follow unfollow another user . This is implemented using function call and a relationship between users .