cf-socket-server
serverless_chat
cf-socket-server | serverless_chat | |
---|---|---|
1 | 1 | |
10 | 1 | |
- | - | |
0.0 | 10.0 | |
about 2 years ago | over 1 year ago | |
TypeScript | TypeScript | |
Apache License 2.0 | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
cf-socket-server
serverless_chat
-
Implementing serverless chat in React
Our worker implements a fetch listener (wrapped in an error handler) and passes on API requests further, to instantiate a ChatRoom class. The instance of this class runs as a Durable Object and creates chatrooms while handling sessions to this chatroom. Since we don't want to persist data, we don't store it anywhere and all data is lost as soon as the websockets enabling the sessions are disconnected / closed. The ChatRoom Durable Object also instantiates a RateLimiter class to ensure worker compute is not abused by heavy traffic, but is rather moderated via rate limiting.
What are some alternatives?
durafetch-server - Download all Cloudflare durable object state to a local SQLite database.
Express - Fast, unopinionated, minimalist web framework for node.
pubsearch - A Cloudflare worker to provide an OpenSearch-compatible search API for pub.dev.
eslint-plugin-react - React-specific linting rules for ESLint
showcase - REST api for your database (PostgreSQL/Sqlite/ClickHouse/MySQL).
relay-starter-kit - 💥 Monorepo template (seed project) pre-configured with GraphQL API, PostgreSQL, React, and Joy UI. [Moved to: https://github.com/kriasoft/graphql-starter-kit]
react-esi - React ESI: Blazing-fast Server-Side Rendering for React and Next.js
live_chat
cloudflare-worker-router - A super lightweight router (1.0K) with middleware support and ZERO dependencies for Cloudflare Workers.
cloudflare-worker-jwt - A lightweight JWT implementation with ZERO dependencies for Cloudflare Workers.