A real-time 1:1 chat application built with React Native (Expo) and Node.js (Express + Socket.IO), featuring JWT authentication, real-time messaging, typing indicators, and read receipts.
<<<<<<< HEAD
=======
- Authentication: JWT-based register/login system
- Real-time Messaging: Instant message delivery using Socket.IO
- User Management: View all users and start conversations
- Typing Indicators: See when someone is typing
- Online/Offline Status: Track user presence
- Message Receipts: Delivery and read confirmations
- Persistent Storage: Messages stored in MongoDB
50d9c21 (80% done)
- Frontend: React Native with Expo
- Backend: Node.js, Express.js, Socket.IO
- Database: MongoDB with Mongoose
- Authentication: JWT tokens
- Node.js (v14 or higher)
- MongoDB running locally or MongoDB Atlas connection
- Expo CLI (
npm install -g @expo/cli)
cd backend
npm install
npm startThe backend will run on http://localhost:5000
cd app-mobile
npm install
npm startNote: Environment files (.env) are already configured for local development. If testing on a physical device, update the IP address in app-mobile/.env.
- Register new users through the mobile app
- Start chatting with real-time messaging
- Test typing indicators and read receipts
For testing purposes, you can create these sample users via the registration endpoint:
User 1:
- Username:
john_doe - Email:
john@example.com - Password:
password123
User 2:
- Username:
jane_smith - Email:
jane@example.com - Password:
password123
User 3:
- Username:
bob_wilson - Email:
bob@example.com - Password:
password123
POST /api/v1/auth/register- User registrationPOST /api/v1/auth/login- User loginGET /api/v1/auth/logout- User logoutGET /api/v1/auth/profile- Get logged-in user profile
GET /api/v1/users- Get all usersGET /api/v1/users/:id- Get specific user
GET /api/v1/conversations/:id/messages- Get conversation messages
GET /api/v1/chats- Get user's chatsPOST /api/v1/chats/private- Create private chatPOST /api/v1/chats/group- Create group chat
POST /api/v1/messages- Send messageGET /api/v1/messages/chat/:chatId- Get chat messages
addUser- Join with user IDmessage:send- Send new messagetyping:start- Start typing indicatortyping:stop- Stop typing indicatormessage:read- Mark message as readjoinChat- Join chat roomleaveChat- Leave chat room
message:new- Receive new messagemessage:delivered- Message delivery confirmationmessage:read- Message read receipttyping:start- User started typingtyping:stop- User stopped typinguserOnline- User came onlineuserOffline- User went offlinegetUsers- Updated online users list
chat-app/
├── backend/ # Node.js backend
│ ├── src/
│ │ ├── controllers/ # Route controllers
│ │ ├── models/ # MongoDB models
│ │ ├── routes/ # API routes
│ │ ├── middlewares/ # Custom middleware
│ │ ├── utils/ # Utility functions
│ │ └── config/ # Database config
│ ├── server.js # Server entry point
│ └── package.json
└── app-mobile/ # React Native app
├── app/ # App screens
├── components/ # Reusable components
├── constants/ # App constants
└── package.json
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
50d9c21 (80% done)