π¬ Fullstack Chat Application
A real-time fullstack chat application built with the MERN Stack and Socket.io, featuring authentication, live messaging, online user tracking, and image uploads.
π Live Demo
π Live App: https://fullstack-chat-application-1-pdq2.onrender.com
π Tech Stack Frontend
React (Vite)
Tailwind CSS
DaisyUI
Zustand (State Management)
Socket.io Client
Axios
Backend
Node.js
Express.js
MongoDB (Mongoose)
JWT Authentication
Socket.io
Cloudinary (Image Uploads)
Deployment
Render (Backend + Frontend)
MongoDB Atlas
β¨ Features
π User Authentication (Signup / Login / Logout)
π JWT-based secure sessions (HTTP-only cookies)
π¬ Real-time messaging with Socket.io
π’ Online/Offline user indicators
πΈ Image message support (Cloudinary integration)
β‘ Instant message updates without refresh
π¨ Responsive UI using Tailwind + DaisyUI
π Clean project structure (Frontend & Backend separated)
π Project Structure chat-app/ β βββ backend/ β βββ src/ β βββ routes/ β βββ controllers/ β βββ models/ β βββ lib/ β βββ index.js β βββ frontend/ β βββ src/ β βββ components/ β βββ pages/ β βββ store/ β βββ README.md βοΈ Environment Variables
Create a .env file inside backend/:
PORT=5001 MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_secret_key CLOUDINARY_CLOUD_NAME=your_cloud_name CLOUDINARY_API_KEY=your_api_key CLOUDINARY_API_SECRET=your_api_secret CLIENT_URL=http://localhost:5173
For production, set these in your hosting dashboard.
π§βπ» Running Locally 1οΈβ£ Clone the repository git clone https://github.com/khushal108/fullstack-chat-application.git cd fullstack-chat-application 2οΈβ£ Install Backend Dependencies cd backend npm install 3οΈβ£ Install Frontend Dependencies cd ../frontend npm install 4οΈβ£ Run the App
Open two terminals:
Backend:
cd backend npm run dev
Frontend:
cd frontend npm run dev
Visit:
http://localhost:5173 π Production Build
Frontend build:
cd frontend npm run build
Backend will serve the frontend automatically when:
NODE_ENV=production π§ What I Learned
Implementing real-time communication with Socket.io
Managing global state using Zustand
Handling JWT authentication securely with cookies
Deploying fullstack apps on Render
Debugging complex frontend-backend integration issues
π Future Improvements
Message read receipts
Typing indicators
Group chat support
Push notifications
User profile customization
π€ Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
π License
This project is open-source and available under the MIT License.