A WhatsApp clone built with microservices architecture using Node.js, React, and MongoDB.
- API Gateway: Manages API routing and authentication (Port 5000)
- User Service: Handles user management and authentication (Port 5001)
- Message Service: Manages messaging and real-time communication (Port 5002)
- Video Compression Service: Processes and compresses video files (Port 8080)
- Frontend: React application with Vite (Port 5173)
- Docker
- Docker Compose
-
Clone the repository:
git clone <repository-url> cd WhatsApp-Clone
-
Create environment files:
cp docker-env-example .env
-
Update the
.env
file with your own configuration values. -
Build and start the containers:
docker-compose up --build
-
Access the application:
- Frontend: http://localhost:5173
- API Gateway: http://localhost:5000
- User Service: http://localhost:5001
- Message Service: http://localhost:5002
- Video Compression Service: http://localhost:8080
- Create environment files for each service
- Install dependencies in each service directory:
cd <service-directory> npm install
- Start each service according to their package.json scripts:
npm run dev
- Routes API requests to appropriate services
- Handles authentication and authorization
- Manages user accounts, profiles, and authentication
- Connects to MongoDB for user data
- Handles message storage and retrieval
- Implements real-time messaging with Socket.IO
- Connects to MongoDB for message data
- Processes video uploads
- Compresses videos for efficient storage and streaming
- React application with modern UI
- Communicates with backend services through API Gateway
- Email & Password Authentication: Secure authentication with JWT and OAuth 2.0.
- One-to-One Messaging: Direct communication between users.
- Real-Time Messaging: Instant communication using WebSockets and MQTT.
- User Profiles: Update profile pictures and display names.
- Friend Requests: Send and accept friend requests before initiating chats.
- Online Status: Show when users are online.
- Notifications: Push and in-app notifications for new messages.
- Video Compression: Automatic compression of video files before sharing.
- Frontend: React (Next.js) with Tailwind CSS
- Backend: Go (Golang) for microservices, Node.js for WebSockets and API gateway
- Microservices:
- API Gateway: Node.js service for routing and authentication
- Video Compression Service: Go-based service for efficient video compression using FFmpeg
- Database:
- PostgreSQL for relational data (users, authentication)
- Redis for caching and real-time session management
- MongoDB for unstructured chat messages
- Authentication: JWT and OAuth 2.0 (Google, Facebook logins)
- Real-time Communication: WebSockets & MQTT for messaging
- Storage: Cloudinary / AWS S3
-
Clone the repository:
git clone https://github.com/Karim-Ashraf1/WhatsApp-Clone.git cd WhatsApp-Clone
-
Install dependencies:
npm install
-
Configure environment variables:
- Create a
.env
file in the root directory. - Add database and authentication keys:
DATABASE_URL=postgresql://user:password@host:port/database REDIS_URL=redis://user:password@host:port MONGO_URI=mongodb://user:password@host:port/database MQTT_BROKER=mqtt://host:port NEXTAUTH_SECRET=your_secret NEXTAUTH_URL=http://localhost:3000
- Create a
-
Run database migrations:
npx prisma migrate dev
-
Start the development server:
npm run dev
- Sign up or log in using your email and password.
- Send and accept friend requests to connect with others.
- Start chatting in real-time after becoming friends.
- Deploy frontend and backend services to Azure App Service.
- Use Azure Monitor for application performance tracking.
- Configure Azure PostgreSQL, Redis, MongoDB, and MQTT.
- Set up environment variables in Azure.
This project is licensed under the MIT License.
For any issues, open an issue or contact [nour.awad094@gmail.com].