A modern real-time chat application built with React and Socket.io. Features multiple chat rooms, typing indicators, and online user tracking.
- Real-time Messaging - Instant message delivery using WebSockets
- Multiple Chat Rooms - Join different rooms (General, Technology, Random)
- Create Custom Rooms - Create your own chat rooms on the fly
- Typing Indicators - See when other users are typing
- Online Users - View who's currently in the room
- System Messages - Notifications when users join or leave
- Message History - See recent messages when joining a room
- Responsive Design - Works on desktop and mobile devices
- Modern UI - Clean interface built with Tailwind CSS
- React 18 with Hooks
- Socket.io Client for real-time communication
- Tailwind CSS for styling
- Lucide React for icons
- Vite for fast development
- Node.js with Express
- Socket.io for WebSocket handling
- In-memory message storage
- Node.js 18+ installed
-
Clone the repository
git clone https://github.com/sleeman01/mytalk.git cd mytalk -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../frontend npm install
-
Start the backend server (Terminal 1)
cd backend npm startServer runs on http://localhost:3002
-
Start the frontend (Terminal 2)
cd frontend npm run devApp runs on http://localhost:5173
-
Open in browser
- Go to http://localhost:5173
- Enter your name and select a room
- Start chatting!
To test the real-time features, open the app in multiple browser tabs or windows:
- Open http://localhost:5173 in Tab 1
- Open http://localhost:5173 in Tab 2
- Join the same room with different usernames
- Send messages and see them appear instantly in both tabs!
mytalk/
├── backend/
│ ├── index.js # Express + Socket.io server
│ └── package.json
├── frontend/
│ ├── src/
│ │ ├── App.jsx # Main React component
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Tailwind & custom styles
│ ├── public/
│ ├── index.html
│ ├── vite.config.js
│ ├── tailwind.config.js
│ └── package.json
└── README.md
| Event | Payload | Description |
|---|---|---|
room:join |
{ username, room } |
Join a chat room |
message:send |
{ content } |
Send a message |
typing:start |
- | User started typing |
typing:stop |
- | User stopped typing |
room:create |
roomName |
Create a new room |
| Event | Payload | Description |
|---|---|---|
rooms:list |
[{ name, userCount }] |
List of all rooms |
room:history |
[messages] |
Message history for a room |
room:users |
[usernames] |
Users in current room |
message:receive |
message |
New message received |
typing:update |
{ username, isTyping } |
Typing status update |
- Create a new Web Service
- Connect your GitHub repo
- Set root directory to
backend - Build command:
npm install - Start command:
npm start
- Import your repo
- Set root directory to
frontend - Update the
SOCKET_URLin App.jsx to your backend URL
- User authentication
- Private messaging
- File sharing
- Message reactions
- Persistent storage (MongoDB)
- User avatars
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - feel free to use this project for learning or as a portfolio piece.
Sleeman - GitHub
Built as a portfolio project to demonstrate real-time web development skills with React, Node.js, and Socket.io.