Welcome to the Cabo Web App, a digital version of the card game Cabo. This project is built using TypeScript, Vite, React, XState, and PartyKit. Below you'll find information on the project setup, development process, and game rules.
To get started with the Cabo Web App, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/cabo-web-app.git cd cabo-web-app
-
Install dependencies:
Ensure you have Node.js and npm installed. Then run:
npm install
To start the development server, use:
npm run dev
This will launch the app in development mode. Open your browser and navigate to http://localhost:3000
to see the app in action. The page will reload if you make edits, and you will see any lint errors in the console.
To create a production build, run:
npm run build
This will bundle the app into static files for production. You can then serve these files using a web server of your choice.
The objective of Cabo is to have the lowest total value of cards at the end of the game.
- Shuffle the deck and deal four cards to each player.
- Without looking, each player arranges their four cards face down in front of them.
- Each player looks at the two outermost cards once and memorizes their values.
- Numbered cards (0-10): face value.
- Jack (J): 11 points.
- Queen (Q): 12 points.
- King (K): 13 points.
-
Draw Phase:
- On your turn, draw a card from the deck or the discard pile.
-
Action Phase:
- Replace: Exchange the drawn card with one of your face-down cards.
- Peek: Look at one of your face-down cards (only if you drew from the deck).
- Spy: Look at one of another player’s face-down cards (only if you drew from the deck).
- Swap: Swap one of your face-down cards with one of another player’s cards (only if you drew from the deck).
-
End Turn:
- Discard the drawn card if you didn’t replace any of your cards.
-
Calling Cabo:
- If you think you have the lowest total value of cards, you can call "Cabo." Each other player gets one more turn, then all cards are revealed, and scores are tallied.
- The game ends when a player calls "Cabo" or the deck is exhausted.
- The player with the lowest total card value wins.
- TypeScript: Strongly typed programming language that builds on JavaScript.
- Vite: Next-generation front-end tooling. It's fast and provides a great development experience.
- React: JavaScript library for building user interfaces.
- XState: State machines and statecharts for managing complex state in React.
- PartyKit: Framework for building real-time collaborative applications.
We welcome contributions! If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
- Fork the repository.
- Create a feature branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License. See the LICENSE file for details.
Thank you for using the Cabo Web App! If you have any questions or feedback, please open an issue on the GitHub repository. Enjoy the game!