A full-stack Twitter clone built with Next, React, Firebase. This project aims to replicate the core features of Twitter, allowing users to post tweets, adding comments on tweets.
- User Authentication: Secure user authentication system using NextAuth for secure login.
- Tweeting: Post tweets, complete with text and images, and view tweets from other users.
- Real-time Updates: Real-time updates for tweets.
- Tweets Comments: Adding comments on tweets.
- Responsive Design: Mobile-friendly design to ensure a seamless user experience across devices.
Check out the live demo https://next-js-twitter-clone-pi.vercel.app
-
Clone the repository:
git clone https://github.com/Shaban-Eissa/NextJS-Twitter-Clone.git
-
Install dependencies:
cd NextJS-Twitter-Clone npm install
-
Set up Firebase:
-
Create a Firebase project: Go to the Firebase Console, click on "Add Project," and follow the setup instructions.
-
Get Firebase configuration:
- In the Firebase Console, navigate to your project settings.
- Under the "General" tab, scroll down to the "Your apps" section.
- Click on the web app icon (</>) to create a new web app.
- Copy the Firebase configuration object.
-
Configure the React app:
- In your React app, locate the Firebase configuration file (e.g.,
src/firebase.js
). - Replace the placeholder values with the Firebase configuration values you copied.
Example Firebase configuration file:
// src/firebase.js const firebaseConfig = { apiKey: 'YOUR_API_KEY', authDomain: 'YOUR_AUTH_DOMAIN', projectId: 'YOUR_PROJECT_ID', storageBucket: 'YOUR_STORAGE_BUCKET', messagingSenderId: 'YOUR_MESSAGING_SENDER_ID', appId: 'YOUR_APP_ID', }; export default firebaseConfig;
- In your React app, locate the Firebase configuration file (e.g.,
-
-
Set up NextAuth:
-
Add the following environment variables to your
.env.local
file:GOOGLE_CLIENT_ID=your-google-client-id GOOGLE_CLIENT_SECRET=your-google-client-secret NEXTAUTH_URL=http://localhost:3000 JWT_SECRET=your-jwt-secret
GOOGLE_CLIENT_ID
: Your Google OAuth client ID.GOOGLE_CLIENT_SECRET
: Your Google OAuth client secret.NEXTAUTH_URL
: The URL of your Next.js application.JWT_SECRET
: Secret key for JSON Web Token (JWT) encryption. you can generate one through this link https://generate-secret.vercel.app/32
-
-
Run the application:
npm run dev
The application will be accessible at
http://localhost:3000
.
-
Sign In:
Allow users sign-in to accounts with NextAuth.
-
Post Tweets:
Allow users to post tweets on the home page.
-
Real-time Interactions:
Experience real-time updates for tweets as they happen.
-
Tweet Comments:
Adding comments on tweets.
-
Delete Tweet:
Allowing users to delete there own tweets.
-
Frontend:
- React
- Next
- Headless-ui
- Hero-icons
- Recoil
-
Backend:
- Firebase
-
Authentication:
- NextAuth
-
Styling:
- Tailwindcss
Contributions are welcome.