
Tien Len - 13: a full SwiftUI card game that outgrew GameKit and ended up on a custom Vapor backend
Hey everyone, I'm the developer. I shipped Tien Len - 13 this week, an iOS version of Tiến Lên (Thirteen), the Vietnamese card game I learned in high school 20 something years ago. Every version on the App Store was ads, coin systems, and casino graphics. Just really ugly stuff. About 4 years ago I started on this, but I finally finished it.
Tech Stack
- Client: full SwiftUI
- Server: Vapor 4 (Vapor 5 migration coming), WebSockets for realtime play and SSE for updates
- Auth: passkeys only, no passwords, no email required
- No API keys in the binary. The client authenticates to the backend through App Attest, and a jwt from the passkey
- Feature flags via Grantiva, which is how ranked mode sits built but its currently off while the player base grows
Development Challenge
I originally built multiplayer on GameKit. Free infrastructure, first-party, seemed like the obvious call. It fought me everywhere
- The authenticateHandler flow hands you view controllers to present, which is clumsy to wire into a pure SwiftUI app cleanly
- Turn-based matchmaking gave me hard-to-debug timeouts and sync conflicts once real devices on real networks got involved
- Testing multiplayer meant provisioning sandbox accounts across App Store Connect and Xcode before anything worked, which made iteration painfully slow
- The core problem: keeping four devices agreed on one table state. GameKit's model is clients exchanging state with each other, so there's no authority anywhere enforcing the rules, and I ended up chasing conflicting snapshots instead of building the game
That last one is what killed it. A card game needs exactly one truth about whose turn it is and what's legal to play. So I replaced GameKit with a custom Vapor backend where the server owns the game. Clients send moves, the server validates them against the rule set and broadcasts new state over WebSockets.
AI Disclosure
Largely self built. Ive been an iOS Engineer for over 13 years, and a Mac engineer before that. The architecture, gameplay, UI, and backend are hand-written. I used AI as a tool in three places: localization, security testing, and verifying game logic edge cases against the rule sets.
The game itself
Offline vs three AI opponents with different play styles, Pass & Play with hand-off screens so nobody peeks at your hand, and online multiplayer with private lobbies, invite codes, and quick match. Southern and Northern rules plus custom house rules for chops, instant wins, and turn timers. Free, with a one-time $4.99 unlock for ranked when it goes live. No ads anywhere.
Up next: an interactive learn mode, emotes, more themes, and something fun you can flick around the table while you wait for your turn.
Happy to go deep on any of it, especially the App Attest setup, the GameKit lessons, or running Swift on the server.