Skip to content

NightfuryEquinn/RTC-Made-Simple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RTC-Made-Simple

A complete, production-ready WebRTC video calling and real-time chat solution for React Native and NestJS applications. Built with simplicity and extensibility in mind.

πŸš€ Features

  • βœ… WebRTC Video Calling - High-quality peer-to-peer video calls
  • βœ… Real-time Chat - Instant messaging with typing indicators
  • βœ… Room-based Communication - Multiple chat rooms and call sessions
  • βœ… Read Receipts - Track message read status
  • βœ… Message Management - Delete messages, mark as read
  • βœ… Call Overlay - Beautiful incoming call UI
  • βœ… TypeScript Support - Full type safety
  • βœ… Customizable - Extend with your own business logic
  • βœ… Production Ready - Battle-tested architecture

πŸ“¦ Packages

This monorepo contains two main packages that work together:

NestJS server module for video calling and chat functionality.

Installation:

npm install @nightfuryequinn/rtc-made-simple-server

Quick Start:

import { VideoCallModule, ChatModule } from '@nightfuryequinn/rtc-made-simple-server';

@Module({
  imports: [
    VideoCallModule.forRoot(),
    ChatModule.forRoot()
  ]
})
export class AppModule {}

πŸ“– Full Documentation

React Native components and hooks for video calling and chat interfaces.

Installation:

npm install @nightfuryequinn/rtc-made-simple-ui

Peer Dependencies:

npm install socket.io-client react-native-webrtc react-native-incall-manager zustand

Quick Start:

import { useVideoSocket, ChatWindow, CallOverlay } from '@nightfuryequinn/rtc-made-simple-ui';

// Video call
const { initiateCall, acceptCall, declineCall } = useVideoSocket({
  currentUser: 'user123',
  baseUrl: 'http://your-server.com'
});

// Chat
<ChatWindow
  userName="user123"
  roomName="general"
  baseUrl="http://your-server.com"
/>

πŸ“– Full Documentation

🎯 Example Application

Check out the complete React Native + NestJS example application in the RTC-Made-Simple-Example directory.

The example includes:

  • Backend (NestJS): Video call and chat server setup
  • Mobile (React Native + Expo): Complete mobile app with video calling and chat

Running the Example

  1. Start the Backend:
cd RTC-Made-Simple-Example/example-backend
npm install
npm run dev
  1. Start the Mobile App:
cd RTC-Made-Simple-Example/example-mobile
npm install
npm start

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     Client Applications                      β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”‚
β”‚  β”‚  Video Call UI   β”‚         β”‚    Chat UI       β”‚         β”‚
β”‚  β”‚  - CallOverlay   β”‚         β”‚  - ChatWindow    β”‚         β”‚
β”‚  β”‚  - VideoCallScreenβ”‚        β”‚  - MessageItem   β”‚         β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β”‚
β”‚           β”‚                             β”‚                    β”‚
β”‚           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β”‚
β”‚                      β”‚                                       β”‚
β”‚              @nightfuryequinn/                              β”‚
β”‚           rtc-made-simple-ui                                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ WebSocket + WebRTC
                       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚              @nightfuryequinn/                              β”‚
β”‚           rtc-made-simple-server                            β”‚
β”‚                      β”‚                                       β”‚
β”‚      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”                    β”‚
β”‚      β”‚                                 β”‚                    β”‚
β”‚  β”Œβ”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”            β”‚
β”‚  β”‚ VideoCall      β”‚        β”‚  Chat          β”‚             β”‚
β”‚  β”‚ Gateway        β”‚        β”‚  Gateway       β”‚             β”‚
β”‚  β”‚ - /call        β”‚        β”‚  - /chat       β”‚             β”‚
β”‚  β”‚ - WebRTC       β”‚        β”‚  - Messages    β”‚             β”‚
β”‚  β”‚ - Signaling    β”‚        β”‚  - Typing      β”‚             β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜             β”‚
β”‚                                                              β”‚
β”‚                    NestJS Server                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Technology Stack

Server

  • NestJS - Progressive Node.js framework
  • Socket.IO - Real-time bidirectional communication
  • WebRTC - Peer-to-peer video calling
  • TypeScript - Type-safe development

Client

  • React Native - Cross-platform mobile development
  • Expo - React Native toolchain
  • react-native-webrtc - WebRTC for React Native
  • Zustand - State management
  • TypeScript - Type-safe development

πŸ“± Platform Support

  • βœ… iOS
  • βœ… Android
  • βœ… Web (with modifications)

πŸ”§ Configuration

Video Call Configuration

Server Side:

VideoCallModule.forRoot({
  callbacks: {
    onCallCreated: async (callerName, receiverName) => {
      // Save to database, send push notification
    },
    onCallEnded: async (callerName, receiverName, status) => {
      // Update call history
    }
  }
})

Client Side:

<VideoCallScreen
  iceServers={[
    { urls: 'stun:stun.l.google.com:19302' },
    { urls: 'turn:your-turn-server.com:3478', username: 'user', credential: 'pass' }
  ]}
/>

Chat Configuration

Server Side:

ChatModule.forRoot({
  callbacks: {
    onMessageSent: async (sender, receiver, message, room, metadata) => {
      // Save to database, moderate content
    },
    onMessageRead: async (messageId, readBy) => {
      // Update read receipts
    }
  }
})

πŸ” Security Considerations

  1. Authentication: Implement proper user authentication before allowing connections
  2. Rate Limiting: Add rate limiting to prevent spam
  3. Content Moderation: Implement message filtering for chat
  4. TURN Servers: Use TURN servers for NAT traversal in production
  5. SSL/TLS: Always use HTTPS/WSS in production

🚨 Troubleshooting

Common Issues

1. Babel Configuration

Ensure your babel.config.js includes proper presets:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    // Add any required plugins
  ]
};

2. Android Permissions

Add required permissions to android/app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

3. iOS Permissions

Add to ios/YourApp/Info.plist:

<key>NSCameraUsageDescription</key>
<string>This app needs access to camera for video calls</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app needs access to microphone for video calls</string>

4. Dependency Versions

Ensure compatible versions:

{
  "socket.io-client": "^4.8.1",
  "react-native-webrtc": "^124.0.6",
  "react-native-incall-manager": "^4.2.1",
  "zustand": "^5.0.8"
}

5. Android Remote Stream Issues

If Android devices crash when remote stream is established:

  • Check WebRTC permissions
  • Ensure proper camera/microphone release
  • Update to latest react-native-webrtc version
  • Test on physical devices, not just emulators

πŸ“š API Documentation

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“„ License

MIT

πŸ”— Links

πŸ™ Acknowledgments

Built with ❀️ using:


Made with ❀️ by NightfuryEquinn