SET Game - A mobile-first, real-time multiplayer card game for 1-4 players.
The Game: Find 3 cards where each feature (color, symbol, number, shading) is either all same OR all different.
Frontend
Backend
Why These?
āāāāāāāāāāāāāāā
ā React ā ā User taps cards, sees scores
ā Frontend ā
āāāāāāāā¬āāāāāāā
ā
WebSocket (instant updates)
REST API (sessions)
ā
āāāāāāāā¼āāāāāāā
ā Node.js ā ā Validates SETs, manages rooms
ā Backend ā
āāāāāāāāāāāāāāā
Key Flow:
Problem: iOS Safari suspends tabs ā socket disconnects
Solution:
visibilitychange event ā reconnect on tab focusProblem: Player A and B tap same cards at same time
Solution:
Problem: After removing cards, might have no SETs left
Solution:
while (!hasValidSet(board) && deck.length > 0) {
// Add 3 more cards
board.push(...deck.splice(0, 3));
}
function isValidSet(card1, card2, card3): boolean {
for each feature in [color, symbol, number, shading]:
values = [card1[feature], card2[feature], card3[feature]]
unique_count = Set(values).size
if unique_count === 2: // 2 same + 1 different
return false // INVALID
return true // All same or all different = VALID
}
Time Complexity: O(1) - always checks 4 features
Finding all SETs: O(n³) where n = 12-21 cards
ā
Real-time sync is instant
ā
Mobile experience is smooth
ā
No lag on invalid SET feedback
ā
Auto-reconnect works perfectly
ā
High test coverage (Jest + Vitest)
ā In-memory storage (doesn't scale)
ā No persistent user profiles
ā Bundle size could be smaller
ā Missing some accessibility features
Phase 2 (Post-MVP):
Phase 3 (Dream Features):
Live Demo: [Insert URL here]
Try it yourself:
Code: [GitHub repo]
Docs: See /docs folder
Tech Stack Summary:
Thank You! š
Built with ā¤ļø for kids (and adults who love pattern games)