A full-stack WhatsApp clone built with Next.js, Express, and MongoDB.
- Fetch from git:
git clone https://github.com/DonRaz/WhatsappClone.git- run on seperated terminals:
- First terminal - Backend: (using npm)
cd server
npm install && npm run dev- Second Terminal - Frontend (using bun)
cd /client/chat-whatsapp-clone
bun install && bun run dev - run single file:
# From project root
./run-locally.shThis script will:
- Build the shared types
- Start the server in the background
- Start the client in the background
- Allow you to stop both with Ctrl+C
- environment files needs to be renamed (remove the
.example) and filled - Make sure
server/.envcontains the correctDATABASE_URL
This project uses environment variables for configuration:
-
Server (.env in server/):
- Contains
DATABASE_URL,JWT_SECRET, andPORT - Required for local development
- Contains
-
Root (.env in project root):
- Used by the deployment script
- Contains all variables needed for production
-
Frontend (.env.production in client/):
- Generated automatically by the deploy script
- Do not edit manually
Before submitting or deploying, you can clean up unnecessary files:
# Clean up node_modules, build artifacts, etc.
./cleanup.sh
# Clean up and reinstall dependencies
./cleanup.sh --reinstallIn local development, Socket.IO is used for real-time communication.
- Ensure root
.envfile has all required variables - Run
./deploy-with-env.sh - The script sets all variables in Vercel and deploys both services
In production, Pusher is used for real-time communication.
- Real-time messaging
- User authentication
- Group conversations
- Message status (seen/delivered)
- Responsive design
Edit at shared/schemas/index.ts or shared/realtime/index.ts and run:
cd FullstackFinalProject/shared
npm run build
npm version patch && npm publish
cd FullstackFinalProject/client/chat-whatsapp-clone
bun i @sraz-sw/fullstack-shared
cd FullstackFinalProject/server
npm i @sraz-sw/fullstack-shared