Skip to content

docs: add monorepo, UI components, state management and testing guides - #595

Merged
codebestia merged 1 commit into
codebestia:devfrom
promisszn:dev
Aug 30, 2026
Merged

docs: add monorepo, UI components, state management and testing guides#595
codebestia merged 1 commit into
codebestia:devfrom
promisszn:dev

Conversation

@promisszn

Copy link
Copy Markdown
Contributor

Summary

Adds four documentation guides for the frontend workspace and monorepo tooling:

  • docs/monorepo.md — workspace layout (pnpm-workspace.yaml, apps/* + contracts), the Turbo task graph (build/dev/lint, what's cached), root vs. per-app scripts, shared Prettier/ESLint tooling, and why contracts is a pnpm workspace member despite being a Cargo project.
  • apps/web/docs/components-ui.md — reference for the shared UI primitives in src/components/ui/ (Avatar, Badge, CopyButton, EmptyState, Modal, ProposalCard, SkeletonLoader, Spinner): props, usage examples, accessibility behavior, presentational vs. stateful, and current test coverage.
  • apps/web/docs/concepts-state-management.md — the provider tree, AuthProvider/AuthContext/useAuth, WalletContext, and ProtectedRoute's redirect/loading gate, plus the boundary between context state, per-route server state, and IndexedDB-persisted state.
  • apps/web/docs/testing.md — the web app's Vitest setup, the fake-indexeddb reset pattern, WebCrypto round-trip testing, and socket-client mocking conventions.

Notable finding

While documenting state management, I found three separate AuthContext implementations in apps/web/src. Only one pair is actually live — WalletProvider (src/contexts/WalletContext.tsx) wrapping AuthProvider (src/components/auth/AuthProvider.tsx), mounted in src/app/layout.tsx and consumed via useAuth()/useWallet(). src/contexts/AuthContext.tsx and src/lib/auth.tsx (referenced only by src/app/providers.tsx, which is itself never imported) appear to be dead code. Documented as such rather than papered over; worth a follow-up cleanup issue if confirmed.

Similarly, apps/web/docs/testing.md notes there is currently no dedicated socket.io-client mock or navigator.serviceWorker fake in the test suite — documented the closest existing patterns (vi.stubGlobal, dependency injection) honestly rather than inventing conventions that don't exist yet.

Test plan

  • Docs only — no code changes.
  • Verified all documented props/behavior against the actual component/context/config source.

Closes #544
Closes #568
Closes #572
Closes #573

Adds docs/monorepo.md (workspace layout, Turbo task graph, shared
tooling), apps/web/docs/components-ui.md (shared UI primitives
reference), apps/web/docs/concepts-state-management.md (provider tree,
Auth/Wallet contexts, ProtectedRoute), and apps/web/docs/testing.md
(Vitest setup, fake-indexeddb, WebCrypto, socket mocking).

Closes codebestia#544
Closes codebestia#568
Closes codebestia#572
Closes codebestia#573

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R8SebNynWtmCebVq8tpgxS
@drips-wave

drips-wave Bot commented Aug 30, 2026

Copy link
Copy Markdown

@promisszn Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@codebestia
codebestia merged commit 3418e62 into codebestia:dev Aug 30, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants