A modern, full-stack real-time chat application built with React, Node.js, and Socket.io. QuickChat enables users to communicate instantly with real-time message delivery, user authentication, and online status tracking.
- Real-Time Messaging: Send and receive messages instantly using WebSocket connections
- Message Status: Track message delivery with read/seen indicators
- Rich Media Support: Share images and text messages
- Conversation History: Access complete chat history with timestamps
- User Authentication: Secure sign-up and login with JWT tokens
- Password Security: Bcrypt encryption for password storage
- User Profiles: Customizable profiles with bio and profile pictures
- Online Status: Real-time online/offline user status tracking
- Responsive Design: Fully responsive UI with Tailwind CSS
- Modern Interface: Sleek, intuitive user interface
- Toast Notifications: Real-time feedback for user actions
- Profile Management: Update profile information and pictures
- React 19 - UI library for building interactive components
- Vite - Fast build tool and development server
- React Router - Client-side routing
- Axios - HTTP client for API communication
- Socket.io Client - Real-time bidirectional communication
- Tailwind CSS - Utility-first CSS framework
- React Hot Toast - Toast notification system
- Node.js - JavaScript runtime
- Express.js - Web framework for building APIs
- MongoDB - NoSQL database for data persistence
- Mongoose - ODM (Object Data Modeling) for MongoDB
- Socket.io - Real-time event-based communication
- JWT (jsonwebtoken) - Secure token-based authentication
- Bcryptjs - Password hashing and encryption
- Cloudinary - Cloud storage for image management
- CORS - Cross-Origin Resource Sharing support
chatapp/
├── client/ # Frontend React application
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ │ ├── Chatcontainer.jsx # Main chat interface
│ │ │ ├── Sidebar.jsx # User list sidebar
│ │ │ └── Rightsidebar.jsx # Right panel (user info, etc.)
│ │ ├── pages/ # Page components
│ │ │ ├── Homepage.jsx # Main chat page
│ │ │ ├── Loginpage.jsx # Auth page (login/signup)
│ │ │ └── Profilepage.jsx # User profile page
│ │ ├── context/ # React Context for state management
│ │ │ ├── AuthContext.jsx # Authentication context
│ │ │ └── ChatContext.jsx # Chat state context
│ │ ├── lib/ # Utility functions
│ │ │ └── util.js # Helper utilities
│ │ ├── assets/ # Static assets
│ │ ├── App.jsx # Root component
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Global styles
│ ├── vite.config.js # Vite configuration
│ ├── package.json # Dependencies
│ └── dockerfile # Docker configuration
│
└── server/ # Backend Express application
├── controllers/ # Business logic
│ ├── usercontroller.js # User auth and profile operations
│ └── messagecontroller.js # Message operations
├── models/ # Database schemas
│ ├── user.js # User model
│ └── message.js # Message model
├── routes/ # API endpoints
│ ├── userroutes.js # Auth and user routes
│ └── messageroutes.js # Message routes
├── middleware/ # Express middleware
│ └── auth.js # JWT authentication middleware
├── lib/ # Utilities
│ ├── db.js # Database connection
│ ├── cloudinary.js # Cloudinary config
│ └── utils.js # Helper functions
├── server.js # Main server file
├── package.json # Dependencies
└── dockerfile # Docker configuration
- Node.js (v14 or higher)
- npm or yarn
- MongoDB database (local or cloud-based)
- Cloudinary account (for image uploads)
git clone <repository-url>
cd chatappcd server
# Install dependencies
npm install
# Create .env file
# Add the following environment variables:
# MONGODB_URI=<your-mongodb-connection-string>
# JWT_SECRET=<your-jwt-secret-key>
# CLOUDINARY_NAME=<your-cloudinary-name>
# CLOUDINARY_KEY=<your-cloudinary-api-key>
# CLOUDINARY_SECRET=<your-cloudinary-api-secret>
# PORT=5000
# Start the server
npm start
# or with hot reload
npm run servercd client
# Install dependencies
npm install
# Create .env file
# Add the following environment variable:
# VITE_BACKEND_URL=http://localhost:5000
# For production:
# VITE_BACKEND_URL=https://your-backend-url.com
# Start development server
npm run dev
# Build for production
npm run buildMONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/chatapp
JWT_SECRET=your_jwt_secret_key_here
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_KEY=your_cloudinary_api_key
CLOUDINARY_SECRET=your_cloudinary_api_secret
PORT=5000
NODE_ENV=developmentVITE_BACKEND_URL=http://localhost:5000-
POST /api/auth/signup- Create a new user account- Body:
{ fullName, email, password, bio }
- Body:
-
POST /api/auth/login- Login user- Body:
{ email, password }
- Body:
-
GET /api/auth/check- Verify user authentication (requires token) -
PUT /api/auth/update-profile- Update user profile (requires token)- Body:
{ fullName, bio, profilePic }
- Body:
-
GET /api/messages/:userId- Fetch conversation with a user (requires token) -
POST /api/messages/send/:userId- Send a message (requires token)- Body:
{ text, image }
- Body:
-
GET /api/messages/users- Get all conversations (requires token)
{
email: String (unique, required),
fullName: String (required),
password: String (hashed, required),
profilePic: String (default: ""),
bio: String,
createdAt: Date,
updatedAt: Date
}{
senderId: ObjectId (ref: User, required),
receiverId: ObjectId (ref: User, required),
text: String,
image: String,
seen: Boolean (default: false),
createdAt: Date,
updatedAt: Date
}- Connection: Automatically establishes connection with user ID
- getOnlineUsers: Receives list of currently online users
- disconnect: Handles user disconnection
- User connected: Broadcasts when user comes online
- User disconnected: Broadcasts when user goes offline
- New message: Real-time message delivery to recipient
- Message seen: Confirmation when recipient views message
- JWT Authentication: Secure token-based authentication
- Password Hashing: Bcryptjs for secure password storage
- Protected Routes: Middleware-based route protection
- CORS Configuration: Restricted cross-origin requests
- Environment Variables: Sensitive data stored in .env files
- Mobile-first approach using Tailwind CSS
- Optimized for all screen sizes (mobile, tablet, desktop)
- Touch-friendly interface elements
- Adaptive layout components
Both client and server include Dockerfile configurations for containerized deployment.
# Build Docker images
docker build -t quickchat-client ./client
docker build -t quickchat-server ./server
# Run containers
docker run -p 5173:5173 quickchat-client
docker run -p 5000:5000 quickchat-servercd client
npm run build
# Output: dist/- Frontend: Deploy
dist/folder to Vercel, Netlify, or any static hosting - Backend: Deploy to Render, Railway, Heroku, or any Node.js hosting platform
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the ISC License.
For support, email support@quickchat.com or create an issue in the repository.
- End-to-end encryption
- Voice and video calling
- Group chat functionality
- Message search and filtering
- File sharing (documents, videos)
- User blocking system
- Message reactions and emojis
- Dark mode theme
QuickChat - Connect Instantly, Chat Seamlessly.