This project is a real-time chat application built using the MERN stack (MongoDB, Express.js, React.js, Node.js) with TypeScript. It features user authentication, real-time messaging with Socket.IO, and multimedia support including image and GIF sharing via Cloudinary and Giphy.
- User authentication (register, login, logout)
- Real-time messaging with Socket.IO
- Create group chats
- Multimedia support (images, GIFs)
- File attachment support
- Emoji support
- Node.js
- Express.js
- MongoDB
- Mongoose
- TypeScript
- JSON Web Tokens (JWT)
- Cloudinary
- React.js
- TypeScript
- Vite
- Ant Design
- Tailwind CSS
- Socket.IO Client
- Giphy API
- Node.js
- npm or yarn
- MongoDB
- Clone the repository:
git clone https://github.com/priyanshum003/mern-chat-app.git
cd mern-chat-app/server
- Install dependencies:
npm install
- Create a
.env
file in theserver
directory and add the following:
PORT=
MONGO_URI=
MONGO_DB_NAME=mern-chat-app
JWT_SECRET=
JWT_REFRESH_SECRET=
ACCESS_TOKEN_EXPIRY=
REFRESH_TOKEN_EXPIRY=
CLOUDINARY_CLOUD_NAME=
CLOUDINARY_API_KEY=
CLOUDINARY_API_SECRET=
- Start the server :
npm run dev
- Navigate to the
client
directory:
cd ../client
- Install dependencies:
npm install
- Create a
.env
file in theclient
directory and add the following:
VITE_GIPHY_API_KEY=
- Start the client:
npm run dev
- Open your browser and navigate to
http://localhost:3000
for the frontend. - Register a new user or login with an existing account.
- Start chatting by selecting an existing chat or creating a new group chat.
bash
Copy code
mern-chat-app/
├── client/ # Frontend application
│ ├── public/ # Public assets
│ ├── src/ # Source files
│ ├── .env # Environment variables for the client
│ └── ...
├── server/ # Backend application
│ ├── src/ # Source files
│ ├── .env # Environment variables for the server
│ └── ...
├── README.md # Project documentation
└── ...
Contributions are welcome! Please fork the repository and create a pull request.