A high-performance, architecturally sound Sudoku engine built with React 19, TypeScript, and Tailwind CSS v4.
This project follows a Clean Architecture pattern to ensure a strict separation of concerns between the mathematical engine and the user interface.
src/ui: React components and layout. Purely responsible for rendering and capturing user intent.src/store: Reducers managing game state transitions viauseActionStateanduseReducer.src/service: Orchestrates high-level game rules and board initialization.src/logic: Mathematical core for board generation and validation algorithms.src/model: Domain entities and TypeScript interfaces.
The game leverages React 19's useActionState for asynchronous board updates and useReducer for tracking game completion status.
The project maintains a high standard of reliability through a multi-layered testing approach:
- Logic Tests (
src/__tests__/logic.test.ts): Unit tests for the Sudoku generation engine using Jest. - UI Tests (
src/__tests__/ui.test.tsx): Integration tests using React Testing Library and Jest.- State Mocking: Reducers are mocked to verify UI transitions (e.g., verifying the "WIN" state).
- User Simulation: Testing cell selection and digit input behavior.
- Framework: React 19
- Styling: Tailwind CSS v4
- Build Tool: Vite
- Language: TypeScript
- Testing: Jest & React Testing Library
- Node.js (Latest LTS recommended)
# Clone the repository
git clone <your-repo-url>
# Install dependencies
npm install
# Start development server
npm run dev# Run all logic and component tests
npm testBuilt with ❤️ and clean code principles.