This is an online single-player card game built using React and Vite. The game consists of 4 different types of cards:
- Cat card ๐ผ
- Defuse card ๐ โโ๏ธ
- Shuffle card ๐
- Exploding kitten card ๐ฃ
The objective of the game is for the player to draw all 5 cards from the deck without drawing an exploding kitten card.
- Once the game starts, a deck of 5 cards is generated randomly.
- Click on the deck to draw a card.
- If the card drawn is a cat card, it is removed from the deck.
- If the card drawn is an exploding kitten card, the player loses the game.
- If the card drawn is a defuse card, it is removed from the deck and can be used to defuse one bomb that may come in subsequent cards.
- If the card drawn is a shuffle card, the game is restarted, and the deck is filled with 5 cards again.
- Continue drawing cards until all 5 cards are drawn from the deck or an exploding kitten card is drawn.
- Cat card ๐ผ: Removed from the deck.
- Exploding kitten card ๐ฃ: Player loses the game.
- Defuse card ๐ โโ๏ธ: Removed from the deck and can be used to defuse one bomb.
- Shuffle card ๐: Restarts the game and refills the deck with 5 cards.
- @chakra-ui/icons (^2.1.1) - Icon library for Chakra UI.
- @chakra-ui/react (^2.8.2) - Component library for React applications with Chakra UI.
- @emotion/react (^11.11.4) - Emotion library for React components.
- @emotion/styled (^11.11.0) - Emotion library for styled components.
- @reduxjs/toolkit (^2.2.1) - Redux toolkit for efficient Redux development.
- framer-motion (^11.0.14) - Library for creating animations in React applications.
- react (^18.2.0) - JavaScript library for building user interfaces.
- react-dom (^18.2.0) - React package for working with the DOM.
- react-icons (^5.0.1) - Library for popular icon packs as React components.
- react-redux (^9.1.0) - Official React bindings for Redux.
- react-router-dom (^6.22.3) - React router library for navigation in React applications.
- react-toastify (^10.0.5) - Notification library for React applications.
- redux (^5.0.1) - State management library for JavaScript applications.
- redux-thunk (^3.1.0) - Thunk middleware for Redux.
- @types/react (^18.2.64) - Type definitions for React.
- @types/react-dom (^18.2.21) - Type definitions for React DOM.
- @typescript-eslint/eslint-plugin (^7.1.1) - ESLint plugin for TypeScript.
- @typescript-eslint/parser (^7.1.1) - ESLint parser for TypeScript.
- @vitejs/plugin-react (^4.2.1) - Vite plugin for React support.
- eslint (^8.57.0) - JavaScript and TypeScript linter.
- eslint-plugin-react-hooks (^4.6.0) - ESLint plugin for React hooks.
- eslint-plugin-react-refresh (^0.4.5) - ESLint plugin for React Refresh.
- typescript (^5.2.2) - Typed superset of JavaScript.
- vite (^5.1.6) - Next-generation front-end tooling.
- bcrypt (^5.1.1) - Library for hashing passwords securely.
- cors (^2.8.5) - Middleware for enabling Cross-Origin Resource Sharing (CORS) in Express.js.
- dotenv (^16.4.5) - Module for loading environment variables from a .env file.
- express (^4.18.3) - Web framework for Node.js used for building APIs.
- jsonwebtoken (^9.0.2) - Library for generating and verifying JSON Web Tokens (JWT) for authentication.
- mongoose (^8.2.2) - MongoDB object modeling library for Node.js.
- nodemon (^3.1.0) - Utility that automatically restarts the Node.js server when files change.
- Clone the repository.
- Navigate to the project directory.
- Run
npm install
to install dependencies. - Run
npm run dev
to start the development server.
The following table lists the available user-related API routes and their descriptions:
Route | Method | Description |
---|---|---|
/ | GET | Retrieves information about all users |
/register | POST | Registers a new user |
/login | POST | Authenticates and logs in a user |
/updatePoints | PUT | Updates the points of a user (authentication required) |