A real-time multiplayer implementation of the popular card game "Love Letter" built with Angular and Supabase.
Love Letter is a game of risk, deduction, and luck. Players attempt to deliver their love letter to the Princess while removing others from the game. Each round is fast-paced, and the first player to collect enough tokens of affection wins!
- 🎯 2-8 Player Support: Play with friends or family
- 🔄 Real-time Multiplayer: Instant synchronization using Supabase Realtime
- 👤 No Login Required: Play as a guest immediately
- 🎨 Beautiful UI: Modern design with TailwindCSS
- 📱 Responsive: Works on desktop and mobile
- ⚡ Fast Rounds: 5-10 minutes per game
- Complete Game Guide - Learn how to play Love Letter
- E2E Testing Guide - Run and write tests
- Node.js 20+
- npm or yarn
- Supabase CLI (for local development)
# Clone the repository
git clone https://github.com/gridatek/throne.git
cd throne
# Install dependencies
npm install- Start Supabase
# Build and start Supabase
npx nx run supabase:build
npx nx run supabase:startThis will start:
- PostgreSQL database (port 54322)
- API server (port 54321)
- Supabase Studio (port 54323)
- Start the Web App
npx nx serve webThe app will be available at http://localhost:4200
- Play the Game!
- Open the app in your browser
- Create a new game or join with a room code
- Share the code with friends to play together
throne/
├── apps/
│ ├── web/ # Angular web application
│ │ └── src/
│ │ ├── app/
│ │ │ ├── components/ # Game components
│ │ │ ├── services/ # Game & Supabase services
│ │ │ └── models/ # TypeScript interfaces
│ │ └── environments/ # Environment config
│ │
│ ├── admin/ # Admin application
│ ├── web-e2e/ # E2E tests (Playwright)
│ └── supabase/ # Supabase configuration
│ └── production/
│ └── migrations/ # Database migrations
│
├── docs/ # Documentation
│ └── GAME_GUIDE.md # Complete game rules
│
└── .github/
└── workflows/ # CI/CD workflows
└── e2e-tests.yml # Automated testing
- Enter your name
- Select the maximum number of players (2-8)
- Click "Create Game"
- Share the 6-digit room code with your friends
- Click "Join Existing Game"
- Enter your name
- Enter the room code
- Wait for the host to start the game
- Each turn, draw a card and play one of your two cards
- Use card effects strategically to eliminate opponents
- Last player standing or highest card wins the round
- First to collect enough tokens wins the game!
For detailed rules and strategy, see the Complete Game Guide
# Start Supabase first
npx nx run supabase:build
npx nx run supabase:start
# Run tests
npx nx e2e web-e2e
# Run in UI mode
npx playwright test --uiTests run automatically on:
- Push to
main,develop, orfeature/**branches - Pull requests to
mainordevelop
See E2E Testing Guide for more details.
| Card | Value | Effect |
|---|---|---|
| Princess | 8 | Lose if discarded |
| Countess | 7 | Must discard if caught with King/Prince |
| King | 6 | Trade hands with another player |
| Prince | 5 | Force discard and draw |
| Handmaid | 4 | Protection until next turn |
| Baron | 3 | Compare hands; lower loses |
| Priest | 2 | Look at another player's hand |
| Guard | 1 | Guess another player's card |
- Angular 21 - Modern web framework with signals
- TailwindCSS 4 - Utility-first CSS
- TypeScript - Type safety
- Supabase - Backend as a Service
- PostgreSQL 17 - Database
- Realtime - WebSocket connections
- Row Level Security - Data protection
- Nx - Monorepo management
- Playwright - E2E testing
- GitHub Actions - CI/CD
The game uses the following main tables:
games- Game sessions and metadatagame_players- Players in each gamegame_state- Current round state (deck, turn, etc.)player_hands- Cards each player holdsgame_actions- Complete action history
All tables have Row Level Security (RLS) policies to ensure data integrity.
# Serve web app
npx nx serve web
# Serve admin app
npx nx serve admin
# Build for production
npx nx build web
# Run linting
npx nx lint web
# Run tests
npx nx e2e web-e2e
# Supabase commands (via Nx)
npx nx run supabase:build # Build Supabase config
npx nx run supabase:start # Start local instance
npx nx run supabase:stop # Stop local instance
npx nx run supabase:status # Check status
npx nx run supabase:db-reset # Reset databaseThe app uses local Supabase by default. Configuration is in:
apps/web/src/environments/environment.ts
For production, update the Supabase URL and anon key.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Angular style guide
- Use TypeScript strict mode
- Write E2E tests for new features
- Use conventional commits
This project is licensed under the MIT License - see the LICENSE file for details.
- Add authentication (optional login)
- Player statistics and leaderboards
- Game replay system
- Chat system
- Custom game modes
- Achievements
- Mobile app (Capacitor)
- AI opponents for solo play
- Tournament mode
- Game state doesn't persist if you refresh the page (by design)
- Guest IDs are browser-specific (localStorage)
For questions or feedback, please open an issue on GitHub.
This project is built with Nx, a powerful build system for monorepos.
# Visualize project graph
npx nx graph
# Show all available targets for a project
npx nx show project web
# Run affected tests only
npx nx affected:test
# Build all projects
npx nx run-many --target=build --allLearn more:
Enjoy the game, and may your love letter reach the Princess! 💌
Original game designed by Seiji Kanai, published by AEG. This is a fan-made digital implementation for educational purposes.