Difficulty: Expert
Type: feature
Background
The README already reserves NEXT_PUBLIC_FEATURE_GOVERNANCE (default false everywhere) and lists "Advanced analytics and governance" as intentionally deferred, but no governance UI or data model currently exists in this frontend.
Problem
Communities have no way to propose, discuss, or vote on decisions (role policy changes, resource additions, community rules) through the dashboard, and there's no defined contract for how this frontend would talk to a (currently non-existent, or future guildpass-core) governance backend.
Expected outcome
A feature-flagged Governance module lets members view active proposals, cast votes (weighted by role/tier if applicable), and lets admins create new proposals, backed by a clearly documented API contract this frontend expects from guildpass-core (to be implemented there separately), with a full mock-mode implementation so the module is demoable without a live governance backend.
Suggested implementation
- Design the proposal/vote data shapes in
lib/api/types.ts (or a new governance-specific types module) and document the expected guildpass-core endpoints (e.g., GET /v1/governance/proposals, POST /v1/governance/proposals/:id/vote) in a new docs/governance-contract.md.
- Implement
lib/api/mock.ts support for the full proposal lifecycle (draft → active → closed → resolved) with simulated votes.
- Build the
/governance route (proposal list, proposal detail with voting UI, admin proposal-creation form), gated via <FeatureGate enabled={features.governance} name="Governance"> following the documented pattern.
- Ensure vote-casting respects the existing SIWE-authenticated admin/member patterns (voting likely requires an authenticated wallet at minimum, even if not full admin SIWE).
- Add
lib/api/live.ts implementations calling the documented (new) endpoints, with clear 503/graceful-degradation behavior if the live backend doesn't yet support them (consistent with the existing integration-gateway pattern).
Acceptance criteria
Likely affected files/directories
app/governance/ (new)
lib/api/mock.ts, lib/api/live.ts, lib/api/types.ts
lib/features.ts
docs/governance-contract.md (new)
Difficulty: Expert
Type: feature
Background
The README already reserves
NEXT_PUBLIC_FEATURE_GOVERNANCE(defaultfalseeverywhere) and lists "Advanced analytics and governance" as intentionally deferred, but no governance UI or data model currently exists in this frontend.Problem
Communities have no way to propose, discuss, or vote on decisions (role policy changes, resource additions, community rules) through the dashboard, and there's no defined contract for how this frontend would talk to a (currently non-existent, or future
guildpass-core) governance backend.Expected outcome
A feature-flagged Governance module lets members view active proposals, cast votes (weighted by role/tier if applicable), and lets admins create new proposals, backed by a clearly documented API contract this frontend expects from
guildpass-core(to be implemented there separately), with a full mock-mode implementation so the module is demoable without a live governance backend.Suggested implementation
lib/api/types.ts(or a new governance-specific types module) and document the expectedguildpass-coreendpoints (e.g.,GET /v1/governance/proposals,POST /v1/governance/proposals/:id/vote) in a newdocs/governance-contract.md.lib/api/mock.tssupport for the full proposal lifecycle (draft → active → closed → resolved) with simulated votes./governanceroute (proposal list, proposal detail with voting UI, admin proposal-creation form), gated via<FeatureGate enabled={features.governance} name="Governance">following the documented pattern.lib/api/live.tsimplementations calling the documented (new) endpoints, with clear503/graceful-degradation behavior if the live backend doesn't yet support them (consistent with the existing integration-gateway pattern).Acceptance criteria
guildpass-coredocumented clearly enough to be implemented independentlyLikely affected files/directories
app/governance/(new)lib/api/mock.ts,lib/api/live.ts,lib/api/types.tslib/features.tsdocs/governance-contract.md(new)