partyflags
is a minimalistic feature flagging implementation using PartyKit.
This repository is currently at an experimental state. Feel free to browse through the code for learning purposes, but I would not recommend trying to run it for its intended use case just yet.
- Global and scoped flags
- Real-time push of updated flags
- Distributed on edge ⚡️
- Web UI
- JavaScript client
- React client
- Prime scope caches to make first request faster
partyflags
is built entirely on PartyKit, a platform for real-time systems.
The project consists of three "parties":
Server an admin API.
Stores the feature flags, and broadcasts changes to connected scopes.
Allows user to connect directly from a web browser using HTTP requests or WebSockets.
In your application, you can create a scope for a team, user, group, or other use grouping by providing a unique identifier.
- A scope party us created when a first client connects to it, which should result in PartyKit creating it in the closest Cloudflare node available in the network topology.
- If you scope variables on a per-user basis, this should result in each party being created nearest to the user.
GET /flags/:projectId
: fetch global flags for projectGET /flags/:projectId/:scopeId
: fetch scope flags for projectPOST /flags/:projectId
: update global flags for projectPOST /flags/:projectId/:scopeId
: update scope flags for projectPOST /scopes/:projectId
: get all scopes with flags defined in this project