Amazing Twitter clone - It's a microblogging site that enables users to share brief messages and engage in real-time conversations.
This website was implemented for the Software Engineering Course @ Cairo University Faculty of Engineering.
It is developed using Node.js for the backend, PostgreSQL for the database, React for the frontend, and AWS for deployment.
The Twitter Clone project aims to replicate the core features and functionalities of the popular social media platform, Twitter. This web application provides users with a platform to share short messages, engage with other users through likes, retweets, and comments, and stay updated on the latest trends and activities.
- Clone the project
https://github.com/Twitter-Clone-Project/Back-End.git
- Install dependencies. hint:
cd to the project folder that has the package.json file in it.
npm install
- Set environment variables
Copy file .env.template then Create file .env and set your environment variables in it.
- Start the server in development env
npm run start:dev
- Start the server in production env
npm run start:prod
File API-Documentation.yaml in the repo, this is a yaml coded-documentation. Untill we upload the documentation on swaagerHub($$), you can see the GUI by opening swagger editor online, then paste the code in it.
You can also see postman documentation with test exambles here
Here is the Socket.io events documentaion
-
Sign Up:
- Allows users to create a new account in the application.
-
Sign In:
- Enables users to sign in to their accounts.
-
Sign In/Up with Google:
- Provides the option to sign in or sign up using Google credentials.
-
Get Me:
- Retrieves information about the authenticated user.
-
Sign Out:
- Logs the user out from the application.
-
Resend Confirmation Email:
- Resends the confirmation email to the user for account verification.
-
Verify Email:
- Confirms the email of the user after receiving the verification email.
-
Update Password:
- Allows users to update their password.
-
Forget Password:
- Initiates the process of resetting the password by sending an email.
-
Reset Password:
- Completes the password reset process.
-
Check Username Availability:
- Determines if a given username is already registered.
-
Check Email Availability:
- Checks if a given email is already registered.
-
Update Username:
- Allows users to change their username.
-
Update Email:
- Permits users to update their email address.
-
Update Banner:
- Adds a banner to the user's profile.
-
Delete Banner:
- Removes the banner picture from the user's profile.
-
Update Profile Picture:
- Updates the user's profile picture.
-
Delete Profile Picture:
- Deletes the user's profile picture.
-
Update Profile:
- Updates various aspects of the user's profile.
-
Get User Profile:
- Retrieves the profile information of a specific user.
-
Get Followers:
- Retrieves a list of followers for a specific user.
-
Get Followings:
- Retrieves a list of users followed by a specific user.
-
Follow User:
- Allows a user to follow another user.
-
Unfollow User:
- Allows a user to unfollow another user.
-
Mute User:
- Mutes a specific user.
-
Unmute User:
- Unmutes a previously muted user.
-
Get Muted Users:
- Retrieves a list of users muted by the authenticated user.
-
Block User:
- Blocks a specific user.
-
Unblock User:
- Unblocks a previously blocked user.
-
Get Blocked Users:
- Retrieves a list of users blocked by the authenticated user.
-
Add Tweet:
- Allows users to post a new tweet.
-
Delete Tweet:
- Deletes a tweet based on its tweetId.
-
Get Tweet Info:
- Retrieves information about a specific tweet.
-
Get Replies to Tweet:
- Retrieves replies to a specific tweet.
-
Add Reply to Tweet:
- Allows users to add a reply to a tweet.
-
Delete Reply from Tweet:
- Deletes a reply from a tweet.
-
Add Retweet:
- Allows users to retweet a tweet.
-
Delete Retweet:
- Deletes a retweet.
-
Like Tweet:
- Allows users to like a tweet.
-
Unlike Tweet:
- Removes a like from a tweet.
-
Get Retweeters:
- Retrieves a list of users who retweeted a specific tweet.
-
Get Likers:
- Retrieves a list of users who liked a specific tweet.
-
Add Media to Tweet:
- Allows users to add media (e.g., images) to a tweet.
-
Get Media from Tweet:
- Retrieves media (e.g., images) associated with a tweet.
-
Get Home Timeline:
- Retrieves a list of tweets on the home page of the user.
-
Get User Tweets:
- Retrieves tweets posted by a specific user.
-
Get Mentioned Tweets:
- Retrieves tweets where the user is mentioned.
-
Get Liked Tweets:
- Retrieves tweets liked by a specific user.
-
Get Available Trends:
- Retrieves a list of available trends.
-
Get Trend Tweets:
- Retrieves tweets associated with a specific trend.
-
Search Users:
- Searches for users based on their username or screen name.
-
Search Tweets:
- Searches for tweets based on a provided string.
-
Real-Time Chat:
- Allows users to send and receive messages in real-time, ensuring instant communication.
-
Synchronized Chat Across Devices:
- Ensures that the chat history and messages are synchronized seamlessly when a user accesses the application from multiple devices.
-
Start Conversation:
- Users can initiate new conversations with other users.
-
Leave Conversation:
- Provides the functionality for users to leave a conversation.
-
Unseen Conversations Count:
- Retrieves the number of unseen conversations to notify users of new messages.
-
View Messages in a Conversation:
- Users can view the messages within a specific conversation.
-
Send Messages:
- Allows users to send messages to others within a conversation.
-
Seen and Sent Feature:
- Indicates whether a message has been seen by the recipient and provides information about when a message was sent.
-
Delete Messages:
- Users can delete their messages within a conversation.
-
Real-Time Notifications:
- Users receive notifications in real-time for events such as new followers.
-
Unseen Notifications Count:
- Provides the count of unseen notifications to inform users about new activities.
-
View Notifications:
- Users can view a list of their notifications, including details about the activities that triggered them.
-
Seen Feature:
- Tracks whether a user has seen a particular notification.
project-root
β
βββ tests
β βββ routes
β β βββ authRouter.test.js
β β βββ conversationsRouter.test.js
β β βββ interactions.test.js
β β βββ notificationsRouter.test.js
β β βββ profile.test.js
β β βββ searchRouter.test.js
β β βββ timelineRouter.test.js
β β βββ tweetsRouter.test.js
β βββ services
β β βββ WebSocket.oldtest.js
βββ controllers
β βββ authController.js
β βββ conversationsController.js
β βββ errorController.js
β βββ interactionsController.js
β βββ notificationsController.js
β βββ profileController.js
β βββ searchController.js
β βββ timelineController.js
β βββ trendsController.js
β βββ tweetsController.js
βββ middlewares
β βββ validations
β β βββ conversation.js
β β βββ profile.js
β β βββ tweet.js
β β βββ user.js
β βββ catchAsync.js
β βββ validateRequest.js
βββ models
β βββ entities
β β βββ Conversation.js
β β βββ Media.js
β β βββ Message.js
β β βββ Notification.js
β β βββ Reply.js
β β βββ Trend.js
β β βββ Tweet.js
β β βββ User.js
β βββ relations
β β βββ Block.js
β β βββ Follow.js
β β βββ Like.js
β β βββ LikeReply.js
β β βββ Mention.js
β β βββ Mute.js
β β βββ Repost.js
β β βββ Support.js
βββ routes
β β βββ authRouter.js
β β βββ conversationsRouter.js
β β βββ interactionsRouter.js
β β βββ notificationsRouter.js
β β βββ profileRoutes.js
β β βββ searchRouter.js
β β βββ timelineRouter.js
β β βββ trendsRouter.js
β β βββ tweetsRouter.js
βββ schemas
β βββ entities
β β βββ conversationSchema.js
β β βββ mediaSchema.js
β β βββ messageSchema.js
β β βββ notificationSchema.js
β β βββ replySchema.js
β β βββ trendSchema.js
β β βββ tweetSchema.js
β β βββ userSchema.js
β βββ relations
β β βββ blockSchema.js
β β βββ followSchema.js
β β βββ likeReplySchema.js
β β βββ likeSchema.js
β β βββ mentionSchema.js
β β βββ muteSchema.js
β β βββ repostSchema.js
β β βββ supportSchema.js
βββ seeds
β βββ blocks.json
β βββ conversations.json
β βββ follows.json
β βββ likes.json
β βββ media.json
β βββ messages.json
β βββ mutes.json
β βββ notifications.json
β βββ replies.json
β βββ reposts.json
β βββ seeds.js
β βββ supports.json
β βββ trends.json
β βββ tweets.json
β βββ users.json
βββ services
β βββ AppError.js
β βββ AuthService.js
β βββ Email.js
β βββ Password.js
β βββ WebSocket.js
βββ test
β βββ setup.js
βββ views/emails
β βββ _style.pug
β βββ baseEmail.pug
β βββ confirmEmail.pug
β βββ updateEmail.pug
βββ .env.template
βββ .eslintrc.json
βββ .gitignore
βββ .prettierrc
βββ API-Documentation.yaml
βββ Dockerfile
βββ README.md
βββ WebSocket APIs Documentation.md
βββ app.js
βββ dataSource.js
βββ dataSource2test.js
βββ package-lock.json
βββ package.json
βββ server.js