A real-time chat application built with React, Redux, Node.js, Express, and Socket.IO.
- Real-time messaging
- User authentication
- File uploads (images and documents)
- Notifications for new messages
- Online/offline user status
- Persistent notifications using localStorage
- Frontend: React, Redux, Tailwind CSS
- Backend: Node.js, Express, MongoDB
- Real-time Communication: Socket.IO
- Node.js and npm
- MongoDB
-
Clone the repository:
git clone https://github.com/your-username/NexTalk.git cd NexTalk
-
Install dependencies for the server:
cd api npm install
-
Install dependencies for the client:
cd ../client npm install
Create a .env
file in the api
directory and add the following:
PORT=***
MONGO_URI=your_mongo_url
JWT_SECRET=your_jwt_secret
CLIENT_URL=http://localhost:3000
-
Start the backend server:
cd server npm start
-
Start the frontend client:
cd ../client npm start
-
Open your browser and navigate to
http://localhost:3000
server.js
: Entry point for the backend server.config/connectDB.js
: MongoDB connection configuration.controllers
: Contains the controller functions for user and message management.models
: Mongoose schemas and models.routes
: Express routes for user and message APIs.middleware
: Custom middleware functions.utils
: Utility functions.
src
: Main source directory.components
: Reusable React components.context
: Context API for global state management (e.g., notifications).features
: Redux slices for managing state (e.g., auth, messages).hooks
: Custom hook functions.pages
: Main pages for the application (e.g., Chat, Login, Register).App.js
: Main application component.index.js
: Entry point for the React application.utils
: Utility functions.
- Register a new user.
- Login with existing credentials.
- Select a user from the contact list to start chatting.
- Send text messages or upload files (images/documents).
- Receive real-time notifications for new messages.
- View online/offline status of users.
- New message notifications are stored in localStorage for persistence across sessions.
Contributions are welcome! Please fork the repository and create a pull request.
- Fork the repository
- Create a new branch (
git checkout -b feature/your-feature
) - Commit your changes (
git commit -m 'Add some feature'
) - Push to the branch (
git push origin feature/your-feature
) - Open a pull request
This project is licensed under the MIT License - see the LICENSE file for details.