π± Real-Time Chat App A real-time chat application built with MERN stack (MongoDB, Express, React, Node.js), Socket.io for real-time messaging, and styled using TailwindCSS and Daisy UI.
π Tech Stack Frontend:
React (for building dynamic user interfaces) TailwindCSS (for utility-first CSS styling) Daisy UI (for beautiful UI components built on top of TailwindCSS) Backend: Node.js (JavaScript runtime for server-side development) Express (web framework for Node.js) Socket.io (for real-time messaging and communication) JWT (JSON Web Token) (for authentication and authorization) Database:
MongoDB (NoSQL database for storing application data) π Features Authentication & Authorization:
User login and registration with JWT tokens for secure access. Real-Time Messaging:
Instant communication between users with Socket.io. Online User Status:
Track and display the real-time online status of users. Global State Management:
Use of Zustand for efficient state management across the application. Error Handling:
Proper error handling for both server and client to ensure a smooth user experience.
π§ Setup
- Clone the Repository bash Copy Edit git clone cd
- Install Dependencies bash Copy Edit npm install
- Configure Environment Variables Create a .env file in the root of the project and add the following environment variables:
plaintext Copy Edit MONGODB_URI=your-mongodb-connection-uri PORT=5001 JWT_SECRET=your-jwt-secret-key
CLOUDINARY_CLOUD_NAME=your-cloudinary-cloud-name CLOUDINARY_API_KEY=your-cloudinary-api-key CLOUDINARY_API_SECRET=your-cloudinary-api-secret
NODE_ENV=development Make sure to replace the placeholders with your actual credentials.
π οΈ Build & Run
- Build the App for Production bash Copy Edit npm run build
- Start the App For development mode:
bash Copy Edit npm start For production mode (ensure you have the production environment set up):
bash Copy Edit npm run start:prod π Deployment Client: Deployed on Vercel for fast, global hosting. Server: Deployed on Render for seamless backend hosting. π Future Enhancements Add more real-time features such as video and voice chat. Improve UI with custom components and advanced animations. Implement full-text search for messages and users. π§βπ» Contributing If you'd like to contribute to this project, feel free to fork the repository, create a branch, and submit a pull request.