-
Notifications
You must be signed in to change notification settings - Fork 96
Build the Analytics module scaffold behind the existing feature flag #333
Copy link
Copy link
Open
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortAdvanced difficulty tasks requiring significant domain knowledge and implementation effortfeatureNew feature, enhancement, or functional additionNew feature, enhancement, or functional addition
Description
Activity
Metadata
Metadata
Assignees
Labels
GrantFox OSSGrantFox Open Source Sponsorship program tagGrantFox Open Source Sponsorship program tagMaybe RewardedIssue may qualify for a reward upon successful completion per campaign rulesIssue may qualify for a reward upon successful completion per campaign rulesOfficial Campaign | FWC26Official FWC26 campaign issue — eligible for campaign scoring and rewardsOfficial FWC26 campaign issue — eligible for campaign scoring and rewardsadvancedAdvanced difficulty tasks requiring significant domain knowledge and implementation effortAdvanced difficulty tasks requiring significant domain knowledge and implementation effortfeatureNew feature, enhancement, or functional additionNew feature, enhancement, or functional addition
Difficulty: Advanced
Type: feature
Background
The README already defines a
NEXT_PUBLIC_FEATURE_ANALYTICSflag (defaulting tofalsein every environment, since the module is "not yet built"), and documents the exact process for adding new feature-gated modules vialib/features.tsand<FeatureGate>.Problem
The Analytics module has a reserved flag and nav slot but no implementation, meaning there's no way to see engagement/membership trends for a community, and no established data-source abstraction for what will eventually need to consume analytics data (from
guildpass-coreor elsewhere).Expected outcome
A working Analytics module (behind the existing flag, off by default in prod) renders at least: membership growth over time, role distribution, and gated-resource access attempts (allowed vs. denied), using a pluggable data-source interface so it can start on mock data and later swap to a real analytics backend.
Suggested implementation
/analyticsroute wrapped in<FeatureGate enabled={features.analytics} name="Analytics">, following the documented pattern for adding new flagged modules exactly.AnalyticsDataSourceinterface (getMembershipTrend(),getRoleDistribution(),getAccessAttempts()) with a mock implementation seeded from existing mock data patterns inlib/api/mock.ts..env.exampleto note the flag's purpose and default, consistent with existing flag documentation style.Acceptance criteria
NEXT_PUBLIC_FEATURE_ANALYTICS, hidden from nav and showing "Feature unavailable" when disabled and visited directlyLikely affected files/directories
app/analytics/(new)lib/features.tslib/api/mock.ts.env.example