{"id":49592427,"url":"https://github.com/siyabuilds/chatduo","last_synced_at":"2026-05-04T01:38:29.886Z","repository":{"id":323737502,"uuid":"1094026561","full_name":"siyabuilds/chatduo","owner":"siyabuilds","description":"This is a two-way chat where users can send/receive messages without creating an account. Only an ID is needed and messages are temporarily stored and then get deleted after a certain period or when both users exit the room.","archived":false,"fork":false,"pushed_at":"2026-04-07T15:01:21.000Z","size":199,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-04T01:38:08.214Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://chatduo.samson.codes","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/siyabuilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-11T06:41:08.000Z","updated_at":"2026-04-07T15:01:31.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/siyabuilds/chatduo","commit_stats":null,"previous_names":["siyabuilds/chatduo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/siyabuilds/chatduo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fchatduo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fchatduo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fchatduo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fchatduo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/siyabuilds","download_url":"https://codeload.github.com/siyabuilds/chatduo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/siyabuilds%2Fchatduo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32591603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T22:12:39.696Z","status":"ssl_error","status_checked_at":"2026-05-03T22:09:10.534Z","response_time":103,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-04T01:38:29.178Z","updated_at":"2026-05-04T01:38:29.879Z","avatar_url":"https://github.com/siyabuilds.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ChatDuo\n\nA Next.js application that enables real-time chat synchronization across multiple devices. Watch your conversations update simultaneously on different browsers or devices!\n\n## ⚠️ Important Warning\n\n**DO NOT USE IN PRODUCTION!** This application uses in-memory storage and long polling to synchronize chat messages across devices. This implementation can still result in:\n\n- **High API call volumes at scale** (lower than fixed interval polling, but still request-heavy under many concurrent clients)\n- **Potentially high hosting costs** if deployed to production\n- **Rate limiting issues** with many active chats\n- **Poor scalability** compared to WebSockets/SSE\n\nThis is a **demonstration/development project only**. For production use, implement proper WebSocket connections, Server-Sent Events (SSE), or a real-time database solution instead.\n\n## 🛠️ Tools \u0026 Technologies Used\n\n- **[Next.js 16.0.1](https://nextjs.org/)** - React framework with App Router\n- **[React 19.2.0](https://react.dev/)** - UI library\n- **[TypeScript 5](https://www.typescriptlang.org/)** - Type safety\n- **[Tailwind CSS 4](https://tailwindcss.com/)** - Utility-first CSS framework\n- **[Lucide React](https://lucide.dev/)** - Icon library\n- **[SweetAlert2](https://sweetalert2.github.io/)** - Beautiful alert modals\n- **[Vercel Analytics](https://vercel.com/analytics)** - Web analytics\n\n## 📋 Prerequisites\n\nBefore you begin, ensure you have the following installed:\n\n- **Node.js** (v18 or higher recommended)\n- **npm** (comes with Node.js) or **yarn**\n\n## 🚀 Setup Steps\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/siyabuilds/chatduo.git\n   cd chatduo\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Run the development server**\n\n   ```bash\n   npm run dev\n   ```\n\n4. **Open in your browser**\n   Navigate to [http://localhost:3000](http://localhost:3000)\n\n## 📱 How to Use on Multiple Devices\n\n### Option 1: Same Device, Multiple Browsers/Tabs\n\n1. Open the application in your default browser\n2. Start a new chat or join an existing one (use the chat ID from the URL)\n3. Open the same URL in a different browser or incognito window\n4. Type messages in one browser and watch them appear in the other in real-time!\n\n### Option 2: Multiple Devices on the Same Network\n\n1. Start the development server on your primary device\n2. Find your local IP address:\n   - **Linux/Mac**: Run `ip addr show` or `ifconfig` (look for 192.168.x.x)\n   - **Windows**: Run `ipconfig` (look for IPv4 Address)\n3. On your other devices, navigate to `http://YOUR_IP_ADDRESS:3000`\n   - Example: `http://192.168.1.100:3000`\n4. Open the same chat on both devices and watch the magic happen!\n\n### Option 3: Using Ngrok for Remote Testing\n\n1. Install [ngrok](https://ngrok.com/)\n2. Start your dev server: `npm run dev`\n3. In a new terminal: `ngrok http 3000`\n4. Use the ngrok URL on any device anywhere in the world\n\n## 🎮 Using the Application\n\n1. **Start a new chat**: Click \"Start New Chat\" on the homepage\n2. **Share the chat**: Copy the URL from your browser and share it with another device/browser\n3. **Send messages**: Type your message and press Enter or click Send\n4. **Real-time sync**: Messages appear instantly across all connected devices\n\n## 🔧 Other Available Commands\n\n```bash\n# Build for production (but remember the warning above!)\nnpm run build\n\n# Start production server\nnpm start\n\n# Run linter\nnpm run lint\n```\n\n## 🏗️ Project Structure\n\n```\nchatduo/\n├── app/\n│   ├── api/chat/[chatId]/     # API routes for chat operations\n│   ├── chat/[chatId]/         # Dynamic chat pages\n│   ├── utils/                 # Utility functions (chatMap)\n│   ├── globals.css            # Global styles\n│   ├── layout.tsx             # Root layout\n│   └── page.tsx               # Homepage\n├── public/                     # Static assets\n└── Configuration files\n```\n\n## ⚡ How It Works (Technical Overview)\n\nChatDuo uses an in-memory Map to store chat messages on the server. Clients use long polling: the client requests updates, the server waits until there is a new message (or timeout), and then responds with the latest messages. This approach:\n\n- ✅ Works without a database\n- ✅ Simple to understand and implement\n- ✅ Reduces unnecessary requests compared to fixed interval polling\n- ❌ Doesn't scale\n- ❌ Loses data on server restart\n- ❌ Still creates many API calls at higher concurrency\n- ❌ Expensive in production environments\n\n## 🤝 Contributing\n\nThis is a demonstration project. Feel free to fork and experiment, but please heed the production warning!\n\n**Remember**: This is a learning/demo project. Never deploy this approach to production.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiyabuilds%2Fchatduo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiyabuilds%2Fchatduo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiyabuilds%2Fchatduo/lists"}