https://github.com/behan05/real-time-chat-app
A full-stack real-time chat application with user authentication, private messaging, and socket-based communication built using React, Node.js, Express, Socket.IO, and MongoDB.
https://github.com/behan05/real-time-chat-app
chat-ui connect-app good-first-issue mern-stack open-source random-chat react realtime responsive-design socketio
Last synced: 9 months ago
JSON representation
A full-stack real-time chat application with user authentication, private messaging, and socket-based communication built using React, Node.js, Express, Socket.IO, and MongoDB.
- Host: GitHub
- URL: https://github.com/behan05/real-time-chat-app
- Owner: behan05
- License: mit
- Created: 2025-06-11T11:51:43.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-08-08T11:21:17.000Z (10 months ago)
- Last Synced: 2025-08-08T11:41:06.092Z (10 months ago)
- Topics: chat-ui, connect-app, good-first-issue, mern-stack, open-source, random-chat, react, realtime, responsive-design, socketio
- Language: JavaScript
- Homepage: https://connect-link-three.vercel.app
- Size: 124 MB
- Stars: 5
- Watchers: 1
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README

---
# Random Real-Time Chat App
[](./LICENSE)
[](./contributing)








A full-stack random real-time chat application that connects users anonymously for private 1-on-1 messaging. Built with **React**, **Node.js**, **Express**, **Socket.IO**, and **MongoDB**.
---
#### _Read docs in other languages._
[
](docs/translations/README.id.md)
[
](docs/translations/README.es.md)
---
## π Table of Contents
- [Preview](#preview)
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Setup Instructions](#setup-instructions)
- [Tech Stack](#tech-stack)
- [Project Structure](#project-structure)
- [Deployment](#deployment)
- [Contributing](#contributing)
- [Made by Contributors](#made-by-contributors)
- [Acknowledgements](#acknowledgements)
- [Contact](#contact)
- [License](#license)
---
## πΌοΈ Preview
| Login Page | Sign Up | App Page |
| ----------------------------------- | ------------------------------------ | ---------------------------------- |
|  |  |  |
---
## π Features
- π Secure User Authentication (Login/Signup)
- π² Random One-to-One Private Chat
- π‘ Real-time Messaging with Socket.IO
- π Chat History Persistence using MongoDB
- βοΈ Typing Indicator (optional)
- π‘οΈ Protected Routes for Logged-in Users
- π Timestamped Messages
- π± Fully Responsive UI (Mobile & Desktop)
---
## π¦ Prerequisites
Make sure you have the following installed before starting:
- [Node.js](https://nodejs.org/) (v18 or later)
- [Git](https://git-scm.com/)
- A [MongoDB Atlas](https://www.mongodb.com/cloud/atlas) account (or use local MongoDB)
**Need help setting up MongoDB Atlas?** Follow this guide: [Deploy a Free Cluster](https://www.mongodb.com/docs/atlas/tutorial/deploy-free-tier-cluster/)
After deploying a cluster:
1. Click **Connect** β **Drivers**
2. Select **Node.js** as the driver
3. Copy the connection string and use it for `MONGO_URI` in `.env`
Example connection string:
```
MONGO_URI=mongodb+srv://:@cluster0.mongodb.net/?retryWrites=true&w=majority
```
---
## βοΈ Setup Instructions
Follow these steps to run the app locally:
### 1. Clone the Repository
```bash
git clone https://github.com/behan05/real-time-chat-app.git
cd real-time-chat-app
```
---
### 2. Set Up the Backend
Navigate into the server directory:
```bash
cd connect-server
```
Install dependencies:
```bash
npm install
```
Create an environment file:
```bash
cp .env.example .env
```
Open the `.env` file and configure:
```env
PORT=5000
MONGO_URI=your_mongo_db_uri_here
JWT_SECRET=your_jwt_secret_here
```
Start the backend server:
```bash
npm start
```
You should see logs like:
```
Server running on port 5000...
Connected to MongoDB
```
---
### 3. Set Up the Frontend
In a new terminal window/tab:
```bash
cd connect-ui
npm install
npm run dev
```
The app will open at: [http://localhost:5173/](http://localhost:5173)
---
## π§― Troubleshooting
Common issues and solutions:
- **MongooseServerSelectionError**: Double-check your MongoDB URI and internet connection.
- **Port already in use**: Change the `PORT` value in `.env`, or stop the conflicting process.
- **Frontend doesnβt load**: Ensure backend server is running correctly.
---
## π§± Tech Stack
**Frontend:**
- βοΈ React + Vite
- π
Material UI (MUI)
- π React Router
- π¦ Redux or Context API
- π’ Toastify
- π Socket.IO Client
**Backend:**
- π© Node.js + Express
- π’οΈ MongoDB + Mongoose
- π JWT for Authentication
- π bcrypt for Hashing
- π‘ Socket.IO for Real-Time Comm
---
## π Project Structure
```
real-time-chat-app/
βββ connect-ui/
β βββ src/
β β βββ components/
β β βββ pages/
β β βββ routes/
β β βββ redux/ or context/
β β βββ App.jsx
β βββ package.json
βββ connect-server/
β βββ controllers/
β βββ models/
β βββ routes/
β βββ socket/
β βββ server.js
βββ docs/
β βββscreenshot/
β βββtranslations/
βββ .env
βββ README.md
```
---
## π Deployment
- **Frontend**: [Vercel](https://connect-link-three.vercel.app/)
- **Backend**: Render
---
## π€ Contributing
### Thinking of contributing?
Don't worry if you're new to open source β we're happy to help guide you! π
Just open an issue or comment on one you'd like to tackle.
### We welcome contributions!
If you're new to open source, here are some good first issues:
### π§ Good First Tasks:
- Improve error messages or user feedback
- Setup GitHub Actions for CI
- Add unit tests or end-to-end tests
- Improve accessibility
- Write documentation
### Steps to contribute:
- π± Fork this repo
- π οΈ Create your feature branch
- π Submit a Pull Request
- β€οΈ Don't forget to star the project!
Be sure to read the [contributing guide](CONTRIBUTING.md) if available.
---
## π Made by Contributors
We are grateful to all contributors who make this better every day.
Add yourself in `CONTRIBUTORS.md` when you contribute!
---
## β€οΈ Acknowledgements
Thanks to all contributors and open-source libraries used in this project.
This project wouldn't be possible without them!
---
## π¬ Contact
For questions or contributions, feel free to reach out:
βοΈ [behankrbth@outlook.com](mailto:behankrbth@outlook.com)
---
## π License
This project is licensed under the [MIT License](./LICENSE)
---