Clone Instagram using Node JS and MySQL
C'mon! I can't clone Instagram. I dealt with MySQL a lot of time in my career, but when knew how we can set up MySQL server on Node JS, I got very excited and went ahead to create this app.
Last updated
C'mon! I can't clone Instagram. I dealt with MySQL a lot of time in my career, but when knew how we can set up MySQL server on Node JS, I got very excited and went ahead to create this app.
Last updated
This image may not relate to this project at all. Source: www.appoets.com. All images, data and R Script can be found here
C'mon! I can't clone Instagram. I dealt with MySQL a lot of time in my career, but when I knew how we can set up MySQL server on Node JS, I got very excited and went ahead to create this app.
I am aware that MySQL is not the best choice to create something like this app. However, as I am interested in the platform, I created it anyway. Many resources used in this app are taken from a MySQL course on Udemy by Colt Steele. He's a great instructor, and his cat is cute. By the way, I host this on Cloud9, but it requires monthly fee to keep its server open. Otherwise, it stops in like 2 hours of inactivity. I refused to pay, so the only way you can see this is to host it somewhere (Cloud9 or Heroku, the latter is the cheaper choice).
However, here is the screenshot.
This schema is kindda straighforward, but credit belongs to Colt Steele anyway.
In this file - fake_instagram_dataset.sql, you can find the SQL syntax to create all tables and data for those tables. This again belongs to Colt Steele. But I created an app that adds real image URLs and some fake emails, using faker module. You need to run this after creating all the tables above to have a complete database.
I made this layout using Bootstrap.
SQL syntax to get username, number of likes and number of counts for each photo ID
SQL syntax to get the list of tags in a presentable way
When the result array is returned, I use a loop to create an array that contains all tags for each photo id, the index of the element + 1 equals the photo id.
To populate all the entries for each variable, I use this in the EJS file. users and tagslist are variables that contain data read from MySQL queries.
This is basically MySQL.
Most commonly used hashtags:
Average number of posts per user:
Average number of posts per user:
Photo with the highes likes:
Inactive users:
Before, I had a baby rhino picture with the most likes. I will add a photo of Jennifer Aniston that has more likes. I like rhino, and it deserves awareness, but here is Jennifer Aniston.