The MERN stack which consists of Mongo DB, Express.js, Node.js, and React.js is a popular stack for building full-stack web-based applications because of its simplicity and ease of use. In recent years, with the explosive popularity and the growing maturity of the JavaScript ecosystem, the MERN stack has been the goto stack for a large number of web applications. This stack is also highly popular among newcomers to the JS field because of how easy it is to get started with this stack
This repo consists of a Chat Application built using MERN stack and user authentication using JWT token and cookies. The chat system uses the SocketIO for real-time communication between the client.
- User Login and Register
- Authentication using JWT Tokens
- React State management using REDUX
- Realtime Chat
You can have this application up and running with just a few steps because it has both the frontend and the backend in a single repository. Follow the steps below to do so.
- Clone this repo
- Once you have the repo, you need to install its dependencies. So using a terminal, move into the root directory of the project and execute
npm install
to install the dependencies of the frontend. Now go inside the backend directory and executenpm install
to install the dependencies of the backend API server. Go inside the socket directory and executenpm install
to install the dependencies of the socket server. - To run the frontend excute
npm start
in your root directory. - To run the socket server,
cd socket
to the socket directory and executenpm run socket
- NOTE Before running the backend server you need to rename the
.env(sample)
file to.env
and change the necessary environment variable. - Run the backend server,
cd backend
to the backend directory and executenpm run server