A simple full-stack chat application with authentication, user profiles, and (optional) real-time messaging using React and Node.js.
- User registration and login
- Profile update
- List of online users (if sockets enabled)
- Send and receive messages
- Responsive UI with React
- Toast notifications for actions
- Frontend: React, Context API, Axios, React Hot Toast
- Backend: Node.js, Express, MongoDB
- (Optional) Real-time: Socket.IO
- Node.js (v16+)
- npm or yarn
- MongoDB (local or Atlas)
git clone https://github.com/VIGGU-7/chat-application.git
cd chat-applicationBackend:
cd backend
npm installFrontend:
cd ../frontend
npm installCreate a .env file in the backend folder:
PORT=8080
mongo_url="<>"
JWT_SECRET="<>"
cloudName="<>"
cloudinaryApiKey=<>
cloudinaryApiSecret="<>"
clientUrl=<>
NODE_ENV="devolopment"
Create a .env file in the frontend folder:
VITE_BACKEND_URL="http://<>/api"
VITE_BASE_URL="http://<>"
Backend:
npm run devFrontend:
npm startThe frontend runs on http://localhost:3000
The backend runs on http://localhost:8080
- Register a new account or log in.
- Update your profile.
- Start chatting with other users.
- If real-time is enabled, messages and online status update instantly.
chat-application/
backend/
src/
controllers/
models/
routes/
...
server.js
frontend/
src/
components/
context/
lib/
...
App.jsx
- To enable/disable real-time features, adjust socket logic in the context files.
- Update styles in
frontend/srcas needed.




