/tictactoe

A tictactoe project built using React

Primary LanguageTypeScriptMIT LicenseMIT

๐ŸŽฎ TicTacToe Game

Screenshot 2024-11-16 at 14 53 33

Welcome to the TicTacToe project! This is a fun, classic game built with modern web technologies. It's a simple but engaging project that showcases the use of React, TypeScript, Tailwind CSS, and testing tools like Jest and Cypress.

๐Ÿš€ Features

  • Multiplayer Game: Play against your friends and take turns as X and O! โœ–๏ธ๐Ÿ…พ๏ธ

  • Responsive Design: Works perfectly across all devices โ€“ desktop, tablet, or mobile ๐Ÿ“ฑ๐Ÿ’ป.

  • Lightweight Styling: Designed using Tailwind CSS for a clean, modern UI ๐ŸŽจ.

  • Accessibility First: Enhanced accessibility for a better experience for all players โ™ฟ๏ธ.

  • Tested for Quality: Thoroughly tested with Jest and Cypress for reliability โœ….

๐Ÿ› ๏ธ Tech Stack

  • Frontend: React + TypeScript โš›๏ธ๐Ÿ“˜

  • Styling: Tailwind CSS ๐Ÿ’…

  • Testing: Jest for unit testing, Cypress for end-to-end testing ๐Ÿงช

๐ŸŽ‰ Getting Started

Follow these steps to get the game up and running on your local machine:

Prerequisites

  • Node.js and npm installed on your machine.

Installation

  1. Clone the repository:

    git clone https://github.com/Mupa1/tictactoe.git

  2. Navigate to the project directory:

    cd tictactoe

  3. Install dependencies:

    npm install

Running the App

  1. Start the development server:

    npm start

  2. Open http://localhost:3000 to view it in the browser.

๐Ÿงช Running Tests

Unit Tests

To run unit tests with Jest:

npm test

End-to-End Tests

To run end-to-end tests with Cypress:

npm run e2e

Or to run in headless mode:

npm run e2e:run

Test Coverage

To generate a coverage report:

npm run coverage

##๐Ÿ“ Project Structure

  • src/components: Contains reusable UI components (e.g., Board, Square)

  • src/tests: Contains unit tests for the components

  • cypress/e2e: Contains end-to-end tests

๐Ÿ“ Features to Explore

  • Game Logic: Implemented logic for handling turns, win/draw states, and resetting the game ๐ŸŒ€.

  • Accessibility: Includes ARIA labels for screen reader support to enhance the game experience for everyone ๐Ÿ‘‚.

๐Ÿšง Future Enhancements

  • ๐Ÿค– AI Player: Add a single-player mode with an AI opponent.

  • ๐ŸŽจ Themes: Add light/dark mode support for different visual preferences.

  • ๐Ÿ† Score Tracking: Keep track of wins and draws.

๐Ÿ’ป Demo

Check out the live demo here: TicTacToe Demo ๐ŸŒ.

๐Ÿค Contributing

Contributions are welcome! If you'd like to make any improvements or add features:

  1. Fork the repository ๐Ÿด.

  2. Create a new branch (git checkout -b feature-branch) ๐ŸŒฟ.

  3. Commit your changes (git commit -m 'Add new feature') ๐Ÿ’ฌ.

  4. Push the branch (git push origin feature-branch) ๐Ÿ“ค.

  5. Open a pull request ๐Ÿ”.

๐Ÿ“ License

This project is licensed under the MIT License. ๐Ÿ“œ

๐Ÿ™Œ Acknowledgements

  • Inspired by the classic TicTacToe game we all know and love โค๏ธ.

Feel free to reach out if you have any questions or suggestions! โœจ

Enjoy the game and happy coding! ๐ŸŽ‰๐Ÿ‘พ