{"id":31177887,"url":"https://github.com/shreya7tripathy/instagram-clone-database","last_synced_at":"2026-05-16T11:33:24.119Z","repository":{"id":309383442,"uuid":"1036076642","full_name":"Shreya7tripathy/Instagram-Clone-Database","owner":"Shreya7tripathy","description":"The Instagram Clone is a SQL-only project built using MySQL to replicate core features of Instagram's database structure. It includes tables for users, posts, likes, comments, followers, and hashtags, allowing you to perform queries for user feeds, trending posts, and social interactions. This project focuses purely on database design and queries w","archived":false,"fork":false,"pushed_at":"2025-08-11T14:37:37.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-11T16:25:19.586Z","etag":null,"topics":["mysql","mysql-database","sql","sql-query","sql-server"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Shreya7tripathy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-11T14:20:12.000Z","updated_at":"2025-08-11T14:39:17.000Z","dependencies_parsed_at":"2025-08-11T16:25:21.104Z","dependency_job_id":"722fcdf9-5700-4917-bf4c-cf4e5e091b70","html_url":"https://github.com/Shreya7tripathy/Instagram-Clone-Database","commit_stats":null,"previous_names":["shreya7tripathy/instagram-clone-database"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Shreya7tripathy/Instagram-Clone-Database","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreya7tripathy%2FInstagram-Clone-Database","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreya7tripathy%2FInstagram-Clone-Database/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreya7tripathy%2FInstagram-Clone-Database/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreya7tripathy%2FInstagram-Clone-Database/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Shreya7tripathy","download_url":"https://codeload.github.com/Shreya7tripathy/Instagram-Clone-Database/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Shreya7tripathy%2FInstagram-Clone-Database/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275952459,"owners_count":25558705,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-19T02:00:09.700Z","response_time":108,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mysql","mysql-database","sql","sql-query","sql-server"],"created_at":"2025-09-19T14:32:00.946Z","updated_at":"2025-09-19T14:32:29.748Z","avatar_url":"https://github.com/Shreya7tripathy.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# 📸 Instagram Clone Database (MySQL)\n\nA **pure SQL** implementation of Instagram-like features, built entirely with **MySQL** — no backend frameworks, no ORMs.  \nThis project demonstrates how to design, implement, and query a relational database for a social media platform **using only SQL**.\n\n---\n\n## 🚀 Features\n\n- **User Accounts** (signup, profile data)\n- **Posts \u0026 Media** (images, captions, timestamps)\n- **Followers System** (follow/unfollow)\n- **Likes \u0026 Comments**\n- **Stories**\n- **Hashtags \u0026 Search**\n- **Notifications via Triggers**\n- **Views** for feed summaries\n- **Stored Procedures** for core actions:\n  - Create users, posts, comments\n  - Like posts\n  - Get user feed\n  - Explore popular posts\n\n---\n\n## 🗂️ Database Schema Overview\n\nBelow is the **ER Diagram** for the project:\n\n```\n\n\\[ USERS ]───\u003c \\[ POSTS ] \u003e───\\[ MEDIA ]\n│            │ │\n│            │ └──\u003c \\[ COMMENTS ]\n│            └──\u003c \\[ LIKES ]\n│\n└──\u003c \\[ FOLLOWERS ]\n\n\\[ HASHTAGS ]───\u003c \\[ POST\\_HASHTAGS ]\n\\[ STORIES ]\n\\[ NOTIFICATIONS ]\n\n````\n\n---\n\n## 📊 ER Diagram (Visual)\n\n\u003cimg width=\"1008\" height=\"816\" alt=\"er_dig_insta_clone\" src=\"https://github.com/user-attachments/assets/94cad824-3c35-4740-9818-a9daf53de6ca\" /\u003e\n\n\n---\n\n## 🛠️ Setup Instructions\n\n### 1️⃣ Install MySQL\nMake sure you have **MySQL 8+** installed.  \n[Download MySQL](https://dev.mysql.com/downloads/)\n\n### 2️⃣ Run the SQL Script\n```bash\nmysql -u root -p \u003c instagram_clone_mysql.sql\n````\n\n### 3️⃣ Select the Database\n\n```sql\nUSE instagram_clone;\n```\n\n### 4️⃣ Try the Stored Procedures\n\n```sql\nCALL get_user_feed(1, 10, 0);\nCALL like_post(1, 3);\nCALL create_comment(2, 3, 'Nice shot!');\n```\n\n---\n\n## 📁 Project Structure\n\n```\n📦 Instagram Clone Database\n ┣ 📜 instagram_clone_mysql.sql   # Main SQL script\n ┣ 📜 README.md                   # Documentation\n ┗ 🖼️ er_diagram.png               # ER diagram image\n```\n\n---\n\n## 🧠 How It Works\n\n1. **Schema Design**\n\n   * All tables are normalized and indexed for scalability.\n   * Many-to-many relationships (hashtags, likes) handled via join tables.\n\n2. **Business Logic in SQL**\n\n   * Core app logic is implemented via **stored procedures** and **triggers**.\n   * No ORM or server-side scripting — just SQL.\n\n3. **Performance Considerations**\n\n   * Indexes on foreign keys \u0026 frequently searched columns.\n   * Views for quick feed summaries.\n   * Option to precompute feed (fan-out-on-write) or compute on demand (fan-out-on-read).\n\n---\n\n## 📚 Example Queries\n\nGet the **latest feed for a user**:\n\n```sql\nCALL get_user_feed(1, 10, 0);\n```\n\nFind **popular posts**:\n\n```sql\nCALL explore_popular_posts(10);\n```\n\n---\n\n## 💡 Future Improvements\n\n* Private accounts \u0026 follow requests\n* Pagination cursors (instead of OFFSET)\n* Advanced search with FULLTEXT indexes\n* Archiving old data for performance\n\n---\n## 📌 Author\n\n**Shreya Tripathy**\n[GitHub Profile](https://github.com/Shreya7tripathy)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreya7tripathy%2Finstagram-clone-database","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshreya7tripathy%2Finstagram-clone-database","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshreya7tripathy%2Finstagram-clone-database/lists"}