- Live Demo
- Project Overview
- Key Learnings
- Project Structure
- Tech Stack
- Features
- How to Run Locally
- WebSocket Events
- Troubleshooting
- Future Improvements
- Contributing
- License
π Live Demo π Check it out on Render
COMPANY: CODETECH IT SOLUTIONS
NAME: ARYA KUMAR
INTERN ID: CT04DZ311
DOMAIN: FRONTEND WEB DEVELOPMENT
DURATION: 4 WEEKS
MENTOR: NEELA SANTOSH
As part of my internship at CodeTech IT Solutions, I built a production-ready real-time chat application using React (Vite), Node.js, Express, and Socket.IO.
Key features:
- Real-time messaging across multiple dynamic chat rooms
- Online user counts per room + clean room switching
- Responsive, modern UI styled with plain CSS
On the frontend, I used React hooks to manage socket events and update the UI instantly.
On the backend, an Express + Socket.IO server handled room events like join, leave, and broadcast.
This project gave me hands-on experience with full-stack real-time communication, covering WebSockets vs REST, event-driven design, and state management. Itβs deployable (Render + Vercel) and ready for enhancements like typing indicators and authentication.
- Real-time bidirectional communication with Socket.IO
- Managing chat rooms and per-room user counts
- Uploading and serving files securely via Multer (UUID filenames)
- Environment-driven CORS configuration for safe deployment
- React hooks and lifecycle for real-time UI updates (
useState,useEffect,useRef) - Deployment strategies and trade-offs (committing
client/distvs. building on deploy) - Preserving contributor authorship when merging PRs
REAL-TIME-CHAT-APPLICATION/
βββ client/ # React frontend (Vite)
β βββ README.md
βββ server/ # Node.js backend
β
βββ README.md # β You're here (Root README)
| Layer | Technology |
|---|---|
| Frontend | React, Vite |
| Socket.IO | |
| Client,axios | |
| Backend | Node.js, |
| Express.js | |
| Socket.IO | |
| Multer | |
| Protocol | WebSockets |
| Tools | UUID, CORS |
| dotenv | |
| Ready for Deployment? | β
Yes (Vercel + Render or VPS supported) |
- β‘ Real-time messaging (Socket.IO)
- π§βπ€βπ§ Dynamic chat rooms (predefined + custom)
- π Live online user counts per room
- βοΈ Typing indicators
- π€ Username persistence via
localStorage - π File & Image Uploads (Multer + Axios)
- πΌοΈ Image preview inline within chat bubbles
- π» Responsive, mobile-friendly UI
π This project is a functional MVP (Minimum Viable Product) of a real-time chat application.
It demonstrates end-to-end WebSocket communication using React, Node.js, Express, and Socket.IO β without needing authentication or a database.
Users can:
- Join any room
- Send and receive real-time messages
- See how many users are online
- Instantly connect across the globe
- Send images and files in chat
This MVP proves the core functionality works and lays the foundation for future upgrades like login, database storage, private messaging, and more.
git clone https://github.com/itsaryasharma/real-time-chat-application
cd real-time-chat-applicationcd server
npm installcd ../client
npm installCreate a .env file inside the server folder:
PORT=3001cd server
npm run devThe server will start on: http://localhost:3001
In a new terminal:
cd client
npm run devThe client will start on: http://localhost:5173
- Frontend: http://localhost:5173
- Backend: http://localhost:3001
- Upload endpoint: POST /upload (multipart/form-data) β returns { url, filename }
| Event Name | Description |
|---|---|
join_room |
User joins a room |
send_message |
User sends a message |
receive_message |
Others receive the message |
-
Port Conflicts
Change ports in.envor Vite config if3001or5173are in use. -
CORS Errors
Server allows requests fromhttp://localhost:5173β update if changed. -
Socket Errors
Make sure both client and server are running and refresh the browser.
- π User authentication system
- π§Ύ Message persistence via database
- π§ User profiles and avatars
- Fork the repository
- Create a feature branch
- Commit your changes
- Push and submit a pull request
Special thanks to Aditya Anurag for implementing the file & image upload feature
(Multer integration, image preview in chat, and file handling).
His contribution is included in this project and preserved in the commit history.
MIT License
Thank you for reviewing my project!