{"id":23576084,"url":"https://github.com/msysh/aws-sample-appsync-events","last_synced_at":"2026-05-06T10:39:50.926Z","repository":{"id":268074851,"uuid":"903237520","full_name":"msysh/aws-sample-appsync-events","owner":"msysh","description":"This project is a demonstration of a simple and minimal implementation of real-time communication using AWS AppSync Events.","archived":false,"fork":false,"pushed_at":"2025-03-17T04:11:12.000Z","size":79,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-06T23:33:50.149Z","etag":null,"topics":["aws-appsync-events","pubsub","react","websocket"],"latest_commit_sha":null,"homepage":"https://blog.msysh.me/posts/2024/11/appsync-events-without-amplify.html","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msysh.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":"2024-12-14T04:26:06.000Z","updated_at":"2025-03-17T04:03:03.000Z","dependencies_parsed_at":"2025-05-16T13:10:10.776Z","dependency_job_id":"554fa4bb-e754-47e4-839f-422fa017d927","html_url":"https://github.com/msysh/aws-sample-appsync-events","commit_stats":null,"previous_names":["msysh/aws-sample-appsync-events"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/msysh/aws-sample-appsync-events","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msysh%2Faws-sample-appsync-events","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msysh%2Faws-sample-appsync-events/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msysh%2Faws-sample-appsync-events/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msysh%2Faws-sample-appsync-events/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msysh","download_url":"https://codeload.github.com/msysh/aws-sample-appsync-events/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msysh%2Faws-sample-appsync-events/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32689651,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T08:33:17.875Z","status":"ssl_error","status_checked_at":"2026-05-06T08:33:17.221Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["aws-appsync-events","pubsub","react","websocket"],"created_at":"2024-12-26T21:12:30.972Z","updated_at":"2026-05-06T10:39:50.909Z","avatar_url":"https://github.com/msysh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AppSync Events Demo: Real-time Communication with AWS AppSync\n\n[日本語の情報(for Japanese)](https://blog.msysh.me/posts/2024/11/appsync-events-without-amplify.html)\n\nThis project is a demonstration of a simple and minimal implementation of real-time communication using [AWS AppSync Events](https://docs.aws.amazon.com/ja_jp/appsync/latest/eventapi/event-api-welcome.html). It has been achieved without using Amplify.\n\nThis demo shows a React web app as a front-end client and a Pub/Sub client on the management console communicating via AppSync Events.\n\nThe architecture is as follows:\n\n![Demo Architecture](./doc/architecture.svg)\n\n\n\n## Repository Structure\n\n```\n.\n├── backend\n├── doc\n├── frontend\n└── README.md\n```\n\n* **backend**: CDK project to deploy cloud resources for AppSync Events, API Key, and so on.\n* **frontend**: A React web application as a front-end client by Vite.\n* **doc**: Images and so on, for this documentation.\n\n### Key Files:\n\n- `backend/bin/backend.ts`: Entry point for the CDK application\n- `backend/lib/stack.ts`: Defines the AWS infrastructure stack\n- `frontend/src/App.tsx`: Main React component implementing real-time functionality\n- `frontend/vite.config.ts`: Vite configuration for the frontend build\n\n### Important Integration Points:\n\n- AppSync API: The backend creates an AppSync API with event configuration\n- WebSocket Connection: The frontend establishes a WebSocket connection to the AppSync real-time endpoint\n\n## Usage Instructions\n\n### Backend Installation\n\n1. Navigate to the `backend` directory:\n   ```\n   cd backend\n   ```\n\n2. Install dependencies:\n   ```\n   pnpm install\n   ```\n\n3. Deploy the stack:\n   ```\n   cdk deploy\n   ```\n\n4. Note the output values for AppSync HTTP Endpoint, Realtime Endpoint, API Key, and Channel Namespace.\n\n### Frontend Installation\n\n1. Navigate to the `frontend` directory:\n   ```\n   cd frontend\n   ```\n\n2. Install dependencies:\n   ```\n   pnpm install\n   ```\n\n3. Update the `VITE_APPSYNC_HTTP_ENDPOINT`, `VITE_APPSYNC_REALTIME_ENDPOINT`, `VITE_APPSYNC_API_KEY`, and `VITE_APPSYNC_CHANNEL_NAMESPACE` environment values in `.env` file with the values from the backend deployment.\n   ```bash\n   # Specify the value of `OutputAppSyncHttpEndpoint` from cdk output\n   VITE_APPSYNC_HTTP_ENDPOINT=\u003cAppSync Http Endpoint\u003e\n\n   # Specify the value of `OutputAppSyncRealtimeEndpoint` from cdk output\n   VITE_APPSYNC_REALTIME_ENDPOINT=\u003cAppSync Realtime Endpoint\u003e\n\n   # Specify the value of `OutputAppSyncApiKey` from cdk output\n   VITE_APPSYNC_API_KEY=\u003cAppSync API Key\u003e\n\n   # Specify the value of `OutputAppSyncChannelNamespace` from cdk output\n   VITE_APPSYNC_CHANNEL_NAMESPACE=default\n   ```\n\n4. Start the development server:\n   ```\n   pnpm run dev\n   ```\n\n## Demonstration operation\n\n### at AWS Management Console\n\n1. Open AppSync, and select the API.\n2. Select the \"Pub/Sub Editor\" tab.\n3. In the \"Subscribe\" section, \"connect\" and Channel \"Subscribe\".\n\n### at React web app\n\n1. Open the application in a web browser.\n2. Enter a channel name in the \"Channel\" input field.\n3. Click \"Subscribe\" to subscribe to the channel.\n4. Enter a message in the \"Publish Message\" input field.\n5. Click \"Publish Message\" to send the message to the subscribed channel.\n\nThen, you can observe real-time updates in the Management Console. You can also try to publish from Management Console and receive at the React web application.\n\n## License\n\nApache-2.0 license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsysh%2Faws-sample-appsync-events","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsysh%2Faws-sample-appsync-events","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsysh%2Faws-sample-appsync-events/lists"}