2.0 KiB
2.0 KiB
TASKS.md
Implementation progress tracker for the P2P Poll App.
Setup
- Scaffold Waku project with
bunx create-waku@latest - Install Automerge dependencies
- Install Tailwind CSS v4 and
@tailwindcss/vite - Create
waku.config.tswith Tailwind Vite plugin - Create
src/styles/global.csswith Tailwind import - Verify
bun run devstarts without errors
Core Logic
- Create
src/lib/types.tswith Poll and PollOption interfaces - Create
src/lib/peer.tswith localStorage-backed peer ID generation - Implement
createPollinsrc/lib/poll.ts - Implement
addOptioninsrc/lib/poll.ts - Implement
voteandunvoteinsrc/lib/poll.ts - Implement
hasVotedinsrc/lib/poll.ts
Automerge Integration
- Create
src/lib/repo.tswith Repo singleton (WebSocket, BroadcastChannel, IndexedDB) - Create
src/components/Providers.tsxwith RepoContext.Provider
Pages & Routing
- Create
src/pages/_layout.tsx(server component with Providers and global CSS) - Create
src/pages/index.tsxwith create-poll and join-poll UI - Create
src/pages/poll/[id].tsxwith useDocument and Suspense
UI Components
- Build
src/components/PollView.tsx(title, options list, vote/unvote buttons) - Add "Add Option" form to PollView
- Add shareable link / copy button to PollView
- Build
src/components/ConnectionStatus.tsx
Tests
- Test: getPeerId generates and persists a UUID
- Test: createPoll returns poll with title and empty options
- Test: addOption appends option with text, id, and empty votes
- Test: vote adds peer ID to option's votes array
- Test: double-vote prevention (no duplicate entries)
- Test: unvote removes peer ID from votes array
Polish
- Tailwind styling (centered layout, card-style poll, vote bars)
- Loading states for document sync
- Error handling for invalid/missing document IDs
- Cross-tab sync testing (BroadcastChannel)
- Multi-device sync testing