A Twitter clone application built using the MERN Stack (MongoDB, Express.js, React.js, Node.js) with modern features and real-time functionality.
Frontend:
Backend:
twitter-clone/
āāā backend/
ā āāā controllers/
ā āāā db/
ā āāā middleware/
ā āāā models/
ā āāā routes/
ā āāā server.js
āāā frontend/
ā āāā src/
ā ā āāā components/
ā ā āāā hooks/
ā ā āāā pages/
ā ā āāā utils/
ā ā āāā App.jsx
ā ā āāā main.jsx
ā āāā index.html
ā āāā package.json
āāā package.json
MONGO_URI=your_mongodb_uri
PORT=5000
JWT_SECRET=your_jwt_secret
NODE_ENV=development
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret
Clone repository
git clone https://github.com/username/twitter-clone.git
cd twitter-clone
Install dependencies
npm install
cd frontend && npm install
Setup environment variables
.env
file in root foldernpm run build npm start
## Features & Usage
### 1. Authentication
- Register with email, username, and password
- Login with username/email
- JWT token authentication
### 2. Post Management
- Create posts with text and/or images
- Like and unlike posts
- Comment on posts
- Delete own posts
### 3. User Profile
- Edit profile information
- Upload profile and cover photos
- View followers and following
- Edit bio and links
### 4. Social Interaction
- Follow/unfollow users
- Like and follow notifications
- Following timeline
- Suggested users
## Development
### Scripts
```json
{
"dev": "NODE_ENV=development nodemon backend/server.js",
"start": "NODE_ENV=production node backend/server.js",
"build": "npm install && npm install --prefix frontend && npm run build --prefix frontend"
}
POST /api/auth/signup
- Register userPOST /api/auth/login
- Login userGET /api/posts
- Get timeline postsPOST /api/posts
- Create new postPUT /api/users/profile
- Update profilegit checkout -b feature/AmazingFeature
)git commit -m 'Add some AmazingFeature'
)git push origin feature/AmazingFeature
)This project is licensed under the MIT License - see LICENSE file for details.