Skip to content

Tien Len - Vietnamese card game. Play solo vs AI or multiplayer with friends. Built with Next.js, Three.js, Socket.io.

Notifications You must be signed in to change notification settings

vxcozy/tien-len

Repository files navigation

Tien Len

A full-stack Vietnamese card game (Tiến Lên) built for the web. Play solo against AI or create multiplayer rooms with friends.

Play Now

What is Tien Len?

Tien Len (Tiến Lên, "Go Forward") is the most popular card game in Vietnam. Players race to empty their hand by playing increasingly powerful card combinations. Twos are the highest card. Bombs beat twos. First to empty wins.

The game supports 2–8 players, with AI opponents filling empty seats in solo mode.

Tech Stack

Layer Technology
Frontend Next.js 16, React 19, Tailwind v4, Framer Motion
3D Three.js via React Three Fiber
State Zustand (two-store architecture)
Multiplayer Socket.io with JWT authentication
Game Engine Pure TypeScript, server-authoritative
Monorepo Turborepo + pnpm workspaces
Testing Vitest (83 tests)

Project Structure

tien-len/
├── apps/
│   ├── web/          Next.js frontend
│   └── server/       Socket.io multiplayer server
├── packages/
│   ├── engine/       Game logic, AI, validation (83 tests)
│   └── shared/       Types, constants, Zod schemas
├── docs/             Diataxis-style documentation
└── turbo.json        Turborepo configuration

Quick Start

# Install dependencies
npx pnpm install

# Run tests
npx pnpm --filter @tienlen/engine test

# Start the dev server
npx pnpm --filter web dev

Visit http://localhost:3000 and click Solo to play against AI.

For multiplayer, also start the game server:

npx pnpm --filter @tienlen/server dev

Documentation

All documentation follows the Diataxis framework, organized into four categories by purpose.

Tutorials — Learning-oriented

Step-by-step lessons to get you started.

How-To Guides — Task-oriented

Practical guides for specific tasks.

Explanation — Understanding-oriented

Background knowledge and design decisions.

Reference — Information-oriented

Technical specifications and API docs.

Design

The UI draws from Vietnamese and Chinese festive aesthetics — deep reds paired with gold, a Ma Shan Zheng brush calligraphy font, and a golden felt poker table. The landing page features 3D playing cards floating in space via Three.js.

Players are represented by deterministic pixel-art avatars (Facehash) with rainbow ring borders. The game table supports 2–8 players seated around an elliptical layout with red ribbon name banners and animated status indicators.

License

MIT

About

Tien Len - Vietnamese card game. Play solo vs AI or multiplayer with friends. Built with Next.js, Three.js, Socket.io.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages