A modern real-time chat application built with React, TypeScript, Firebase Realtime Database, and Firebase Storage, featuring a beautiful sky blue and white design aesthetic with instant messaging, file sharing, and seamless real-time communication.
This application follows a clean architecture pattern with clear separation of concerns:
- Layout Components: Navigation, Sidebar
- Chat Components: ChatWindow, MessageBubble
- Auth Components: AuthScreen
- Common Components: LoadingSpinner, ErrorBoundary
- Custom Hooks: useAuth, useChat
- Type Definitions: User, Message, Conversation, FriendRequest
- Business Logic: State management and data flow
- Firebase Authentication: Google OAuth integration
- Firebase Realtime Database: Real-time message synchronization
- Firebase Storage: File and media storage
- API Abstractions: Clean interfaces for external services
- Primary: Sky Blue (#87CEEB) with extended palette
- Secondary: Neutral grays for text and backgrounds
- Accent: Success, warning, and error states
- Clean, modern font hierarchy
- Proper line spacing (150% body, 120% headings)
- Maximum 3 font weights
- Glass-morphism effects with backdrop blur
- Smooth animations and micro-interactions
- Responsive design with mobile-first approach
- 8px spacing system for consistency
TalkWave leverages the full power of Firebase services to deliver a seamless real-time chat experience:
- Google Sign-in: Secure OAuth2 authentication
- User Session Management: Persistent login state
- Profile Synchronization: Automatic user data updates
- Security Rules: Protected user authentication flow
- Real-time Messaging: Instant message delivery and synchronization
- Live User Status: Online/offline presence detection
- Message Threading: Conversation-based message organization
- Offline Support: Message queuing when connection is lost
- Real-time Listeners: Live updates without polling
- Media Sharing: Image, video, and document upload
- File Security: User-based access control
- Progressive Upload: Chunked file transfer with progress
- Automatic Compression: Optimized media delivery
- CDN Distribution: Global content delivery network
{
"users": {
"{userId}": {
"uid": "string",
"email": "string",
"displayName": "string",
"photoURL": "string",
"isOnline": true,
"lastSeen": 1692000000000,
"createdAt": 1692000000000,
"status": "Available | Busy | Away"
}
},
"conversations": {
"{conversationId}": {
"participants": ["{userId1}", "{userId2}"],
"lastMessage": {
"content": "string",
"senderId": "string",
"timestamp": 1692000000000,
"type": "text | image | file"
},
"createdAt": 1692000000000,
"isGroup": false,
"groupName": "string",
"groupPhoto": "string"
}
},
"messages": {
"{conversationId}": {
"{messageId}": {
"senderId": "string",
"content": "string",
"timestamp": 1692000000000,
"type": "text | image | file | audio",
"fileUrl": "string",
"fileName": "string",
"fileSize": 1024,
"readBy": {
"{userId}": 1692000000000
},
"reactions": {
"{userId}": "👍 | ❤️ | 😂 | 😮 | 😢 | 😡"
},
"edited": true,
"editedAt": 1692000000000
}
}
},
"friendRequests": {
"{requestId}": {
"fromUserId": "string",
"toUserId": "string",
"status": "pending | accepted | rejected",
"createdAt": 1692000000000,
"message": "string"
}
},
"userPresence": {
"{userId}": {
"isOnline": true,
"lastSeen": 1692000000000,
"currentlyTyping": ["{conversationId}"]
}
},
"notifications": {
"{userId}": {
"{notificationId}": {
"type": "message | friendRequest | groupInvite",
"from": "string",
"content": "string",
"conversationId": "string",
"isRead": false,
"createdAt": 1692000000000
}
}
}
}/users/{userId}/
├── profile/
│ └── avatar.jpg
├── media/
│ ├── images/
│ ├── videos/
│ ├── documents/
│ └── audio/
└── temp/
/conversations/{conversationId}/
├── images/
├── videos/
├── documents/
└── audio/
- Instant Messaging: Real-time message delivery with Firebase Realtime Database
- Live Typing Indicators: See when users are typing in real-time
- Online Presence: Real-time online/offline status updates
- Message Synchronization: Seamless cross-device message sync
- Offline Support: Message queuing and delivery when back online
- Real-time Notifications: Instant push notifications for new messages
- Text Messaging: Rich text with emoji support
- Media Sharing: Image, video, and document upload via Firebase Storage
- File Management: Secure file storage with progress indicators
- Message Reactions: React to messages with emojis
- Message Editing: Edit sent messages with edit history
- Read Receipts: See when messages are delivered and read
- Friend System: Send and manage friend requests
- User Search: Find and connect with other users
- Beautiful Sky Blue Theme: Professional gradient design
- Responsive Design: Mobile-first responsive layout
- Smooth Animations: Polished micro-interactions and transitions
- Glass Morphism: Modern glass effects with backdrop blur
- Loading States: Professional loading indicators
- Error Handling: Graceful error management with user feedback
- Accessibility: WCAG compliant color contrasts and navigation
- Dark/Light Mode: Toggle between theme preferences
- Node.js 18+ and npm/yarn
- Firebase project with the following services enabled:
- Authentication (Google provider)
- Realtime Database
- Storage
- Hosting (optional)
-
Create Firebase Project
- Visit Firebase Console
- Create new project or use existing one
- Enable Google Analytics (optional)
-
Enable Authentication
- Go to Authentication > Sign-in method
- Enable Google sign-in provider
- Add your domain to authorized domains
-
Setup Realtime Database
- Go to Realtime Database
- Create database in test mode (configure security rules later)
- Choose your preferred region
-
Configure Storage
- Go to Storage
- Set up Cloud Storage bucket
- Configure security rules for file uploads
-
Get Configuration
- Go to Project settings > General
- Add web app and copy configuration
# Clone the repository
git clone <repository-url>
cd TalkWave
# Install dependencies
npm install
# Create environment file
cp .env.example .env.local
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run previewCreate a .env.local file in the root directory:
# Firebase Configuration
VITE_FIREBASE_API_KEY=your-api-key
VITE_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
VITE_FIREBASE_DATABASE_URL=https://your-project-default-rtdb.firebaseio.com/
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=your-sender-id
VITE_FIREBASE_APP_ID=your-app-id
VITE_FIREBASE_MEASUREMENT_ID=your-measurement-id
# Application Configuration
VITE_APP_NAME=TalkWave
VITE_APP_VERSION=1.0.0
VITE_APP_ENVIRONMENT=development{
"rules": {
"users": {
"$uid": {
".read": "$uid === auth.uid || root.child('users').child(auth.uid).child('friends').child($uid).exists()",
".write": "$uid === auth.uid"
}
},
"conversations": {
"$conversationId": {
".read": "root.child('conversations').child($conversationId).child('participants').child(auth.uid).exists()",
".write": "root.child('conversations').child($conversationId).child('participants').child(auth.uid).exists()"
}
},
"messages": {
"$conversationId": {
".read": "root.child('conversations').child($conversationId).child('participants').child(auth.uid).exists()",
"$messageId": {
".write": "auth.uid === newData.child('senderId').val() && root.child('conversations').child($conversationId).child('participants').child(auth.uid).exists()"
}
}
},
"friendRequests": {
".read": "auth != null",
"$requestId": {
".write": "auth.uid === newData.child('fromUserId').val() || auth.uid === newData.child('toUserId').val()"
}
}
}
}rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /users/{userId}/{allPaths=**} {
allow read, write: if request.auth != null && request.auth.uid == userId;
}
match /conversations/{conversationId}/{allPaths=**} {
allow read, write: if request.auth != null &&
exists(/databases/$(database)/documents/conversations/$(conversationId)) &&
request.auth.uid in resource.data.participants;
}
}
}src/
├── components/ # React components
│ ├── auth/ # Authentication components
│ ├── chat/ # Chat-related components
│ ├── common/ # Reusable components
│ └── layout/ # Layout components
├── hooks/ # Custom React hooks
├── services/ # External service integrations
├── types/ # TypeScript type definitions
├── constants/ # Application constants
└── utils/ # Utility functions
- Firebase Realtime Database: WebSocket-based real-time synchronization
- Event-driven Updates: Reactive UI updates based on database changes
- Optimistic UI: Immediate local updates with server confirmation
- Connection Management: Automatic reconnection and offline handling
- Presence System: Real-time user online/offline status tracking
- React Hooks: Local component state management
- Custom Hooks: Business logic abstraction (useAuth, useChat, useRealtime)
- Context API: Global application state (user, theme, notifications)
- Real-time Listeners: Firebase database event subscriptions
- Caching Strategy: Efficient data fetching and local storage
- Progressive Upload: Chunked file transfer with real-time progress
- Image Optimization: Automatic compression and format conversion
- File Type Validation: Security-focused file type restrictions
- Storage Organization: Structured file hierarchy in Firebase Storage
- CDN Integration: Global content delivery for media files
- Component Memoization: React.memo for expensive renders
- Virtual Scrolling: Efficient message list rendering
- Lazy Loading: Code splitting for optimal bundle size
- Image Lazy Loading: Progressive image loading
- Database Indexing: Optimized query performance
- Connection Pooling: Efficient Firebase connection management
- Firebase Security Rules: Database and storage access control
- Input Sanitization: XSS protection for user content
- File Upload Security: Malware scanning and type validation
- Authentication Tokens: Secure JWT token management
- Rate Limiting: API call throttling and abuse prevention
- Firebase Realtime Database integration
- User authentication with Google OAuth
- Real-time message synchronization
- Basic chat interface with sky blue theme
- File upload system with Firebase Storage
- Friend request system implementation
- Online presence and typing indicators
- Message read receipts
- Message reactions and emoji support
- Message editing and deletion
- Image and file sharing optimization
- Audio message recording and playback
- Group chat functionality
- Advanced message search
- Message threading and replies
- Push notifications with Firebase Cloud Messaging
- Voice calling integration (WebRTC)
- Video calling support
- Screen sharing capabilities
- Live location sharing
- Message encryption (end-to-end)
- Advanced presence states (Away, Busy, DND)
- Custom themes and personalization
- Advanced chat settings and preferences
- Message backup and export
- Keyboard shortcuts and accessibility
- Progressive Web App (PWA) features
- Desktop application (Electron)
- Mobile app (React Native)
- Organization and workspace management
- Admin dashboard and analytics
- Advanced moderation tools
- API for third-party integrations
- Single Sign-On (SSO) support
- Compliance and audit logging
- High availability and load balancing
We welcome contributions to TalkWave! Please follow these guidelines:
- Architecture: Follow the established clean architecture patterns
- Code Style: Use ESLint and Prettier configurations
- TypeScript: Maintain strict type safety with proper interfaces
- Testing: Include unit tests for new features and components
- Documentation: Update README and code comments as needed
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes following the coding standards
- Add tests for new functionality
- Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open a Pull Request with detailed description
- Follow React and TypeScript best practices
- Implement proper error handling and loading states
- Ensure responsive design across all devices
- Maintain consistent UI/UX with the sky blue theme
- Optimize for Firebase Realtime Database performance
- Message Delivery: < 100ms average latency
- File Upload: Progressive with real-time progress
- Database Queries: Optimized with proper indexing
- Connection Handling: Automatic reconnection in < 5s
- Initial Load: < 500KB gzipped
- Code Splitting: Lazy-loaded routes and components
- Image Optimization: WebP format with fallbacks
- Caching Strategy: Efficient browser and Firebase caching
- Authentication: Secure Google OAuth integration
- Database Security: Firebase security rules implementation
- File Security: Validated uploads with malware scanning
- Privacy: GDPR-compliant data handling
- Input sanitization and XSS protection
- Secure file upload with type validation
- Rate limiting for API calls
- Encrypted data transmission (HTTPS/WSS)
- Modern Browsers: Chrome 90+, Firefox 88+, Safari 14+, Edge 90+
- Mobile: iOS Safari 14+, Android Chrome 90+
- Progressive Web App: Full PWA support for offline functionality
- WebRTC: Real-time communication for voice/video features
MIT License - see LICENSE file for details.
Built with ❤️ using React, TypeScript, and Firebase
For questions or support, please open an issue or contact the development team.