Skip to content

🐦 Lightweight Twitter clone focusing on core social features: text-only tweets, likes, comments, follow system, and profile customization.

License

Notifications You must be signed in to change notification settings

hamxaShaukat/twitter-clone

Repository files navigation

🐦 Twitter Clone - Minimalist Microblogging Platform

A lightweight Next.js Twitter clone with text-only tweets, follows, and profile customization.

β–Ά Video Demo

πŸŽ₯ Watch Walkthrough (Show tweet posting, comments, and profile updates)


✨ Key Features

  • Text-Only Tweets: Post and delete your tweets (no media).
  • Interactions: Like tweets, comment, and delete comments.
  • Follow System: Follow/unfollow other users.
  • Profile Customization:
    • Update profile picture, cover photo, bio, and DOB.
  • Future Improvements:
    • Search functionality.
    • User suggestions based on bio/keyword matching.
  • Notifications:
    • Simple notification is implemented for like/follow functionality.

πŸ› οΈ Tech Stack

  • Frontend: Next.js, TailwindCSS
  • Backend: Next.js API Routes
  • Database: MongoDB (Prisma orm)
  • Auth: NextAuth.js (JWT)
  • State Management: Zustand

πŸš€ Local Setup

1. Clone & Install

git clone https://github.com/hamxaShaukat/twitter-clone.git
cd twitter-clone
npm install

2. Environment Variables

Create a .env file in the root and add:

NEXTAUTH_JWT_SECRET="your_jwt_secret"
NEXTAUTH_SECRET="your_nextauth_secret"
DATABASE_URL="mongodb_connection_uri"

πŸ”‘ How to Get These Keys

  • NextAuth Secrets:
    Generate via terminal:
    openssl rand -base64 32  # For NEXTAUTH_JWT_SECRET and NEXTAUTH_SECRET
  • MongoDB URI:
    Create a free cluster on MongoDB Atlas.

3. Run the App

npm run dev

Open http://localhost:3000 in your browser.


πŸ›‘ Planned Improvements

  • Search: Find users/tweets by keywords.
  • Suggestions: Recommend users based on bio/activity.
  • Notifications: Real-time like/comment alerts.

πŸ’‘ Challenges & Solutions

  • Challenge: Real-time comment updates.
    Solution: Used MongoDB change streams to refresh the UI.
  • Challenge: Follow system scalability.
    Solution: Optimized DB queries with indexing.

πŸ“œ License

MIT

πŸ“© Contact

Email: hamzashaukat714@gmail.com

About

🐦 Lightweight Twitter clone focusing on core social features: text-only tweets, likes, comments, follow system, and profile customization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages