feat(demo): cap public demo user at 5 owned workspaces#103
Merged
Conversation
Prevents pollution of the shared public demo instance from viral traffic after the anchor video launches. When the demo user tries to create a sixth workspace, the API returns 429 with a friendly CTA pointing to GitHub for self-hosted deployment. This is intentional tech debt hardcoded to the demo email — see issue #102 for the planned refactor to a proper plans/quotas system that applies to all users, not just demo. - workspace.Store: new CountOwnedByUser method for owner-role counting. - workspace_handler.create: quota gate before Store.Create when the caller is the configured demo user (svc.Cfg.DemoEmail) and demo mode is enabled. Returns HTTP 429 with a message that converts the limit into an adoption CTA ("star us on GitHub"). - Quota is a package-level constant (demoUserWorkspaceQuota = 5) that will be removed together with the hardcode when #102 lands.
Deploying archipulse with
|
| Latest commit: |
1efb0e8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://fd1c2fb1.archipulse.pages.dev |
| Branch Preview URL: | https://feat-demo-workspace-quota.archipulse.pages.dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pragmatic launch-day protection: the public demo user (`demo@archipulse.org`) is capped at 5 owned workspaces. Prevents pollution of the shared demo instance from viral traffic when the anchor video ships on 2026-07-06.
Behavior
When the demo user tries to create a sixth workspace:
The message converts the limit into an adoption CTA. Non-demo users are unaffected.
Changes
Explicit tech debt
This hardcodes the demo email in a handler — not the right long-term design. Issue #102 tracks the proper refactor to a Plans + Quotas system that applies to all users.
Marked with a TODO(#102) comment. When #102 lands, the entire `if claims.Email == ... DemoEmail` block gets replaced by a generic quota middleware and this constant deleted.
Also protects
Test plan
Deploy notes
Must be propagated to the `demo` branch after merge to main so Railway rebuilds. See [[reference-deploy-branches]] in memory.