A modern, full-featured real-time chat application built with React Native (Expo) and Node.js.
- โ Email/password authentication with JWT
- โ User registration and login
- โ Secure password hashing with bcrypt
- โ Persistent sessions
- โ User profiles with display names and avatars
- โ Real-time one-to-one private chats
- โ Group chat support (backend ready)
- โ Message delivery status (sent โ / delivered โโ / read โโ)
- โ Typing indicators with animations
- โ Emoji support
- โ Message timestamps
- โ Chat history with pagination
- โ Auto-scroll to latest messages
- โ Dark/Light theme toggle with iOS-style colors
- โ Color-coded user avatars
- โ Online/offline status indicators
- โ User search by username or email
- โ Contact list management
- โ Pull-to-refresh chat list
- โ Unread message badges
- โ Smooth animations and transitions
- โ Loading states and error handling
- Node.js 18+ and npm
- MongoDB Atlas account (or local MongoDB)
- Expo CLI for mobile app development
- Android Studio (for Android) or Xcode (for iOS)
cd backend
npm install
# Create .env file with your credentials
cp .env.example .env
# Edit .env with your MongoDB URI and JWT secret
# Start server
npm startBackend will run on http://localhost:3000
cd frontend
npm install
# Start Expo development server
npm start
# Run on specific platform
npm run android # Android
npm run ios # iOS- Backend: https://chatflix-sjfr.onrender.com
- Status: โ Live and operational
- Version: 2.0.0
- MongoDB: Atlas Cloud Database
Frontend:
- React Native 0.72.6 with Expo SDK 49
- React Navigation v6 for routing
- Socket.io-client v4.6 for real-time communication
- Axios for REST API calls
- AsyncStorage for local data persistence
- Moment.js for date/time formatting
Backend:
- Node.js with Express.js
- Socket.io v4 for WebSocket connections
- MongoDB with Mongoose ODM
- JWT for authentication
- bcryptjs for password hashing
- CORS enabled for cross-origin requests
ChatFlix/
โโโ backend/
โ โโโ config/
โ โ โโโ database.js # MongoDB connection
โ โโโ controllers/
โ โ โโโ authController.js # Authentication logic
โ โ โโโ userController.js # User management
โ โ โโโ chatController.js # Chat room management
โ โ โโโ messageController.js # Message handling (V1)
โ โโโ middleware/
โ โ โโโ auth.js # JWT verification
โ โโโ models/
โ โ โโโ User.js # User schema (V1)
โ โ โโโ EnhancedUser.js # User schema with auth (V2)
โ โ โโโ ChatRoom.js # Chat room schema
โ โ โโโ Message.js # Message schema (V1)
โ โ โโโ EnhancedMessage.js # Message with status (V2)
โ โโโ routes/
โ โ โโโ authRoutes.js # Auth endpoints
โ โ โโโ userRoutes.js # User endpoints
โ โ โโโ chatRoutes.js # Chat endpoints
โ โ โโโ messageRoutes.js # Message endpoints (V1)
โ โโโ utils/
โ โ โโโ socketHandler.js # Socket.io event handlers
โ โโโ .env # Environment variables
โ โโโ server.js # Application entry point
โ โโโ package.json
โ
โโโ frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โ โโโ EnhancedMessageBubble.js # Message display with status
โ โ โ โโโ TypingIndicator.js # Typing animation
โ โ โ โโโ UserAvatar.js # Color-coded avatars
โ โ โโโ screens/
โ โ โ โโโ AuthScreen.js # Login/Signup
โ โ โ โโโ ChatListScreen.js # Conversation list
โ โ โ โโโ ChatRoomScreen.js # Chat interface
โ โ โ โโโ ContactsScreen.js # User search & contacts
โ โ โโโ services/
โ โ โ โโโ apiService.js # REST API integration
โ โ โ โโโ socketService.js # Socket.io client
โ โ โโโ utils/
โ โ โโโ config.js # App configuration
โ โ โโโ theme.js # Dark/Light themes
โ โโโ assets/ # Images and icons
โ โโโ App.js # Root component
โ โโโ app.json # Expo configuration
โ โโโ eas.json # EAS Build configuration
โ โโโ package.json
โ
โโโ DEPLOY_NOW.md # Deployment guide
โโโ README.md # This file
POST /api/auth/register # Register new user
POST /api/auth/login # Login user
GET /api/users/contacts # Get user's contacts
GET /api/users/search?query= # Search users
GET /api/chats/rooms # Get user's chat rooms
GET /api/chats/rooms/private/:userId # Get/create private room
POST /api/chats/rooms/group # Create group room
GET /api/chats/rooms/:roomId/messages # Get room messages
POST /api/chats/rooms/:roomId/messages # Send message (REST)
GET /health # Server status
'join:room' // Join a chat room
'leave:room' // Leave a chat room
'message:send' // Send a message
'typing:start' // User started typing
'typing:stop' // User stopped typing'message:new' // New message received
'typing:start' // Someone is typing
'typing:stop' // Typing stopped
'user:online' // User came online
'user:offline' // User went offline- Clean white/blue design
- High contrast for readability
- iOS-inspired colors
- Pure black background (#000000)
- iOS-style accent colors
- Reduced eye strain
- OLED-friendly
PORT=3000
MONGODB_URI=mongodb+srv://username:[email protected]/chatapp
JWT_SECRET=your_super_secret_key_here
JWT_EXPIRE=30d
NODE_ENV=productionEXPO_PUBLIC_API_URL=https://chatflix-sjfr.onrender.com
EXPO_PUBLIC_SOCKET_URL=https://chatflix-sjfr.onrender.comcd frontend
npx eas-cli@latest build --platform android --profile previewcd frontend
npx eas-cli@latest build --platform ios --profile previewBuild takes 10-15 minutes. Download link will be provided upon completion.
# Health check
curl https://chatflix-sjfr.onrender.com/health
# Register user
curl -X POST https://chatflix-sjfr.onrender.com/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"test","email":"[email protected]","password":"test123"}'
# Login
curl -X POST https://chatflix-sjfr.onrender.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email":"[email protected]","password":"test123"}'- Install APK on Android device
- Register a new account
- Login with credentials
- Search for other users
- Start a conversation
- Send messages and test real-time delivery
- Toggle dark/light mode
- Test typing indicators
See DEPLOY_NOW.md for detailed deployment instructions.
- Backend on Render: Connect GitHub, add environment variables, deploy
- Frontend APK: Run EAS build command, wait 10-15 minutes
- Test: Install APK and verify all features
- Cannot connect to MongoDB: Check MONGODB_URI format and credentials
- JWT errors: Ensure JWT_SECRET is set in environment variables
- Port in use: Change PORT in .env or kill process using port 3000
- Cannot connect to server: Verify API_URL in config.js
- Build fails: Delete node_modules and package-lock.json, reinstall
- Socket disconnects: Check CORS settings on backend
- Dependencies conflict: Use exact versions specified in package.json
- Full authentication system with JWT
- Room-based architecture (private & group chats)
- Enhanced UI with dark/light themes
- Typing indicators and message status
- User search and contacts
- Improved security and scalability
- Basic real-time chat
- Simple username-based login
- Global chat room
- Message persistence
This is a personal project, but suggestions and feedback are welcome!
This project is open source and available for learning purposes.
Mahesh Singh
- GitHub: @maheshsingh20
- Project: ChatFlix
- Built with React Native and Expo
- Real-time powered by Socket.io
- Database: MongoDB Atlas
- Deployed on Render
Status: โ Production Ready | Version: 2.0.0 | Last Updated: July 2026