# P2P Poll App A peer-to-peer polling application where users can create polls, add options, and vote in real-time without a central server. ## Features - **Real-time P2P voting** using WebRTC via PeerJS - **Dynamic option management** - add/remove options during polling - **Duplicate vote prevention** - one vote per user - **Automatic data synchronization** across all connected peers - **Local storage persistence** for poll recovery - **Responsive design** works on desktop and mobile - **No server required** - uses PeerJS free signaling service ## How to Use 1. **Open the app** in your browser (open `index.html`) 2. **First user (Host)**: Leave the Peer ID field empty and click "Connect to Host" 3. **Copy your Peer ID** using the "Copy Your Peer ID" button 4. **Share your Peer ID** with other users (via chat, email, etc.) 5. **Other users**: Paste the host's Peer ID and click "Connect to Host" 6. **Create a poll** with question and options 7. **Vote** by clicking on options (one vote per person) 8. **Watch results** update in real-time across all devices ## Technical Details - **P2P Library**: PeerJS (WebRTC-based) - **Frontend**: Vanilla JavaScript with modern CSS - **Data Sync**: Custom conflict resolution for concurrent operations - **Storage**: localStorage for basic persistence - **Network**: Full mesh topology where each peer connects to all others ## File Structure ``` ├── index.html # Main application ├── css/ │ └── styles.css # Application styling └── js/ ├── app.js # Main application logic ├── peer-manager.js # P2P connection handling ├── poll-manager.js # Poll data and sync logic └── ui-controller.js # UI interactions ``` ## Browser Support Requires modern browsers with WebRTC support: - Chrome 23+ - Firefox 22+ - Safari 11+ - Edge 79+ ## Development Simply open `index.html` in a browser - no build process required. For testing with multiple peers, open the app in multiple browser tabs or windows.