ChitChat is a cutting-edge, full-stack real-time communication platform that brings people together through seamless messaging, crystal-clear video calls, and intelligent AI assistance. Built with modern web technologies including React, TypeScript, Express, MongoDB, and Redis, ChitChat delivers enterprise-grade performance with a consumer-friendly experience.
π Lightning Fast - Real-time messaging with sub-second delivery
π Secure by Design - End-to-end encryption and JWT authentication
π± Mobile First - Responsive design that works everywhere
π€ AI-Powered - Intelligent responses with Google Gemini integration
π₯ HD Video Calls - WebRTC-powered crystal clear communication
βοΈ Cloud Ready - Scalable architecture with Cloudinary integration
- Real-time messaging with Socket.io
- Message types: Text, Images, Videos, Audio recordings, Files
- Message status: Sent, Delivered, Read indicators
- Voice messages with waveform recording and playback
- Media sharing with Cloudinary integration (images & videos)
- Emoji picker with comprehensive emoji support
- AI-powered responses using Google Gemini
- Typing indicators in real-time
- Message search and filtering
- Video calls with WebRTC (peer-to-peer)
- Audio calls with high-quality codecs
- Call history tracking and management
- Call notifications with browser notifications and ringtones
- Draggable & resizable picture-in-picture video during calls
- Call controls: Mute, camera toggle, speaker toggle, screen share
- Call status tracking: Connected, missed, declined, ended
- OTP-based authentication via SMS (production) / console (development)
- JWT token management with refresh tokens
- Phone number verification
- Secure session handling
- Environment-based SMS configuration
- Add contacts by phone number
- Contact info modal with detailed user information
- Block/unblock contacts with privacy controls
- Delete contacts with confirmation dialogs
- Online status indicators (green dot for online users)
- Last seen timestamps
- Contact search and organization
- Responsive design for mobile and desktop
- Modern UI with Tailwind CSS
- Real-time typing indicators
- Chat list with last message previews and timestamps
- Search functionality for chats and contacts
- File upload with drag-and-drop support
- Settings panel with profile customization
- Animated video player with custom controls
- Audio waveform visualization for voice messages
chitchat/
βββ apps/
β βββ server/ # Express backend
β β βββ src/
β β β βββ controllers/ # API controllers
β β β β βββ auth.controller.ts
β β β β βββ chat.controller.ts
β β β β βββ user.controller.ts
β β β β βββ call.controller.ts
β β β β βββ media.controller.ts
β β β β βββ otp.controller.ts
β β β βββ models/ # MongoDB models
β β β β βββ User.ts
β β β β βββ Message.ts
β β β β βββ CallHistory.ts
β β β β βββ Media.ts
β β β β βββ Gemini.ts
β β β βββ routes/ # Express routes
β β β βββ services/ # Business logic
β β β β βββ ai.service.ts
β β β β βββ gemini.service.ts
β β β β βββ socket.service.ts
β β β βββ utils/ # Utilities
β β β β βββ multer.ts
β β β β βββ mongoDB.ts
β β β β βββ redisClient.ts
β β β β βββ jwt.ts
β β β β βββ sms.ts
β β β βββ index.ts # Server entry point
β β βββ uploads/ # File storage
β β βββ audio/
β β βββ images/
β β βββ videos/
β βββ web/ # React frontend
β βββ src/
β β βββ components/ # React components
β β β βββ auth/ # Authentication components
β β β βββ chat/ # Chat-related components
β β β βββ call/ # Video/Audio call components
β β β βββ Layout/ # Layout components
β β β βββ ui/ # Reusable UI components
β β βββ context/ # React context providers
β β β βββ AuthContext.tsx
β β β βββ ChatContext.tsx
β β βββ hooks/ # Custom React hooks
β β βββ lib/ # API utilities
β β βββ types/ # TypeScript definitions
β β βββ utils/ # Helper functions
β β βββ main.tsx # App entry point
β βββ public/ # Static assets
βββ packages/
β βββ ui/ # Shared UI components
β βββ eslint-config/ # Shared ESLint configuration
β βββ typescript-config/ # Shared TypeScript configuration
βββ README.md
- React 18 with TypeScript
- Vite for build tooling and hot reload
- Tailwind CSS for modern styling
- Socket.io Client for real-time communication
- WebRTC for peer-to-peer video/audio calls
- Axios for HTTP requests
- React Router for navigation
- Lucide React for icons
- React Hot Toast for notifications
- Express.js with TypeScript
- MongoDB with Mongoose ODM
- Redis for caching and session management
- Socket.io for real-time messaging
- JWT for authentication and authorization
- Multer for file upload handling
- Cloudinary for media storage and optimization
- Twilio for SMS (production environment)
- Google Gemini AI for intelligent responses
- Turborepo for monorepo management
- ESLint and Prettier for code quality
- Docker for Redis containerization
- Vercel for frontend deployment
- Environment-based configuration
- Git with dev/main branch strategy
- Node.js >= 18.0.0
- MongoDB (local installation or MongoDB Atlas)
- Redis (Docker recommended)
- Cloudinary account (for media uploads)
- Twilio account (for SMS in production)
- Google AI Studio account (for Gemini AI)
-
Clone the repository:
git clone https://github.com/pandarudra/chitchat.git cd chitchat -
Install dependencies:
npm install
-
Start Redis using Docker:
docker run --name local-redis -d -p 6379:6379 redis docker start local-redis
-
Navigate to server directory:
cd apps/server npm install -
Create
.envfile inapps/server/:# Database Configuration MONGO_URI=mongodb://localhost:27017/chitchat # Redis Configuration REDIS_HOST=localhost REDIS_PORT=6379 REDIS_USERNAME= REDIS_PASSWORD= # JWT Authentication JWT_SECRET=your-super-secret-jwt-key-here REFRESH_SECRET=your-super-secret-refresh-key-here # Cloudinary Media Storage CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name CLOUDINARY_API_KEY=your-cloudinary-api-key CLOUDINARY_API_SECRET=your-cloudinary-api-secret # Twilio SMS (Production) TWILIO_ACCOUNT_SID=your-twilio-account-sid TWILIO_AUTH_TOKEN=your-twilio-auth-token TWILIO_PHONE_NUMBER=your-twilio-phone-number # Google Gemini AI GEMINI_API_KEY=your-google-ai-studio-api-key # Server Configuration NODE_ENV=development PORT=8000 FRONTEND_URL=http://localhost:5173
-
Start the backend server:
npm run dev
-
Navigate to web directory:
cd apps/web npm install -
Create
.envfile inapps/web/:VITE_BE_URL=http://localhost:8000
-
Start the frontend development server:
npm run dev
- Registration: Sign up with your phone number
- OTP Verification: Receive and verify OTP (SMS in production, console in development)
- Profile Setup: Set your display name and upload an avatar
- Start Chatting: Begin conversations with contacts
- Text Messages: Send and receive real-time text messages
- Voice Messages: Record and send audio messages with one-tap recording
- Media Sharing: Upload and share images and videos (up to 50MB)
- Emoji Support: Use the built-in emoji picker for expressive messaging
- AI Responses: Get AI-powered responses using Google Gemini
- Initiate Calls: Start video or audio calls from any chat
- Call Management: Accept, decline, or end calls with intuitive controls
- Picture-in-Picture: Resize and move the video window during calls
- Call History: View and manage your call history
- Browser Notifications: Receive call notifications even when the app isn't focused
- Add Contacts: Search and add contacts by phone number
- Contact Info: View detailed contact information and status
- Privacy Controls: Block or unblock contacts as needed
- Contact Organization: Manage your contact list efficiently
POST /api/auth/send-otpβ Send OTP to phone numberPOST /api/auth/verify-otpβ Verify OTP codePOST /api/auth/signupβ Create new user accountPOST /api/auth/loginβ Login existing userPOST /api/auth/refreshβ Refresh access tokenPOST /api/auth/logoutβ Logout and invalidate session
GET /api/user/profileβ Get current user profilePUT /api/user/profileβ Update user profile informationGET /api/user/contactsβ Retrieve user's contact listPOST /api/user/add-contactβ Add new contact by phone numberPOST /api/user/block-contactβ Block a specific contactPOST /api/user/unblock-contactβ Unblock a contactDELETE /api/user/delete-contact/:contactIdβ Delete contact
GET /api/chats/:userId/messagesβ Get chat message historyPOST /api/chats/sendβ Send text messagePOST /api/upload/audioβ Upload and send audio messagePOST /api/upload/imageβ Upload and send imagePOST /api/upload/videoβ Upload and send video
GET /api/calls/historyβ Retrieve call historyPOST /api/calls/startβ Initiate a new callPUT /api/calls/:callId/endβ End an active callDELETE /api/calls/:callIdβ Delete specific call from historyDELETE /api/calls/clearβ Clear entire call history
POST /api/otp/sendβ Send OTP (environment-aware)POST /api/otp/verifyβ Verify OTP code
Root Level (Turborepo):
npm run dev # Start all applications in development mode
npm run build # Build all applications for production
npm run lint # Run ESLint across all applications
npm run clean # Clean all build artifacts and node_modulesBackend Development:
cd apps/server
npm run dev # Start backend with hot reload
npm run build # Build backend for production
npm run start # Start production backend
npm run lint # Lint backend codeFrontend Development:
cd apps/web
npm run dev # Start frontend with hot reload
npm run build # Build frontend for production
npm run preview # Preview production build
npm run lint # Lint frontend codeDevelopment Branch:
git checkout -b dev # Create and switch to dev branch
git add . # Stage all changes
git commit -m "feat: your feature" # Commit with conventional message
git push -u origin dev # Push to dev branchProduction Deployment:
git checkout main # Switch to main branch
git merge dev # Merge dev into main
git push origin main # Deploy to productionDevelopment Environment:
- SMS: Console logging (no actual SMS sent)
- Database: Local MongoDB
- Redis: Docker container
- File uploads: Local storage + Cloudinary
Production Environment:
- SMS: Twilio integration
- Database: MongoDB Atlas (recommended)
- Redis: Managed Redis service
- File uploads: Cloudinary CDN
- Socket.io Integration: Bidirectional event-based communication
- Message Status Tracking: Real-time delivery and read receipts
- Typing Indicators: Live typing status updates
- Online Presence: Real-time user status monitoring
- Multi-format Support: Images (JPEG, PNG, GIF), Videos (MP4, WebM), Audio (WebM, MP3)
- File Size Limits: Up to 50MB for media files
- Cloud Storage: Secure Cloudinary integration
- Compression: Automatic media optimization
- Google Gemini: Advanced AI-powered responses
- Context Awareness: Maintains conversation context
- Natural Language: Human-like interaction patterns
- Peer-to-peer Connections: Direct browser-to-browser communication
- STUN/TURN Servers: NAT traversal and connectivity
- Media Streams: High-quality audio and video transmission
- Adaptive Quality: Automatic quality adjustment based on connection
- Connect your GitHub repository to Vercel
- Set build command:
cd apps/web && npm run build - Set output directory:
apps/web/dist - Configure environment variables in Vercel dashboard
- Railway: Easy deployment with automatic HTTPS
- Heroku: Classic PaaS with add-ons for MongoDB and Redis
- DigitalOcean: App Platform with managed databases
- AWS: EC2 with RDS and ElastiCache
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'feat: add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
We thank the following people for their contributions to ChitChat:
If you've contributed to this project, feel free to add yourself to the contributors list:
- Fork the repository
- Add your entry to the contributors table above
- Include appropriate contribution types using the emoji key:
- π» Code
- π¨ Design
- π Documentation
- π Bug reports
- π‘ Ideas & Planning
- π€ Mentoring
- π Project Management
- π Reviewed Pull Requests
- π Infrastructure
β οΈ Tests- π§ Maintenance
- Submit a pull request
Want to contribute but don't know where to start? Check out our good first issues or reach out to the maintainers!
This project is licensed under the MIT License - see the LICENSE file for details.
- Socket.io for real-time communication
- WebRTC for peer-to-peer video calls
- Cloudinary for media management
- MongoDB for flexible data storage
- Redis for fast caching and sessions
- Tailwind CSS for beautiful UI design
- Turborepo for efficient monorepo management
Built with β€οΈ by pandarudra