This repository contains the backend code for a chat web application built using the MERN stack (MongoDB, Express, React, Node.js). The backend is responsible for handling user authentication, real-time messaging, and storing chat history.
- User Authentication (Registration, Login, Logout)
- Real-time messaging with WebSockets (Socket.IO)
- Storing chat history in MongoDB
- RESTful API for chat functionalities
- Node.js: JavaScript runtime
- Express: Web framework for Node.js
- MongoDB: NoSQL database
- Mongoose: ODM for MongoDB
- Socket.IO: Library for real-time web applications
- Node.js and npm installed
- MongoDB installed and running
-
Clone the repository:
git clone https://github.com/Viratsingh527/web_dev_task.git cd web_dev_task -
Install dependencies:
npm install
-
Set up environment variables:
Modify a
.envfile in the root of the project and add the following:MONGO_URI=your_mongodb_url JWT_SECRET=your_jwt_secret
-
Start the server:
npm start
The server should now be running on
http://localhost:5000.
- POST /api/user/: Register a new user
- POST /api/user/login: Login a user
- POST /api/message: Send a message
- GET /api/message/:chatId: Get all messages of a chat
- GET /api/chat: Fetch all chats
- POST /api/chat: Access chats
- POST /api/chat/group: Create group chat
- POST /api/chat/rename: Rename group chat
- POST /api/chat/groupadd: add user to group
- PUT /api/chat/groupremove: remove user from group
We are actively seeking contributors to develop the frontend for this chat application. If you are interested in contributing, please follow the steps below:
-
Fork the repository: Create your own fork of the repository by clicking the "Fork" button at the top right of the repository page.
-
Clone the forked repository:
git clone https://github.com/Viratsingh527/web_dev_task.git cd web_dev_task -
Create a new branch for your frontend development:
git checkout -b frontend
-
Develop the frontend using your preferred tools and frameworks. We suggest using React to keep the stack consistent.
-
Commit your changes:
git add . git commit -m "Add frontend code"
-
Push your changes to your forked repository:
git push origin frontend
-
Submit a pull request: Go to the original repository and click the "New Pull Request" button. Ensure your pull request includes a detailed description of the changes and any relevant information for the reviewers.
- Virat Singh: Backend Developer
- [Your Name Here]: Frontend Developer (Looking for contributors!)
If you have any questions, feel free to reach out:
- Email: babulkumar527@gmail.com
- GitHub: Viratsingh527