Build a real-time chat application using the MERN Stack (MongoDB, Express, React, and Node.js) to assess skills in backend development, API design, real-time data handling, and full-stack application architecture.
- Exclusive Communication:
- Users can only chat with contacts they have explicitly saved in their contact list
- Provides an additional layer of privacy and security
- Prevents random strangers from initiating conversations
- Multi-Layer Security:
- JWT Token Authentication
- OTP (One-Time Password) Verification
- Email-based Account Activation
- Secure password hashing
- Comprehensive user validation process
- Intelligent Presence Tracking:
- Detailed online/offline status indicators
- Real-time presence updates using WebSockets
- Instant notification of user connection status
- Enhanced Message Interactions:
- Typing indicators
- Read receipts
- Precise message timestamps
- Automatic chat window scrolling
- Email notifications for account activities
- Flexible Design Architecture:
- Multi-theme support
- Minimalist and responsive design
- Seamless cross-device experience
- Adaptive UI components
- Privacy-Focused Messaging:
- Contacts-only messaging restriction
- Secure message storage in MongoDB
- End-to-end communication tracking
- Comprehensive user authentication
- Smart Notification System:
- Email notifications on account creation
- OTP verification via email
- Detailed account activity tracking
- Intelligent user connection management
- Robust Technical Architecture:
- WebSocket-based real-time communication
- Efficient backend with Node.js and Express
- Scalable MongoDB database design
- Optimized frontend with React
- Contextual Communication:
- User-centric contact management
- Intuitive interface design
- Seamless real-time interactions
- Minimal cognitive load for users
- Future-Ready Design:
- Modular architecture
- Easy integration of new features
- Potential for group chat expansion
- Flexible authentication mechanisms
- Secure user registration and login
- JWT (JSON Web Tokens) for session management
- Secure user details storage in MongoDB
- Password validation and hashing
- OTP Verification via email
- Real-time messaging for authenticated users
- WebSocket implementation using Socket.io
- Live chat without page refresh
- Chat history persistence in MongoDB
- Chat only possible between users with saved contacts
- React-based frontend
- Online users list
- Simple chat interface
- Message input field
- Chat message display area
- Online/Offline presence indicator
- Typing indicators
- Message timestamps
- Read receipts
- Multi-theme support
- Minimalist design
- Node.js and Express server
- RESTful API endpoints
- MongoDB for data storage
- Socket.io for real-time communication
- JWT Authentication
- React
- Socket.io-client
- Responsive design
- Username
- Password (hashed)
- Phone Number
- Contacts
- Sender
- Receiver
- Message Content
- Timestamp
- Read Status
- Node.js (v14+)
- npm (v6+)
- MongoDB
- Git
git clone https://github.com/12fahed/Real-Time-Chat-Application.git
cd Real-Time-Chat-Applicationcd backend
npm installCreate .env in backend directory:
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
EMAIL_SERVICE_CONFIG=your_email_service_configuration
Run backend:
npm run devcd ../frontend
npm installCreate .env in frontend directory:
REACT_APP_API_URL=http://localhost:5000
Run frontend:
npm run dev-
Create an account with:
- Name
- Password
- Phone Number
-
Verify account via OTP sent to email
-
Add contacts by phone number
-
Start chatting with saved contacts
- JWT Token Authentication
- OTP Email Verification
- Secure password storage
- Contact-based messaging
- Email verification
- Token-based authentication
- Multiple theme support
- Minimalist design
- Easy theme switching
- Fork the repository
- Create feature branch:
git checkout -b feature/YourFeature - Commit changes:
git commit -m 'Add YourFeature' - Push to branch:
git push origin feature/YourFeature - Open Pull Request
- Visual Studio Code
- MongoDB Compass
- Postman for API testing
- Ensure all environment variables are correctly set
- Check MongoDB connection
- Verify Node.js and npm versions
- Ensure all dependencies are installed
- Implement pagination for chat history
- Use efficient indexing in MongoDB
- Optimize WebSocket connections
- Implement caching mechanisms
- Group chat functionality
- File sharing
- Advanced user profiles
- End-to-end encryption
- Video/Audio chat integration
Fahed Khan