Difficulty: Advanced
Type: refactor
Background
The README explicitly states "all data is currently mock data (see apps/dashboard/lib/mock-data.ts)", and the project is structured as a monorepo with packages/integration-client intended as the shared API client — implying a future swap to real backend data is expected.
Problem
Data access is likely called directly against the mock module throughout dashboard components/pages, which means introducing a real backend later requires touching many call sites and risks inconsistent loading/error handling.
Expected outcome
A repository/data-access abstraction (e.g., PassRepository, GuildRepository, MemberRepository, ActivityRepository) sits between UI code and data sources, with a mock implementation today and a clear seam for a real HTTP-backed implementation later via packages/integration-client.
Suggested implementation
- Define repository interfaces in
packages/integration-client (e.g., interface PassRepository { list(params): Promise<Paginated<Pass>>; get(id): Promise<Pass>; }).
- Implement
MockPassRepository etc. backed by the current mock-data.ts content, moved/adapted as needed.
- Introduce a simple dependency-injection point (e.g., a
getRepositories() factory) so a future HttpPassRepository can be swapped in via an environment flag.
- Migrate dashboard pages to call repositories instead of
mock-data.ts directly, using React Server Components/fetch-like async functions where idiomatic for Next.js 14.
- Add a short ADR (architecture decision record) in
docs/ explaining the pattern and migration path.
Acceptance criteria
Likely affected files/directories
packages/integration-client/
apps/dashboard/lib/mock-data.ts
apps/dashboard/app/**
docs/
Difficulty: Advanced
Type: refactor
Background
The README explicitly states "all data is currently mock data (see
apps/dashboard/lib/mock-data.ts)", and the project is structured as a monorepo withpackages/integration-clientintended as the shared API client — implying a future swap to real backend data is expected.Problem
Data access is likely called directly against the mock module throughout dashboard components/pages, which means introducing a real backend later requires touching many call sites and risks inconsistent loading/error handling.
Expected outcome
A repository/data-access abstraction (e.g.,
PassRepository,GuildRepository,MemberRepository,ActivityRepository) sits between UI code and data sources, with a mock implementation today and a clear seam for a real HTTP-backed implementation later viapackages/integration-client.Suggested implementation
packages/integration-client(e.g.,interface PassRepository { list(params): Promise<Paginated<Pass>>; get(id): Promise<Pass>; }).MockPassRepositoryetc. backed by the currentmock-data.tscontent, moved/adapted as needed.getRepositories()factory) so a futureHttpPassRepositorycan be swapped in via an environment flag.mock-data.tsdirectly, using React Server Components/fetch-like async functions where idiomatic for Next.js 14.docs/explaining the pattern and migration path.Acceptance criteria
packages/integration-clientmock-data.tsdirectlypnpm typecheckandpnpm buildsucceeddocs/Likely affected files/directories
packages/integration-client/apps/dashboard/lib/mock-data.tsapps/dashboard/app/**docs/