Difficulty: Advanced
Type: refactor
Background
GuildPass manages multiple guilds/communities, each with their own members, passes, and activity, per the feature list and /guilds route — implying the app is meant to be multi-tenant at the guild level.
Problem
It's not evident from the project structure that member, pass, and activity queries are consistently scoped by guildId; without enforced scoping at the data-access layer, it would be easy for a future real-backend integration to leak one guild's members/passes/activity into another guild's views.
Expected outcome
Every data query for members, passes, and activity requires an explicit guildId and is enforced at a single choke point (not just optionally passed by UI code), so cross-guild data leakage is structurally prevented.
Suggested implementation
- Introduce a
GuildScopedContext (or similar) that wraps all repository/query calls with a mandatory guildId.
- Update
apps/dashboard/lib/mock-data.ts accessors to require guildId as a parameter, throwing/erroring if omitted, rather than defaulting to "all guilds."
- Add a currently-selected-guild concept to the dashboard (e.g., a guild switcher in the nav) that supplies
guildId to all pages via context/route params.
- Add tests asserting that querying members/passes/activity without a guild context is impossible or clearly rejected.
Acceptance criteria
Likely affected files/directories
apps/dashboard/lib/mock-data.ts
apps/dashboard/app/**
apps/dashboard/components/ (guild switcher)
packages/integration-client/
Difficulty: Advanced
Type: refactor
Background
GuildPass manages multiple guilds/communities, each with their own members, passes, and activity, per the feature list and
/guildsroute — implying the app is meant to be multi-tenant at the guild level.Problem
It's not evident from the project structure that member, pass, and activity queries are consistently scoped by
guildId; without enforced scoping at the data-access layer, it would be easy for a future real-backend integration to leak one guild's members/passes/activity into another guild's views.Expected outcome
Every data query for members, passes, and activity requires an explicit
guildIdand is enforced at a single choke point (not just optionally passed by UI code), so cross-guild data leakage is structurally prevented.Suggested implementation
GuildScopedContext(or similar) that wraps all repository/query calls with a mandatoryguildId.apps/dashboard/lib/mock-data.tsaccessors to requireguildIdas a parameter, throwing/erroring if omitted, rather than defaulting to "all guilds."guildIdto all pages via context/route params.Acceptance criteria
guildIdLikely affected files/directories
apps/dashboard/lib/mock-data.tsapps/dashboard/app/**apps/dashboard/components/(guild switcher)packages/integration-client/