Welcome to X-Twitter-Clone, a project aimed at creating a clone of the popular social media platform Twitter.
X-Twitter-Clone is built using modern web technologies and follows a full-stack architecture. The backend is developed with Node.js, GraphQL, Next.js, Prisma OR, PostgreSQL, TypeScript, and AWS. The frontend is developed with Next.js and React.
Implemented Google OAuth authentication using React GoogleAuth, allowing users to securely log in to the Twitter application. This authentication method leverages Google's OAuth 2.0 protocol, enabling seamless sign-in with Google accounts without sharing passwords. Upon successful authentication, users gain access to the application's features and functionalities.
Enabled users to create tweets with support for attaching images, enriching the platform's interactivity and engagement. Users can compose and publish tweets containing text content along with optional image attachments. This feature enhances the user experience by allowing the sharing of visual content alongside messages, making tweets more expressive and captivating.
Implemented a user recommendation system that suggests relevant accounts for users to follow, leveraging GraphQL to analyze a user's follow list and identify accounts frequently followed by users with similar interests or connections. By recommending relevant accounts, the system fosters community interaction and connection, facilitating the discovery of new content and users within the Twitter community.
Implemented Redis caching to optimize application performance by storing frequently accessed data, such as user profiles and tweet feeds. By caching data in Redis, the application reduces the need for repeated database queries, resulting in improved response times and smoother user experiences. Redis serves as an in-memory data store, enabling quick retrieval and serving of cached data to users, thereby minimizing latency and enhancing scalability.
Utilized AWS services such as EC2, Nginx, ALB (Application Load Balancer), and CloudFront for storage and deployment of the Twitter application. EC2 instances provide scalable compute capacity for hosting the backend services, while Nginx acts as a reverse proxy for handling incoming HTTP requests. ALB ensures high availability and distributes incoming traffic across multiple EC2 instances, while CloudFront delivers content to users with low latency and high data transfer speeds. This deployment architecture ensures scalability, reliability, and optimal performance of the Twitter application, even under heavy loads and varying traffic patterns.
Ensure you have the following software installed on your machine:
- Node.js (v14.x or higher)
- Yarn package manager
- PostgreSQL
- Clone the repository:
git clone https://github.com/Rithik53/X-Twitter--Clone.git
- Navigate to the project directory:
cd twitter-server
- Install backend dependencies:
cd server
yarn install
- Install frontend dependencies:
cd ../twitter-client
yarn install
-
Navigate to the
twitter-server
directory. -
Copy the
.env.example
file and rename it to.env
. -
Replace the placeholder values in the
.env
file with your actual credentials:- Obtain the Redis key from Upstash and replace
REDIS_KEY_HERE
with the actual key. - Obtain the AWS credentials (S3 key, access key, secret key, default region) and replace the placeholders accordingly.
- Obtain the Supabase database key and replace
DATABASE_KEY_HERE
with the actual key.
- Obtain the Redis key from Upstash and replace
-
Save the
.env
file.
- Start the backend server:
cd ../twitter-server
yarn dev
The backend server will be accessible at: http://localhost:8000
- Start the frontend development server:
cd ../twitter-client
yarn dev
The frontend development server will be accessible at: http://localhost:3000
You can now access the X-Twitter-Clone application by visiting http://localhost:3000 in your web browser. Sign up or log in to start tweeting and interacting with other users!
We welcome contributions from the community! If you have any ideas, bug fixes, or feature enhancements, feel free to open an issue or submit a pull request.