Skip to content

A simple implementation of the classic Minesweeper game built with Next.js. This project showcases the use of React components and modern front-end development techniques. Players can enjoy the Minesweeper game experience directly in their browser, with a clean and responsive UI.

License

Notifications You must be signed in to change notification settings

guysuvijak/nextjs-minesweeper-game

Repository files navigation

Project Banner

Minesweeper โ€“ Old school game with Next.JS

A simple implementation of the classic Minesweeper game built with Next.js. This project showcases the use of React components and modern front-end development techniques. Players can enjoy the Minesweeper game experience directly in their browser, with a clean and responsive UI.

Project Banner Project Banner Project Banner

๐Ÿ“Œ Project Overview

Minesweeper is a web-based implementation of the classic puzzle game, built with Next.js 15. It features modern UI elements, customizable settings, and responsive design. Players can enjoy the classic Minesweeper experience with added features like custom themes, multiple languages, and various visual customization options.

Project Banner

โšก Key Points to Know

  • ๐ŸŽฎ Classic Gameplay - Traditional Minesweeper mechanics with modern features
  • ๐ŸŒ™ Dark/Light Mode - Full theme support with automatic system detection
  • ๐ŸŒ Multi-Language - Supports English, Thai, Japanese, Vietnamese, and Chinese (can add more)
  • ๐Ÿ“ฑ Responsive Design - Playable on all devices from mobile to desktop
  • ๐ŸŽจ Customizable UI - Various options for icons, numbers, and game elements (can add more)
  • ๐Ÿ’พ No Backend - Client-side only with state management

๐Ÿ”ฅ Features

  • ๐ŸŽฏ Multiple Difficulty Levels - Easy (9x9), Medium (16x16) and Hard (16x30)
  • ๐ŸŽจ Customizable Elements (can add more)
    • Different flag icons (Default, Pyramid, Radar, Sparkles, Sigma)
    • Various mine icons (Bomb, Skull, Fire, Flame, Ghost)
    • Multiple number styles (Default, Roman, Thai, ABC, Question)
  • ๐ŸŒ Language Support - Available in multiple languages (can add more)
  • ๐ŸŽจ Theme Options - Dark and light mode with system preference detection
  • ๐Ÿ“Š Score System - Time-based scoring with difficulty multipliers
  • ๐Ÿ“ฑ Mobile Support - Touch-friendly interface with flag mode toggle

๐Ÿ› ๏ธ Tech Stack

  • nextjs Next.js 15 โ€“ Framework for static site generation.
  • tailwindcss TailwindCSS 4 โ€“ Utility-first CSS framework for styling.
  • typscript TypeScript โ€“ Strongly typed JavaScript for better maintainability.
  • shadcn-ui shadcn/ui โ€“ Reusable UI components
  • magic-ui Magic UI โ€“ Reusable UI components
  • lucide-icons Lucide Icons โ€“ Modern icon set
  • next-themes next-themes โ€“ Theme management

Project Banner

๐Ÿš€ Live Demo

Try it here: Minesweeper

Project Banner Project Banner Project Banner

๐Ÿ“‚ Installation & Setup

To run this project locally, follow these steps:

1. Clone the repository

git clone https://github.com/guysuvijak/nextjs-minesweeper-game.git
cd nextjs-minesweeper-game

2. Install dependencies

npm install
or
bun install
or
pnpm install

3. Start the development server

npm run dev
or
bun run dev
or
pnpm run dev

4. The app will be available

http://localhost:3000

5. Export to cross-platform

npm run tauri
or
bun run tauri
or
pnpm run tauri

note: If you want to Export Cross-platform, please follow setup before Here

๐Ÿ—บ๏ธ Project Structure

nextjs-minesweeper-game/
โ”œโ”€โ”€ public/              # Static assets
โ”‚   โ”œโ”€โ”€ cursor/          # Static Cursor Image
โ”‚   โ”œโ”€โ”€ icon/            # Website Icon
โ”‚   โ”œโ”€โ”€ metadata/        # Static Metadata & README Image
โ”‚   โ””โ”€โ”€ manifest.json    # Config Metadata (PWA)
โ””โ”€โ”€ src/
    โ”œโ”€โ”€ app/             # layout & page Next.JS
    โ”‚   โ””โ”€โ”€ page.tsx     # Main Page
    โ”œโ”€โ”€ components/      # React components
    โ”‚   โ”œโ”€โ”€ magicui/     # UI from Magic-UI
    โ”‚   โ”œโ”€โ”€ ui/          # UI from shadcn/ui
    โ”‚   โ”œโ”€โ”€ CustomDock.tsx      # Menu Dock in Mainmenu
    โ”‚   โ”œโ”€โ”€ GameResultModal.tsx # Modal Result in Game Screen
    โ”‚   โ”œโ”€โ”€ MainMenu.tsx        # Mainmenu Screen
    โ”‚   โ”œโ”€โ”€ Minesweeper.tsx     # Game Screen
    โ”‚   โ”œโ”€โ”€ SettingsModal.tsx   # Modal Settings in Mainmenu
    โ”‚   โ””โ”€โ”€ Timer.tsx           # Timer in Game Screen
    โ”œโ”€โ”€ configs/         # Configs File (Edit Here)
    โ”œโ”€โ”€ hooks/           # React Custom Hooks
    โ”œโ”€โ”€ lib/             # Auto Create from Library
    โ”œโ”€โ”€ locales/         # Language Files
    โ””โ”€โ”€ types/           # TypeScript File

๐Ÿ“„ Modifying the Website

Since this is a static website, all modifications must be made directly within the project files. Hereโ€™s where you can edit specific parts of the site:

โš™๏ธ Game Configuration
๐Ÿ“ File: src/configs/game.tsx
Add or modify game settings like difficulty levels, scoring, and colors.
๐ŸŽจ UI Settings
๐Ÿ“ File: src/configs/settings.ts
Configure available options for icons, themes, and number styles.
๐ŸŒ Language Files
๐Ÿ“ Folder: src/locales/
๐Ÿ“ File: src/configs/language.ts
Add or modify translations for different languages.
๐Ÿ–ผ๏ธ Custom Cursors
๐Ÿ“ Folder: public/cursor/
Add or modify custom cursor images.
โš™๏ธ Types Definition
๐Ÿ“ File: src/types/index.ts
Modify TypeScript types and interfaces.
โš™๏ธ Website Configuration
๐Ÿ“ Files:
src/configs/metadata.ts โ€“ Modify general layout and metadata settings.
public/manifest.json โ€“ Update website metadata for PWA settings.

๐Ÿ“œ License

This project is open-source under the MIT License. Let me know if you need any modifications! ๐Ÿš€

๐Ÿ™ Acknowledgments

Thank you for your interest in Minesweeper from me! Your support means a lot. โค๏ธ
โญ If you like this project, please consider giving it a star on GitHub to show your support and encouragement! ๐Ÿš€

About

A simple implementation of the classic Minesweeper game built with Next.js. This project showcases the use of React components and modern front-end development techniques. Players can enjoy the Minesweeper game experience directly in their browser, with a clean and responsive UI.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages