A modern real-time chat application built with React.js frontend and Node.js backend, featuring Socket.io for real-time messaging, MongoDB for data storage, and Cloudinary for image uploads.
- Real-time messaging with Socket.io
- User authentication with JWT tokens
- Image sharing with Cloudinary integration
- Online/Offline status indicators
- Message seen/unseen functionality
- Responsive design with Tailwind CSS
- Profile management with image uploads
- Search functionality for users
- Mobile-friendly interface
- React.js 19 - UI library
- Vite - Build tool
- Tailwind CSS - Styling
- React Router - Navigation
- Socket.io Client - Real-time communication
- Axios - HTTP requests
- React Hot Toast - Notifications
- Node.js - Runtime environment
- Express.js - Web framework
- Socket.io - Real-time communication
- MongoDB - Database
- Mongoose - ODM
- JWT - Authentication
- Bcrypt - Password hashing
- Cloudinary - Image storage
- CORS - Cross-origin requests
Chat-App/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── context/ # React context providers
│ │ ├── assets/ # Static assets
│ │ └── lib/ # Utility functions
│ ├── public/ # Public assets
│ └── package.json # Frontend dependencies
├── server/ # Node.js backend
│ ├── controllers/ # Route controllers
│ ├── models/ # Database models
│ ├── routes/ # API routes
│ ├── lib/ # Utility functions
│ ├── middleware/ # Custom middleware
│ └── package.json # Backend dependencies
└── README.md
- Node.js (v18 or higher)
- MongoDB Atlas account or local MongoDB
- Cloudinary account (for image uploads)
-
Clone the repository
git clone https://github.com/Placeboguy/fullstack-chat234243.git cd fullstack-chat234243 -
Install backend dependencies
cd server npm install -
Install frontend dependencies
cd ../client npm install -
Set up environment variables
Create
.envfile in theserverdirectory:MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret PORT=5000
Create
.envfile in theclientdirectory:VITE_BACKEND_URL=http://localhost:5000
-
Start the application
Start backend server:
cd server npm startStart frontend development server:
cd client npm run dev -
Open your browser
- Frontend: http://localhost:5173
- Backend: http://localhost:5000
This application is configured for deployment on Render (recommended for real-time applications):
- Connect your GitHub repository to Render
- Create a new Web Service
- Set root directory to
server - Add environment variables
- Deploy
- Create a new Static Site
- Set root directory to
client - Build command:
npm install && npm run build - Publish directory:
dist
Note: Update the CORS settings in server.js and .env.production with your actual deployment URLs.
- Sign up with email, password, and profile details
- Login with email and password
- JWT-based session management
- Automatic logout on token expiration
- Instant messaging with Socket.io
- Online status indicators
- Message timestamps
- Image sharing capabilities
- Seen/unseen message status
- Responsive design for all devices
- Search users functionality
- Profile management
- Clean, modern UI with Tailwind CSS
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Prathamesh_Singh
- GitHub: @Prathamesh-Singh
- Socket.io for real-time communication
- Cloudinary for image hosting
- MongoDB for database
- React and Node.js communities
Happy Chatting! 💬