As a beginner MERN stack developer, I want to challenge myself with a project that goes beyond simple CRUD apps. That's how I came up with the idea of building a real-time chat application where users can sign up, log in, and chat instantly with each other.
This project helped me develop skills in authentication, WebSockets, state management, and deployment that are essential for real-world full-stack development.
π Tech Stack:
Frontend: React(Vite),Axios, Context API
Backend: Node.js, Express
Database: MongoDB Atlas
Real-time: Socket.IO
Authentication: JWT
Deployment: Frontend (Vercel), Backend (Render)
β¨ Features
π User Authentication (Login / Signup with JWT)
π¬ Real-time chat with Socket.IO
π₯ Online users tracking
πΌοΈ Profile update (Cloudinary integration)
π± Fully responsive design
β‘ Challenges I Faced & Solutions
- Socket.IO Connection Issue:
Problem: Connection broke after login/logout
Solution: Passed userId via socket.handshake.query and mapped it to sockect.id
- Deployment Issue on Vercel:
Problem: Vercel crashed because serverless functions don't support WebSockets.
Solution: Moved backend to Render, which supports persistent WebSocket connections.
- State Management:
- Problem: Maintaining auth state and socket connection together was tricky.
- Solution: Used React Context API to manage user state, token, and socket connection globally.
πΈ Screenshots:
π Live Demo & GitHub Links
π Live App: [chat-app-frontend-delta-seven.vercel.app]
π» Frontend Repo: [https://github.com/webafsanakeya/chat-app-frontend]
π» Backend Repo: [https://github.com/webafsanakeya/chat-app-backend]
π― Key Learnings
- JWT authentication and protecting routes
- Real-time communication using Socket.IO
- Handling state management between frontend & backend
- Deployment differences (Vercel vs Render)
Conclusion
This project was an amazing learning experience as a beginner MERN developer. It gave me confidence in full-stack development and helped me understand the power of real-time communication.
π‘ If youβre also working on chat apps or MERN stack projects, letβs connect and share knowledge! π
Top comments (0)