{"id":15170789,"url":"https://github.com/kgujral2612/twitter-clone","last_synced_at":"2026-01-02T17:38:56.364Z","repository":{"id":240172022,"uuid":"801826253","full_name":"kgujral2612/twitter-clone","owner":"kgujral2612","description":"Twitter Clone: a full-stack, real-time twitter clone built using node.js, mongo db and socket.io","archived":false,"fork":false,"pushed_at":"2024-05-24T04:02:44.000Z","size":20057,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T22:27:05.856Z","etag":null,"topics":["api","full-stack-web-development","mongodb","mongoose","pug","socket-io","twitter-clone"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/kgujral2612.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}},"created_at":"2024-05-17T01:45:18.000Z","updated_at":"2024-05-24T04:02:47.000Z","dependencies_parsed_at":"2024-08-23T14:35:16.471Z","dependency_job_id":null,"html_url":"https://github.com/kgujral2612/twitter-clone","commit_stats":{"total_commits":59,"total_committers":2,"mean_commits":29.5,"dds":"0.22033898305084743","last_synced_commit":"997e510a77b21c1cbcb0f871d94f86b214186b25"},"previous_names":["kgujral2612/twitter-clone"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgujral2612%2Ftwitter-clone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgujral2612%2Ftwitter-clone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgujral2612%2Ftwitter-clone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgujral2612%2Ftwitter-clone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgujral2612","download_url":"https://codeload.github.com/kgujral2612/twitter-clone/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243853675,"owners_count":20358459,"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","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":["api","full-stack-web-development","mongodb","mongoose","pug","socket-io","twitter-clone"],"created_at":"2024-09-27T08:23:00.010Z","updated_at":"2026-01-02T17:38:56.295Z","avatar_url":"https://github.com/kgujral2612.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Twitter Clone: a full-stack, real-time twitter clone\n\u003cimg src=\"https://github.com/kgujral2612/twitter-clone/blob/main/system-diagram.png\" width=\"700\"\u003e\n\n## Realtime Chat Demo\n![Demo](/demo/ChatDemo.gif)\n\n## Notifcations Demo\n![Demo](/demo/NotificationsDemo.gif)\n\nThis project is a full-stack Twitter clone built with modern JavaScript technologies. The application offers core functionalities similar to twitter, allowing users to:\n\n- Create, and view posts (tweets)\n- Follow \u0026 unfollow other users \n- View feeds from only users that you follow\n- Like and reply on posts\n- Retweet posts from other users\n- Search for users and posts\n- Experience real-time updates and chatting with Socket.IO\n\n## Tech Stack\n- Frontend: HTML, CSS, Boostrap, JQuery, JavaScript, Pug \n- Backend: Node.js, Express\n- Database: MongoDB\n- Real-time communication: Socket.IO\n\n## Features\n- User Authentication: Secure login and registration system.\n- Feed: View posts from followed users.\n- Notifications: View notifications from other users instantly.\n- Messaging: Chatting with other users instantly.\n- Profile Image and Banner Image upload with crop functionality.\n- Responsive Design: Optimized for various screen sizes.\n\n\u003cimg src=\"https://github.com/kgujral2612/twitter-clone/blob/main/demo/homepage.png\" width=\"700\"\u003e\n\u003cimg src=\"https://github.com/kgujral2612/twitter-clone/raw/main/demo/profilePage.png\" width=\"700\"\u003e\n\u003cimg src=\"https://github.com/kgujral2612/twitter-clone/raw/main/demo/notifications.png\" width=\"700\"\u003e\n\u003cimg src=\"https://github.com/kgujral2612/twitter-clone/raw/main/demo/messages.png\" width=\"700\"\u003e\n\n## System Architecture\n\n### Server (Node.js)\n- The server is responsible for handling user requests, managing user authentication, interacting with the database, and facilitating real-time communication using Socket.IO.\n- Express.js provides routing for API endpoints to handle user actions like registration, login, posting tweets, following users, etc.\n- Mongoose ODM (Object Data Modeling) simplifies interaction with the MongoDB database.\n\n### Datebase (MongoDB): \nMongoDB stores \n- User Data: first name, last name, username, email, password, profile picture, liked posts, retweeted posts, followed users, followers\n- Tweet/Post Data: content, likes, retweeted by, posted by, if it is a reply\n- Notifications Data: user to, user from, notification type(post like/reply/retweet/follow)\n- Chats Data: users, chat name, latest message, created time, last updated time, if it is a group chat\n- Messages Data: content, sender, chat id, read by \n\n### Frontend\n- The frontend will be built using HTML, CSS, and Pug templates.\n- Pug templates will dynamically generate HTML pages based on user data and fetched content from the backend.\n- Socket.IO will be integrated on the client-side to enable real-time updates on messages and notifications\n\n## Functionality Breakdown\n\n### User Registration and Login\n- Users will register with a username and password.\n- Login will involve verifying username and password against the database.\n- Secure password hashing will be implemented for user credentials using bcrpyt npm package\n\n### User Profile\n- Users will have a profile page displaying a profile picture, a banner image, the number of followers, the number of users being followed, as well as all posts and replies by the user.\n\n### Creating and viewing tweets\n- Users can create tweets with text content.\n- Tweets will be stored in the database with timestamps and author information.\n- The frontend will display a timeline of tweets from followed users and the user themselves.\n\n### Following and Unfollowing users:\n- Users can follow other users.\n- Following relationships will be stored in the database.\n- Number of followers and followed users will be displayed on a user's profile\n- The home page feed will display tweets from followed users.\n\n### Liking and Retweeting posts:\n- Users can like and retweet existing tweets.\n- Likes and retweets will be stored with user and tweet references in the database.\n- The frontend will display like and retweet counts for each tweet.\n\n### Real-time Notifications:\n- Users will recieve notifications from their followers for post likes, retweets, and replies in real-time.\n- Users will receive notifications when someone new follows them in real-time.\n\n### Creating chats and Real-time Messaging:\n- Users can create chats with other users.\n- Users will receive messages in real-time.\n\n## Scalability\n\n### Scalability:\n- The application can be horizontally scaled by adding more Node.js servers behind a load balancer.\n- MongoDB can be scaled by adding replica sets or sharding.\n\n## Future Improvements\n- Login and sign up using third party systems such as google, facebook, etc \n- Search Optimization\n- Security\n- Caching\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgujral2612%2Ftwitter-clone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgujral2612%2Ftwitter-clone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgujral2612%2Ftwitter-clone/lists"}