{"id":28961002,"url":"https://github.com/puckwang/web-realtime-comm-demo","last_synced_at":"2026-05-03T17:32:35.738Z","repository":{"id":300582489,"uuid":"1006105551","full_name":"puckwang/web-realtime-comm-demo","owner":"puckwang","description":"A demo project built with .NET and React to showcase and compare four realtime communication techniques: Polling, Long Polling, WebHook, and Server-Sent Events (SSE).","archived":false,"fork":false,"pushed_at":"2025-06-29T17:12:38.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-29T18:24:00.924Z","etag":null,"topics":["dotnet","long-polling","nextjs","polling","react","server-send-event","websocket"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/puckwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-06-21T14:02:13.000Z","updated_at":"2025-06-29T17:12:42.000Z","dependencies_parsed_at":"2025-06-22T15:20:48.322Z","dependency_job_id":"6e27cc9f-998f-4b1f-a70e-f189eade85ce","html_url":"https://github.com/puckwang/web-realtime-comm-demo","commit_stats":null,"previous_names":["puckwang/web-realtime-comm-demo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/puckwang/web-realtime-comm-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puckwang%2Fweb-realtime-comm-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puckwang%2Fweb-realtime-comm-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puckwang%2Fweb-realtime-comm-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puckwang%2Fweb-realtime-comm-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puckwang","download_url":"https://codeload.github.com/puckwang/web-realtime-comm-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puckwang%2Fweb-realtime-comm-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32578578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","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":["dotnet","long-polling","nextjs","polling","react","server-send-event","websocket"],"created_at":"2025-06-24T02:01:10.060Z","updated_at":"2026-05-03T17:32:35.732Z","avatar_url":"https://github.com/puckwang.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Web Realtime Communication Demo\n\nA demo project built with **.NET** (backend) and **React** (frontend) to showcase and compare four common realtime\ncommunication techniques:\n\n- ✅ Polling\n- ✅ Long Polling\n- ✅ WebHook\n- ✅ Server-Sent Events (SSE)\n\nThis project helps developers understand the strengths, trade-offs, and practical implementations of various realtime\ncommunication models.\n\n## 🌐 Overview\n\nRealtime communication is essential in modern web applications. This demo illustrates how data can be delivered from\nserver to client using different approaches:\n\n| Method                   | Description                                          | Push or Poll |\n|--------------------------|------------------------------------------------------|--------------|\n| Polling                  | Client repeatedly sends requests at intervals        | Poll         |\n| Long Polling             | Client sends request and waits until server responds | Poll         |\n| Server-Sent Events (SSE) | Server pushes data via a persistent HTTP connection  | Push         |\n| WebHook                  | Server actively sends data to a third-party endpoint | Push         |\n\n## 🛠️ Tech Stack\n\n| Layer      | Technology                     |\n|------------|--------------------------------|\n| Backend    | .NET 10 (ASP.NET Core Web API) |\n| Frontend   | NextJS 15 + React 19           |\n| Transport  | HTTP, EventStream (for SSE)    |\n| Deployment | Docker or .NET + NextJS        |\n\n## 📂 Project Structure\n\n```plaintext\n.\n├── backend/             # ASP.NET Core API\n├── frontend/            # NextJS\n└── README.md\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n\n- [.NET 10 SDK](https://dotnet.microsoft.com/download) or later\n- [Node.js](https://nodejs.org/) 20 or later\n- [npm](https://www.npmjs.com/)\n\n### Starting the Application\n\n#### Backend\n\n1. Navigate to the backend directory:\n   ```bash\n   cd backend/WebRealtimeCommDemo\n   ```\n\n2. Build and run the .NET application:\n   ```bash\n   dotnet build\n   dotnet run\n   ```\n\n3. The backend API will be available at `http://localhost:5001`\n\n#### Frontend\n\n1. Navigate to the frontend directory:\n   ```bash\n   cd frontend\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Start the development server:\n   ```bash\n   npm run dev\n   ```\n\n4. The frontend application will be available at `http://localhost:3000`\n\n### Starting with Docker\n\nYou can use Docker Compose to run both the frontend and backend services together:\n\n1. Make sure you have [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/)\n   installed.\n\n2. From the root directory, run:\n   ```bash\n   # docker\n   docker-compose up -d\n\n   # podman\n   podman-compose up -d\n   ```\n\n3. The services will be available at:\n    - Frontend: `http://localhost:3000`\n    - Backend: `http://localhost:5001`\n\n4. To stop the services:\n   ```bash\n    # docker\n    docker-compose down\n    \n    # podman\n    podman-compose down\n   ```\n\n## 🔧 Environment Variables\n\n### Frontend\n\n| Variable                   | Description                               | Default                 |\n|----------------------------|-------------------------------------------|-------------------------|\n| `NODE_ENV`                 | Environment mode (development/production) | `development`           |\n| `NEXT_PUBLIC_API_BASE_URL` | URL of the backend API                    | `http://localhost:5001` |\n\n### Backend\n\n| Variable                 | Description                                    | Default                 |\n|--------------------------|------------------------------------------------|-------------------------|\n| `ASPNETCORE_ENVIRONMENT` | Environment mode (Development/Production)      | `Development`           |\n| `ASPNETCORE_URLS`        | URLs the server listens on                     | `http://+:5000`         |\n| `CORS_ORIGINS`           | Allowed CORS origins (`;` semicolon-separated) | `http://localhost:3000` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuckwang%2Fweb-realtime-comm-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuckwang%2Fweb-realtime-comm-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuckwang%2Fweb-realtime-comm-demo/lists"}