https://github.com/fskydev/mern-auth-chat
Real-time chat application with authentication & authorization
https://github.com/fskydev/mern-auth-chat
authentication authorization cookie example expressjs full-stack jwt mern mongoose nodejs portfolio-item reactjs real-time socket-io starter tailwindcss
Last synced: 8 days ago
JSON representation
Real-time chat application with authentication & authorization
- Host: GitHub
- URL: https://github.com/fskydev/mern-auth-chat
- Owner: fskydev
- Created: 2023-11-08T14:45:11.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-10T01:26:10.000Z (over 1 year ago)
- Last Synced: 2025-03-31T06:32:07.981Z (about 2 months ago)
- Topics: authentication, authorization, cookie, example, expressjs, full-stack, jwt, mern, mongoose, nodejs, portfolio-item, reactjs, real-time, socket-io, starter, tailwindcss
- Language: JavaScript
- Homepage: https://mern-auth-chat.onrender.com
- Size: 271 KB
- Stars: 9
- Watchers: 1
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MERN Auth & Chat App
### NodeJS - Express - JWT - Socket.io - MongoDB - React - React Router - Context API - TailwindCSS
This is a perfect example for a MERN stack real-time chat application with authentication & authorization.
Basically, it consists of 2 parts as the follows:
- Real-time chat application using socket.io in node.js(Express)
- JWT Authentication & Authorization stored in HTTP-only cookie## Demo url
https://mern-auth-chat.onrender.com/
## Usage
- Create a MongoDB database and obtain your `MongoDB URI` - [MongoDB Atlas](https://www.mongodb.com/cloud/atlas/register)
### Clone the project```
git clone [email protected]:fskydev/mern-auth-chat.git
```### Env Variables
Rename the `server/.env.example` file to `.env` and add the following
```
PORT=5000
MONGO_URI=
JWT_SECRET_KEY=
```Change the JWT_SECRET to what you want
### Install Dependencies (backend & frontend)
```
cd server
npm install
```
```
cd socket
npm install
```
```
cd client
npm install
```
### Run locally```
# Run API server
cd server
npm run dev
```
```
# Run socket server
cd socket
npm run dev
```
```
# Run frontend
cd client
npm run dev
```
## Build & Deploy
```
cd client/ && npm install && npm run build && cd .. && cd server/ && npm install && npm run start
```## Screenshots
#### Private Chat

#### Login & Register

#### Mobile Responsiveness, Notifications, Potential Chats




Happy coding 🔥