{"id":23036780,"url":"https://github.com/skipthedocs/memory-game","last_synced_at":"2025-04-23T18:43:04.994Z","repository":{"id":266989242,"uuid":"899246251","full_name":"skipthedocs/memory-game","owner":"skipthedocs","description":"🔄 A practical example showing how to model application state using discriminated unions in typescript, demonstrated through a simple memory card game.","archived":false,"fork":false,"pushed_at":"2025-03-27T18:44:26.000Z","size":737,"stargazers_count":40,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T02:23:09.333Z","etag":null,"topics":["react","state-management","typescript"],"latest_commit_sha":null,"homepage":"https://skipthedocs.github.io/memory-game/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skipthedocs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T22:11:53.000Z","updated_at":"2025-03-27T18:44:29.000Z","dependencies_parsed_at":"2025-03-22T19:29:15.932Z","dependency_job_id":null,"html_url":"https://github.com/skipthedocs/memory-game","commit_stats":null,"previous_names":["skipthedocs/memory-game"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipthedocs%2Fmemory-game","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipthedocs%2Fmemory-game/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipthedocs%2Fmemory-game/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skipthedocs%2Fmemory-game/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skipthedocs","download_url":"https://codeload.github.com/skipthedocs/memory-game/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250493560,"owners_count":21439796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["react","state-management","typescript"],"created_at":"2024-12-15T17:27:26.602Z","updated_at":"2025-04-23T18:43:04.988Z","avatar_url":"https://github.com/skipthedocs.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Memory game with discriminated unions in TypeScript\n\nThis project demonstrates how to build a type-safe memory card game using React and TypeScript, with a focus on modeling game state using discriminated unions.\n\n## Overview\n\nThe memory game is a classic card-matching puzzle where players need to find pairs of matching cards. This implementation emphasizes type safety and state management using TypeScript's discriminated unions and React's `useReducer` hook.\n\n## Getting started\n\nFollow these steps to set up and run the project locally:\n\n1. **Clone the repository**:\n   ```bash\n   git clone https://github.com/your-username/memory-game.git\n   cd memory-game\n   ```\n\n2. **Install dependencies**:\n   ```bash\n   npm install\n   ```\n\n3. **Run the development server**:\n   ```bash\n   npm run dev\n   ```\n\n4. Open your browser and navigate to `http://localhost:3000` to play the game.\n\nAlternatively, you can try the game online at [Memory Game](https://skipthedocs.github.io/memory-game/).\n\n## Features\n\n- **Type-safe game state**: Leveraging TypeScript's discriminated unions for robust state management.\n- **State management with `useReducer`**: Efficiently manage game state transitions using React's `useReducer` hook.\n- **Interactive gameplay**: Flip cards, match pairs, and track your progress.\n- **React-based UI**: A responsive and dynamic user interface built with React.\n- **Customizable**: Easily extendable to include more cards, themes, or rules.\n\n## Development tools\n\nThis project uses **Biome.js** as a unified tool for linting, formatting, and code analysis. Biome.js replaces the need for separate tools like ESLint and Prettier, providing a faster and more integrated developer experience.\n\nTo run Biome.js checks, use the following command:\n```bash\nnpx biome --help\n```\n\nFor more information about Biome.js, visit [Biome.js documentation](https://biomejs.dev/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskipthedocs%2Fmemory-game","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskipthedocs%2Fmemory-game","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskipthedocs%2Fmemory-game/lists"}