Welcome to Sjx_ChatApp, a powerful and intuitive real-time chat application that connects people seamlessly. Built with modern technologies, Sjx_ChatApp ensures a secure, fast, and user-friendly chatting experience.
Live Demo: Sjx_ChatApp
- Real-Time Messaging β Powered by Socket.IO for instant chat communication.
- Secure Authentication β JWT-based authentication ensures user data security.
- User-Friendly UI β Styled with Tailwind CSS & DaisyUI for a sleek and responsive design.
- Scalable Backend β Built with Express.js & Node.js for efficient performance.
- MongoDB Database β A robust NoSQL database for storing messages and user data.
- Fast & Lightweight β Optimized for speed and smooth user experience.
- Online Status β See who's online in real-time.
- Message Notifications β Audio notifications for new messages.
- Responsive Design β Works perfectly on desktop and mobile devices.
- Node.js (v16 or higher)
- MongoDB (local or cloud)
- Git
-
Clone the repository
git clone https://github.com/SjxSubham/Sjx_Chat.git cd Sjx_Chat -
Install dependencies
npm install cd frontend/Sjx_chat npm install cd ../.. cd backend npm install cd .. npm list npm i
-
Environment Setup
# Copy example environment files cp .env.example .env cp frontend/Sjx_chat/.env.example frontend/Sjx_chat/.env -
Configure Environment Variables
Edit
.envfile:MONGO_DB_URI=mongodb://localhost:27017/chat_app JWT_SECRET=your_jwt_secret_key_here PORT=5000 NODE_ENV=development CLIENT_URL=http://localhost:3000
Edit
frontend/Sjx_chat/.envfile:VITE_API_URL=http://localhost:5000 VITE_SOCKET_URL=http://localhost:5000
-
Start the application
# Development mode (backend) npm run server # In a new terminal, start frontend cd frontend/Sjx_chat npm run dev
-
Access the application
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
# Build the application
npm run build
# Start in production mode
npm startSjx_Chat/
βββ backend/
β βββ controllers/ # API controllers
β βββ db/ # Database connection
β βββ middleware/ # Auth middleware
β βββ models/ # MongoDB schemas
β βββ routes/ # API routes
β βββ socket/ # Socket.IO configuration
β βββ utils/ # Utility functions
βββ frontend/Sjx_chat/
β βββ src/
β β βββ components/ # React components
β β βββ context/ # React context
β β βββ hooks/ # Custom hooks
β β βββ pages/ # Page components
β β βββ utils/ # Frontend utilities
β βββ public/ # Static assets
βββ package.json # Root dependencies
| Command | Description |
|---|---|
npm run server |
Start backend in development mode |
npm start |
Start backend in production mode |
npm run build |
Build frontend for production |
npm run dev |
Start frontend in development mode (from frontend/Sjx_chat) |
-
Port already in use
- Change PORT in
.envfile - Kill process using:
netstat -ano | findstr :5000
- Change PORT in
-
MongoDB connection error
- Ensure MongoDB is running
- Check MONGO_DB_URI in
.env
-
Socket connection issues
- Verify VITE_SOCKET_URL in frontend
.env - Check CORS settings in backend
- Verify VITE_SOCKET_URL in frontend
An engaging real-time chat experience with a sleek UI.
This project is licensed under the GNU GENERAL PUBLIC LICENSE v3.0 - see the LICENSE file for details.
Contributions are welcome! Feel free to fork the repo and submit a pull request.
For any issues or suggestions, please reach out via GitHub Issues.
Happy chatting! π