Skip to content
/ p2pchat Public

A beautiful, feature-rich peer-to-peer chat application built with React Native and Expo. Connect with nearby devices using Bluetooth and WiFi Direct for seamless local communication without internet dependency.

Notifications You must be signed in to change notification settings

inertz/p2pchat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

P2P Chat

A beautiful, feature-rich peer-to-peer chat application built with React Native and Expo. Connect with nearby devices using Bluetooth and WiFi Direct for seamless local communication without internet dependency.

P2P Chat

โœจ Features

๐Ÿ”— Multi-Protocol Connectivity

  • Bluetooth Low Energy - Connect to nearby devices via Bluetooth
  • WiFi Direct - High-speed local network connections
  • Auto-discovery - Automatically find and connect to available devices
  • Signal strength monitoring - Real-time connection quality indicators

๐Ÿ’ฌ Rich Messaging Experience

  • Real-time messaging - Instant message delivery with status indicators
  • Message status tracking - Sending, sent, delivered, and read receipts
  • Direct & Group chats - One-on-one conversations and group discussions
  • Unread message counters - Never miss important messages
  • Message history - Persistent chat history across sessions

๐ŸŽจ Beautiful Design

  • iOS-inspired interface - Clean, modern design following Apple's design principles
  • Smooth animations - Delightful micro-interactions and transitions
  • Custom splash screen - Branded 3-second animated splash screen
  • Dark/Light mode ready - Adaptive interface design
  • Responsive layout - Optimized for all screen sizes

๐Ÿ›ก๏ธ Privacy & Security

  • Local-only communication - No data sent to external servers
  • Encrypted connections - Secure peer-to-peer communication
  • No internet required - Works completely offline
  • Privacy-first approach - Your conversations stay on your devices

๐Ÿ“ฑ Screenshots

Chats Discover Contacts Settings
Chats Discover Contacts Settings

๐Ÿš€ Quick Start

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Expo CLI (npm install -g @expo/cli)
  • iOS Simulator (for iOS development)
  • Android Studio (for Android development)

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/p2p-chat.git
    cd p2p-chat
  2. Install dependencies

    npm install
  3. Start the development server

    npm run dev
  4. Run on your device

    • iOS: Press i to open iOS Simulator
    • Android: Press a to open Android Emulator
    • Web: Press w to open in web browser
    • Physical device: Scan QR code with Expo Go app

๐Ÿ—๏ธ Project Structure

p2p-chat/
โ”œโ”€โ”€ app/                    # App routes (Expo Router)
โ”‚   โ”œโ”€โ”€ (tabs)/            # Tab-based navigation
โ”‚   โ”‚   โ”œโ”€โ”€ index.tsx      # Chats tab
โ”‚   โ”‚   โ”œโ”€โ”€ contacts.tsx   # Contacts tab
โ”‚   โ”‚   โ”œโ”€โ”€ discover.tsx   # Device discovery tab
โ”‚   โ”‚   โ””โ”€โ”€ settings.tsx   # Settings tab
โ”‚   โ”œโ”€โ”€ chat/[id].tsx      # Individual chat screen
โ”‚   โ””โ”€โ”€ _layout.tsx        # Root layout
โ”œโ”€โ”€ components/            # Reusable UI components
โ”‚   โ”œโ”€โ”€ ChatListItem.tsx   # Chat room list item
โ”‚   โ”œโ”€โ”€ ContactListItem.tsx # Contact list item
โ”‚   โ”œโ”€โ”€ DeviceListItem.tsx # Device discovery item
โ”‚   โ”œโ”€โ”€ MessageBubble.tsx  # Chat message bubble
โ”‚   โ””โ”€โ”€ SplashScreen.tsx   # Custom splash screen
โ”œโ”€โ”€ services/              # Business logic
โ”‚   โ”œโ”€โ”€ ChatService.ts     # Chat management
โ”‚   โ””โ”€โ”€ ConnectionService.ts # P2P connections
โ”œโ”€โ”€ types/                 # TypeScript definitions
โ”‚   โ”œโ”€โ”€ chat.ts           # Chat-related types
โ”‚   โ””โ”€โ”€ env.d.ts          # Environment variables
โ””โ”€โ”€ hooks/                # Custom React hooks
    โ””โ”€โ”€ useFrameworkReady.ts

๐Ÿ”ง Configuration

Environment Variables

Create a .env file in the root directory:

EXPO_PUBLIC_API_URL=https://your-api-url.com
EXPO_PUBLIC_STUN_SERVER=stun:stun.l.google.com:19302

App Configuration

Update app.json for your specific needs:

{
  "expo": {
    "name": "Your P2P Chat",
    "slug": "your-p2p-chat",
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "scheme": "yourapp"
  }
}

๐Ÿ› ๏ธ Development

Available Scripts

  • npm run dev - Start development server
  • npm run build:web - Build for web deployment
  • npm run lint - Run ESLint

Key Technologies

  • React Native - Cross-platform mobile development
  • Expo Router - File-based navigation
  • TypeScript - Type-safe development
  • React Native Reanimated - Smooth animations
  • Lucide React Native - Beautiful icons
  • Expo Google Fonts - Custom typography

Architecture Patterns

  • Service Layer - Separation of business logic from UI
  • Observer Pattern - Real-time updates using listeners
  • Singleton Pattern - Shared service instances
  • Component Composition - Reusable UI components

๐Ÿ“ฆ Building for Production

Web Deployment

npm run build:web

Mobile App Stores

  1. Create a development build

    expo install expo-dev-client
    expo run:ios
    expo run:android
  2. Build for app stores

    eas build --platform all
  3. Submit to stores

    eas submit --platform all

๐Ÿ”ฎ Roadmap

Upcoming Features

  • File Sharing - Send images, documents, and media
  • Voice Messages - Record and send audio messages
  • Message Encryption - End-to-end encryption for all messages
  • Group Management - Create and manage group chats
  • Message Search - Find messages across all conversations
  • Custom Themes - Personalize the app appearance
  • Message Reactions - React to messages with emojis
  • Typing Indicators - See when someone is typing
  • Message Forwarding - Forward messages between chats
  • Backup & Restore - Export and import chat history

Technical Improvements

  • Native Modules - Implement actual Bluetooth/WiFi Direct APIs
  • WebRTC Integration - Real peer-to-peer communication
  • Push Notifications - Background message notifications
  • Performance Optimization - Optimize for large message histories
  • Offline Support - Enhanced offline capabilities
  • Cross-platform Sync - Sync across multiple devices

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Make your changes
  4. Run tests: npm test
  5. Commit your changes: git commit -m 'Add amazing feature'
  6. Push to the branch: git push origin feature/amazing-feature
  7. Open a Pull Request

Code Style

  • Use TypeScript for all new code
  • Follow the existing code style
  • Add tests for new features
  • Update documentation as needed

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Expo Team - For the amazing development platform
  • React Native Community - For the robust ecosystem
  • Lucide Icons - For the beautiful icon set
  • Pexels - For the stunning stock photos

๐Ÿ“ž Support


Made with โค๏ธ by the P2P Chat Team

โญ Star us on GitHub โ€ข ๐Ÿฆ Follow on Twitter โ€ข ๐ŸŒ Visit our website

About

A beautiful, feature-rich peer-to-peer chat application built with React Native and Expo. Connect with nearby devices using Bluetooth and WiFi Direct for seamless local communication without internet dependency.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published