Skip to content

Avik-creator/peerFileShare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

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

Repository files navigation

🌐 PeerShare

A modern, secure peer-to-peer file sharing and video calling application built with Next.js and WebRTC technology. Share files instantly and make HD video calls without any servers storing your data.

PeerShareImage

PeerShare Demo Next.js TypeScript

✨ Features

πŸ”„ Peer-to-Peer File Sharing

  • Instant file transfer - Share files of any size directly between devices
  • No file size limits - Transfer large files without server restrictions
  • Automatic downloads - Files are automatically downloaded when received
  • Real-time progress - See file transfer status in real-time

πŸ“Ή HD Video Calling

  • High-quality video calls - Crystal clear video communication
  • Audio/Video controls - Toggle camera and microphone on/off
  • Responsive interface - Works seamlessly on desktop and mobile
  • Caller identification - See who's calling with user names

πŸ’¬ Real-time Chat

  • Instant messaging - Send messages in real-time during connections
  • Message history - Keep track of your conversation
  • File sharing notifications - Get notified when files are shared
  • Beautiful UI - Modern, gradient-based chat interface

πŸ”’ Security & Privacy

  • End-to-end encrypted - All communications are encrypted
  • No server storage - Files never touch our servers
  • Direct peer connections - Data flows directly between devices
  • Session-based - Connection codes expire when you refresh

πŸ“± Social Features

  • Twitter sharing - Share your PeerShare experience on Twitter
  • Success celebrations - Share successful file transfers with friends
  • Social promotion - Help spread the word about secure P2P sharing

πŸš€ Technologies Used

πŸƒβ€β™‚οΈ Quick Start

Prerequisites

  • Node.js (v18 or higher)
  • npm, yarn, pnpm, or bun

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/peershare.git
    cd peershare
  2. Install dependencies

    npm install
    # or
    yarn install
    # or
    pnpm install
    # or
    bun install
  3. Start the development server

    npm run dev
    # or
    yarn dev
    # or
    pnpm dev
    # or
    bun dev
  4. Open your browser

    Navigate to http://localhost:3000 to see PeerShare in action!

    Or visit the live demo at peershare.avikmukherjee.me

πŸ“– How to Use

πŸ”— Connecting with Someone

  1. Enter your name when you first visit the app
  2. Share your connection code - Copy the unique code displayed on your screen
  3. Connect to others - Enter someone else's connection code to connect
  4. Start sharing! - Once connected, you can chat, share files, and make video calls

πŸ“ Sharing Files

  1. Click the "Share File" button
  2. Select any file from your device
  3. The file will be instantly sent to the connected person
  4. They'll receive a notification and the file will download automatically

πŸ“Ή Making Video Calls

  1. Click "Start Video Call" to initiate a call
  2. The other person will see an incoming call notification with your name
  3. They can Accept or Decline the call
  4. During the call, you can:
    • Toggle your camera on/off
    • Mute/unmute your microphone
    • End the call anytime

πŸ’¬ Chatting

  • Type messages in the chat box and press Enter to send
  • See real-time message history
  • Get notifications when files are shared
  • All messages are displayed with timestamps and sender names
  • Share your experience on Twitter with built-in social features

πŸ“ Project Structure

fileshare/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ chat/
β”‚   β”‚   β”‚   └── page.tsx          # Main chat application
β”‚   β”‚   β”œβ”€β”€ globals.css           # Global styles
β”‚   β”‚   β”œβ”€β”€ layout.tsx            # Root layout
β”‚   β”‚   └── page.tsx              # Home page
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── ui/                   # Reusable UI components
β”‚   β”‚       β”œβ”€β”€ alert.tsx
β”‚   β”‚       β”œβ”€β”€ badge.tsx
β”‚   β”‚       β”œβ”€β”€ button.tsx
β”‚   β”‚       β”œβ”€β”€ card.tsx
β”‚   β”‚       β”œβ”€β”€ input.tsx
β”‚   β”‚       β”œβ”€β”€ scroll-area.tsx
β”‚   β”‚       β”œβ”€β”€ separator.tsx
β”‚   β”‚       └── sonner.tsx
β”‚   └── lib/
β”‚       └── utils.ts              # Utility functions
β”œβ”€β”€ public/                       # Static assets
β”œβ”€β”€ package.json                  # Dependencies and scripts
β”œβ”€β”€ tailwind.config.js           # Tailwind configuration
β”œβ”€β”€ tsconfig.json                # TypeScript configuration
└── next.config.ts               # Next.js configuration

πŸ”§ Available Scripts

# Development
npm run dev          # Start development server

# Production
npm run build        # Build for production
npm run start        # Start production server

# Code Quality
npm run lint         # Run ESLint

🌍 Deployment

Deploy on Vercel (Recommended)

The easiest way to deploy PeerShare is using Vercel:

  1. Push your code to GitHub
  2. Connect your repository to Vercel
  3. Deploy with one click!

Live Example: peershare.avikmukherjee.me (deployed on Vercel)

Deploy with Vercel

Deploy on Netlify

  1. Build the project: npm run build
  2. Deploy the out/ folder to Netlify

Self-Hosting

  1. Build the project: npm run build
  2. Start the server: npm run start
  3. Access at http://localhost:3000

πŸ› οΈ Customization

Themes and Colors

The app uses Tailwind CSS with a custom color scheme. You can modify colors in:

  • tailwind.config.js - Global theme configuration
  • src/app/globals.css - CSS custom properties

UI Components

All UI components are built with Radix UI and can be customized in the src/components/ui/ directory.

πŸ› Troubleshooting

Common Issues

Connection fails:

  • Check if both users are on the same network type (both on WiFi or both on mobile data works better)
  • Try refreshing the page to get new connection codes
  • Ensure both browsers support WebRTC (most modern browsers do)

Video call not working:

  • Grant camera and microphone permissions when prompted
  • Check if other applications are using your camera
  • Try using a different browser (Chrome/Firefox recommended)

Files not downloading:

  • Check browser download settings
  • Ensure pop-ups are allowed for the site
  • Try with a smaller file first

🀝 Contributing

We welcome contributions! Here's how you can help:

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

Development Guidelines

  • Follow the existing code style
  • Add TypeScript types for new features
  • Test your changes thoroughly
  • Update documentation as needed

πŸ™ Acknowledgments

πŸ“ž Support

If you have any questions or run into issues:


Made with ❀️ for secure, private file sharing
No servers. No tracking. Just pure peer-to-peer connection.

🌐 Try PeerShare Now | 🐦 Share on Twitter

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published