A modern real-time chat application built with React Native, Expo, and Firebase.
- 🔐 Authentication: Email/password signup and login
- 💬 Real-time Chat: Instant messaging with Firebase Firestore
- 👤 User Avatars: Auto-generated avatars based on user email
- 📱 Cross-platform: Works on iOS, Android, and Web
- 🎨 Modern UI: Clean and intuitive design
- React Native with Expo
- Firebase (Authentication & Firestore)
- react-native-gifted-chat for chat UI
- TypeScript for type safety
- Expo Router for navigation
- Go to Firebase Console
- Create a new project or use an existing one
- Enable Authentication and Firestore Database
- In Authentication settings, enable Email/Password sign-in method
- Get your Firebase config from Project Settings > General > Your apps
- Replace the placeholder values in
firebase.config.js:
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-auth-domain",
projectId: "your-project-id",
storageBucket: "your-storage-bucket",
messagingSenderId: "your-messaging-sender-id",
appId: "your-app-id"
};Set up these Firestore security rules:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /messages/{messageId} {
allow read, write: if request.auth != null;
}
}
}# Install dependencies (already done)
npm install
# Start the development server
npm start
# Run on specific platform
npm run android
npm run ios
npm run webapp/
├── _layout.tsx # Root layout with auth flow
├── index.tsx # Entry point
├── login.tsx # Login/Signup screen
└── chat.tsx # Main chat interface
firebase.config.js # Firebase configuration
- First Time: Create an account with email/password
- Login: Sign in with your credentials
- Chat: Start messaging in the global chat room
- Logout: Use the sign out button in the chat header
- Private messaging
- User profiles
- Image/file sharing
- Push notifications
- Multiple chat rooms
- Message reactions
- Dark mode
- Make sure Firebase config is properly set up
- Check that Firestore rules allow authenticated users
- Ensure Authentication method is enabled in Firebase
- Clear Metro cache:
npx expo start --clear
Enjoy chatting! 🚀