A real-time chat application built with the MERN Stack, Socket.IO, Tailwind CSS & ShadcnUI. It enables the user for chat, share files with other user in realtime.
-
Authentication & Authorization - Secure login and token-based authentication with JWT.
-
Real-time Messaging – Instant chat updates powered by Socket.IO.
-
Typing Indicators – See when a user is typing in real time.
-
Contacts Search – Quickly find contacts with an intuitive search.
-
Status Updates – View online/offline status of contacts.
-
State Manage – Managed globally with React Context & Zustand.
-
Data Caching - Implements client side caching using React Query.
-
Schema Validation – Ensures data integrity with Zod on both client and server.
-
Error Handling – Robust error handling on both frontend and backend.
Ensure you have Git, Node.js and npm installed on your machine.
Clone the Repository
git clone https://github.com/shekharsikku/synchronous-chat
cd synchronous-chatInstall Dependencies
Install packages for both the server and client:
npm install && cd client && npm installEnvironment Variables Setup
cp .env.example .envCopy, .env.example file to file name .env in the root directory and add the required values:
CLOUDINARY_CLOUD_NAME=""
CLOUDINARY_API_KEY=""
CLOUDINARY_API_SECRET=""
ACCESS_SECRET=""
ACCESS_EXPIRY=""
REFRESH_SECRET=""
REFRESH_EXPIRY=""
COOKIES_SECRET=""
SOCKET_PUBLIC=""
PAYLOAD_LIMIT=""
PORT=""
CORS_ORIGIN=""
MONGODB_URI=""
NODE_ENV=""Run in Development Mode
Start the server:
npm run devStart the client:
cd client && npm run devThen, open below link in your browser.
http://localhost:5173Building for Production
Build React App
cd client && npm run buildStart the Application
Ensure you're in the root directory:
npm run build && npm run startYour app will be available at the port specified in .env.
http://localhost:<PORT>Use this section to tell people about which versions of your project are currently being supported with security updates.
| Version | Supported |
|---|---|
| 5.1.x | ✅ |
| 5.0.x | ❌ |
| 4.0.x | ✅ |
| < 4.0 | ❌ |
npm install express@latestUsing older versions may cause unexpected issues.
npm install mongoose@latest- Use environment variables for sensitive data.
- Regularly update dependencies.
- Follow secure authentication practices.
Use this section to tell people how to report a vulnerability.
Tell them where to go, how often they can expect to get an update on a reported vulnerability, what to expect if the vulnerability is accepted or declined, etc.
Found a security issue? Please open an issue!
We appreciate responsible disclosure and will respond promptly.