Twitter Clone MVP is a minimal viable product (MVP) of a Twitter-like social media platform built with the MERN stack.
This project consists of two main parts:
- Frontend (React, Vite, Tailwind CSS, React Query)
- Backend (Express, MongoDB, JWT Authentication)
- User authentication (JWT-based login/signup)
- Posting tweets
- Liking and retweeting posts
- Following and unfollowing users
- Real-time updates with React Query
- React 18
- Vite
- React Router
- Tailwind CSS & DaisyUI
- React Query
- React Hot Toast (notifications)
- Node.js (Express)
- MongoDB (Mongoose ORM)
- JSON Web Tokens (JWT) for authentication
- Cloudinary for media uploads
- Bcrypt.js for password hashing
- Cors and Cookie Parser for security
- Node.js 18+
- MongoDB instance
git clone https://github.com/yashje/Twitter-clone-mvp
cd twitter-clone-mvp
Create a .env
file in the root directory and add:
MONGO_URI=your_mongo_connection_string
PORT=5000
JWT_SECRET=your_secret_key
NODE_ENV=development
CLOUDINARY_CLOUD_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret
docker build -t twitter-clone .
docker run -p 5000:5000 -p 3000:3000 twitter-clone
- Install dependencies:
npm install npm install --prefix frontend
- Start the backend:
npm run dev
- Start the frontend:
npm run dev --prefix frontend
Now, the backend will be running on http://localhost:5000
, and the frontend will be available at http://localhost:3000
. Login, tweet, and interact with other users just like on Twitter!
A Dockerfile
is included to containerize the application:
FROM node:18
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY frontend/package*.json frontend/
RUN npm install --prefix frontend
COPY . .
RUN npm run build --prefix frontend
EXPOSE 5000
EXPOSE 3000
CMD ["sh", "-c", "npm run start & npm run preview --prefix frontend"]
Feel free to fork this repo and contribute to the project.
Yash Suryawanshi