https://github.com/4ssh1/mine-sweeper
Currently building a classic Minesweeper game built with React, TypeScript, and Redux for state management. Features clean, modular architecture, scalable component design, and unit testing with Jest.
https://github.com/4ssh1/mine-sweeper
jest react redux typescript
Last synced: 3 months ago
JSON representation
Currently building a classic Minesweeper game built with React, TypeScript, and Redux for state management. Features clean, modular architecture, scalable component design, and unit testing with Jest.
- Host: GitHub
- URL: https://github.com/4ssh1/mine-sweeper
- Owner: 4ssh1
- Created: 2025-05-27T01:19:56.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-31T22:15:15.000Z (5 months ago)
- Last Synced: 2026-02-01T10:16:48.982Z (5 months ago)
- Topics: jest, react, redux, typescript
- Language: TypeScript
- Homepage:
- Size: 826 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## π£ Minesweeper Game
A classic Minesweeper game built with **React**, **TypeScript**, and **Redux** for state management. Features clean, modular architecture, scalable component design, and unit testing with **Jest**.
---
## π― Features
- βοΈ Built with React and TypeScript
- Responsive grid layout
- Probability-based mine placement
- π Undo/Redo logic (coming soon)
- π§ͺ Unit tested with Jest
- ποΈ Redux-powered state management
- π¨ Dynamic tile color feedback
- π Uses `console.table` for dev grid debugging
- β±οΈ Timer and mine counter (optional feature toggle)
---
## Getting Started
### Prerequisites
- Node.js >= 16
- npm or yarn
### Installation
```bash
git clone https://github.com/your-username/minesweeper-react.git
cd minesweeper-reac
npm install
# or
yarn
```
```bash
npm run dev
# or
yarn dev
```
## Project Structure
```
src
βββ App.tsx
βββ assets
βββ helpers
β βββ BoardTypes.tsx
| βββCellManipulation.tsx
βββ index.css
βββ jest.setup.ts
βββ main.tsx
βββ mocks
β βββ fileMock.js
βββ test
β βββ Board.test.ts
β βββ CellManipulation.test.ts
βββ vite-env.d.ts
```
# Run all test
```bash
npm run test
# or
yarn test
```
## Game Logic
- The board is generated with a size and density parameter.
- Mines are placed randomly based on a probability check.
### On reveal:
If tile is a bomb β Game Over
If not:
Count adjacent mines
If 0 β Recursively reveal surrounding tiles
### Win condition:
All non-bomb tiles are revealed
Field generation uses basic probability math, not complex algorithms.
## π§ Contributing
Fork the repository
Create a feature branch:
```bash
git checkout -b feature-name
git commit -m "feat: added something"
git push origin feature-name
```
Open a Pull Request
We welcome contributions for:
- New features
- Bug fixes
- Tests
- UI improvements
## π License
This project is licensed under the MIT License