Sudoku API
The sudoku feature uses an external API to generate a playable Sudoku board, The data is fetched on demand and is used to initialize a fully interactive client-sided game. The API returns a single 9x9 which is then transformed into the internal game state.
API Usage
Fetching Data
The Sudoku board is fetched from:
https://sudoku-api.vercel.app/api/dosuku?query={newboard(limit:1){grids{value}}}
The API does not require authentication or parameters.
The request is handled through the custom hook:
useSudokuModal(refreshKey);
Refresh behavior
A new board is fetched whenever refreshKey is changed:
- Initial → fetch board
- clicking "New game" → increments refreshKey
- Modal open → uses latest fetched data.
Response Structure
Data structure
The API returns a JSON object containing a single board
The board data is located at:
newboard.grids[0].value
This value contains a 9x9 array of numbers
Example:
{
"newboard": {
"grids": [
{
"value": [
[0, 0, 0, 0, 5, 7, 8, 0, 3],
[7, 3, 0, 0, 0, 9, 0, 2, 0],
[0, 5, 8, 0, 3, 1, 7, 6, 0],
[6, 0, 0, 0, 9, 2, 0, 0, 0],
[0, 0, 3, 5, 0, 8, 0, 0, 9],
[0, 9, 5, 0, 0, 3, 0, 7, 2],
[0, 0, 7, 0, 1, 4, 0, 0, 0],
[3, 6, 0, 0, 7, 0, 0, 0, 1],
[0, 0, 0, 0, 2, 0, 0, 3, 7]
]
}
]
}
}
Value Meaning
| Value | Meaning |
|---|---|
| 0 | Empty cell (Player input |
| 1-9 | Pre-filled fixed number |
Client-sided implementation
Game state structure
Each cell in the internal board is represented as:
{
value: number,
notes: Set<number>
}
Where:
-
value = current number in the cell
-
notes = marking values.
Validation rules
The application also validates the board by checking:
- duplicate values in rows
- duplicate values in columns
- duplicate values in an 3x3 area
Additional APIs
Send a request to get the solution of the grid only:
- https://sudoku-api.vercel.app/api/dosuku?query={newboard(limit:1){grids{solution}}}
Send a request to get the difficulty:
- https://sudoku-api.vercel.app/api/dosuku?query={newboard(limit:1){grids{difficulty}}}
Get multiple results by changing the limit:
- https://sudoku-api.vercel.app/api/dosuku?query={newboard(limit:5){grids{value,solution,difficulty},results,message}}
1. Setup
2. Standards
- Coding Conventions
- Issues
- Branch creation
- Reviews
- Implementation Standards
- [WIP] Creating new databases
- Localization
3. Models and Diagrams
4. Testing
- Testing methodology
- Testing Architecture
- Testing frontend with Playwright
- Integration testing utilizing testcontainers, xUnit and ASP.NET core webhost
5. Documentation
- Documentation for service endpoints
- API documentation
- Webpage Design
- Secrets and .env
- Evaluations
- Installation and Rebuild script documentation
6. Guides and How-to's
7. Micro Service Mockup Api
- Guidelines Mircro Service Mockup
- Documentation of useTemperature/useTemperatureTimeSeries mockup sensor