Mathler is a mathematical puzzle game inspired by Wordle built in NextJS. Players attempt to guess a hidden mathematical equation that equals a given target number within a limited number of tries.
- Daily unique mathematical puzzles (can forceRefresh if needed)
- Server-side puzzle generation and validation
- Client-side game logic with React
- Prisma ORM with SQLite database for puzzle storage
- Zod for runtime type checking and validation
- Node.js (v14 or later)
- npm / pnpm / yarn / bun (pick your poison)
-
Clone the repository:
git clone https://github.com/eternitybro/mathler.git cd mathler
-
Install dependencies:
npm install
-
Set up the database:
npx prisma generate npx prisma db push
-
Start the development server:
npm run dev
-
To run tests:
npm run test
-
Open http://localhost:3001 in your browser to play the game.
-
Use the api for validation or your own game generation http://localhost:3001/api/daily?forceRefresh=true ... using forceRefresh will clear the daily problem.
/app
: Next.js app router files/components
: React components/integrations
: Integration logic (e.g., puzzle generation, API routes)/prisma
: Prisma schema and migrations/types
: TypeScript type definitions/utils
: Utility functions (e.g., validation)
The game uses a simple API to fetch daily puzzles:
GET /api/daily
: Retrieves the daily puzzle
- Next.js - React framework for server-side rendering and static site generation
- React - JavaScript library for building user interfaces
- Prisma - Next-generation ORM for Node.js and TypeScript
- Zod - TypeScript-first schema declaration and validation library
- Shadcn UI - Re-usable components built with Radix UI and Tailwind CSS
- Tailwind CSS - Utility-first CSS framework
- TypeScript - Typed superset of JavaScript
- Inspired by Wordle
- Built with Next.js, React, and Prisma
- Uses Zod for runtime type checking
- UI components from Shadcn UI
- Styled with Tailwind CSS
This project is licensed under the MIT License.