A modern WebRTC-based random video chat application built with React, TypeScript, and WebSocket STOMP.
- Random Video Chat - Connect with random people from around the world via WebRTC
- Match Modes - Choose from different chat modes: Random, English Practice, Gaming, Co-working, Travel, Music, Movies & Series, Food, Study
- Text Chat - Send messages during video calls with real-time delivery
- Icebreakers - Get conversation starters to help break the ice
- Friends System - Add people you like to your friends list (mutual likes)
- Direct Messaging - Chat with friends anytime
- Friend Video Calls - Call your friends directly (coming soon)
- Country Selection - Set your location for better matching
- Language Preferences - Choose languages you want to chat in
- Interest Tags - Select topics you're interested in
- Gender Preferences - Choose preferred genders to chat with
- Same Country Preference - Prioritize matches from your country
- Real-time Notifications - Get notified about new friends, messages, and updates
- Chat History - View your past sessions and feedback
- Session Feedback - Like or dislike chats to improve matching
- Reporting System - Report inappropriate behavior with reasons
- User Banning - Automatic ban handling for violations
- Safe Environment - Community guidelines enforcement
- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS + shadcn/ui
- State Management: Zustand
- Authentication: Google OAuth 2.0
- Real-time Communication: WebSocket STOMP
- Video/Audio: WebRTC (RTCPeerConnection)
- HTTP Client: Axios
- Date Formatting: date-fns
src/
├── components/ # UI components
│ ├── ui/ # shadcn/ui components
│ └── Layout.tsx # Main layout with navigation
├── pages/ # Page components
│ ├── Login.tsx # Google OAuth login
│ ├── Home.tsx # Match mode selector
│ ├── Chat.tsx # Video chat interface
│ ├── Friends.tsx # Friends list
│ ├── DirectMessage.tsx # DM with friend
│ ├── Preferences.tsx # User preferences
│ ├── Notifications.tsx # Notification center
│ ├── History.tsx # Chat history
│ └── Banned.tsx # Ban page
├── hooks/ # Custom React hooks
│ ├── useAuth.ts # Authentication hook
│ ├── useMedia.ts # Camera/microphone hook
│ └── useWebRTC.ts # WebRTC hook
├── services/ # API services
│ ├── api.ts # Axios instance
│ ├── authService.ts # Auth API
│ ├── friendsService.ts # Friends API
│ ├── notificationService.ts # Notifications API
│ ├── reportService.ts # Reporting API
│ └── stompService.ts # WebSocket STOMP service
├── stores/ # Zustand stores
│ ├── authStore.ts # Auth state
│ ├── chatStore.ts # Chat state
│ ├── friendsStore.ts # Friends state
│ ├── notificationStore.ts # Notifications state
│ ├── preferencesStore.ts # Preferences state
│ └── callStore.ts # Call state
├── types/ # TypeScript types
│ └── index.ts # All type definitions
└── lib/ # Utilities
└── utils.ts # Helper functions
- Node.js 18+
- npm or yarn
- Backend API running (see api.yml)
- Clone the repository:
git clone <repo-url>
cd raibu-frontend- Install dependencies:
npm install- Create environment file:
cp .env.example .env- Update
.envwith your configuration:
VITE_API_URL=http://localhost:8080
VITE_WS_URL=ws://localhost:8080/ws
VITE_GOOGLE_CLIENT_ID=your_google_client_id- Start the development server:
npm run dev- Open http://localhost:5173 in your browser
npm run buildThe built files will be in the dist/ directory.
The frontend integrates with the Raibu backend API as defined in api.yml:
GET /me- Get current userPUT /me/country- Update countryGET /me/preferences- Get preferencesPUT /me/preferences- Update preferences
GET /sessions/me- Get user's sessionsGET /sessions/{id}/messages- Get session messagesPOST /sessions/{id}/feedback- Submit feedback
GET /friends- List friendsGET /friends/{id}/messages- Get DM historyPOST /friends/{id}/messages- Send DM
GET /notifications- List notificationsPUT /notifications/{id}/read- Mark as read
POST /reports- Create report
- Connect to
/ws - Subscribe to
/user/queue/match- Match notifications - Subscribe to
/user/queue/signal- WebRTC signaling - Subscribe to
/user/queue/chat- Chat messages - Subscribe to
/user/queue/notifications- Real-time notifications - Subscribe to
/user/queue/dm- Direct messages - Send to
/app/search- Start matchmaking - Send to
/app/signal- WebRTC signaling - Send to
/app/chat- Send chat message - Send to
/app/dm- Send direct message
- User clicks "Start Chatting"
- Browser requests camera/microphone permissions
- Frontend sends
/app/searchvia WebSocket - Backend matches users and sends
MATCH_FOUND - Users exchange WebRTC offers/answers via
/app/signal - ICE candidates are exchanged
- Peer-to-peer connection established
- Video/audio streams flow directly between peers
| Variable | Description | Default |
|---|---|---|
VITE_API_URL |
Backend API URL | http://localhost:8080 |
VITE_WS_URL |
WebSocket URL | ws://localhost:8080/ws |
VITE_GOOGLE_CLIENT_ID |
Google OAuth Client ID | - |
- Chrome 80+
- Firefox 75+
- Safari 14+
- Edge 80+
Requires WebRTC support and camera/microphone permissions.
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
MIT License - see LICENSE file for details
For support, email support@raibu.app or join our Discord server.
Built with ❤️ using React, TypeScript, and WebRTC