TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/Praashh/buildml/llms.txt
Use this file to discover all available pages before exploring further.
problemRouter exposes two public query procedures for listing and retrieving individual AI/ML coding problems. Every Problem record carries a full problem statement, Python starter code (templateCode), the Python test script used by the executor (testCode), and a difficulty tier. No authentication is required to read problem data.
problem.getAll
Returns every problem in the database, ordered by creation date (newest first). Each result includes the parent problemSet object so you can display set metadata alongside problems in listing views.
Type: query — Auth: public
Input: none
Response
An array ofProblem objects ordered by createdAt descending. Each element has the following shape:
Unique CUID identifier for the problem.
Display title of the problem (e.g.,
"Implement Sigmoid").URL-safe unique identifier used in routing (e.g.,
"implement-sigmoid").Full problem statement written in Markdown. Stored as
@db.Text.Difficulty tier:
"Easy", "Medium", or "Hard".Python starter code presented to the user in the code editor (
solution.py). Stored as @db.Text.Python verification script run by the FastAPI executor against the user’s submission (
tests.py). Stored as @db.Text.Position of this problem within its parent set. Defaults to
0.Foreign key of the parent
ProblemSet. May be null for standalone problems.The parent problem set record, eagerly loaded via Prisma
include.ISO 8601 timestamp of when the problem was created.
ISO 8601 timestamp of the last update to the problem record.
problem.getBySlug
Fetches a single problem by its unique slug, including the parent problemSet. Returns null if no matching record is found. Use this procedure on the problem detail / editor page to load everything the UI needs in one round-trip.
Type: query — Auth: public
Input: { slug: string }
The URL-safe slug of the problem to fetch (e.g.,
"implement-sigmoid").
Validated by Zod as a non-empty string.Response
A singleProblem object — or null when no record matches the given slug.
Unique CUID identifier for the problem.
Display title (e.g.,
"Implement Sigmoid").URL-safe unique identifier.
Full Markdown problem statement shown to the user in the description panel.
Difficulty tier:
"Easy", "Medium", or "Hard".Python starter code pre-loaded into the editor when the user opens the problem for the first time.
Python test script used internally by the FastAPI executor to validate the user’s solution. Not displayed in the UI.
Integer position within the parent problem set. Defaults to
0.Foreign key of the parent
ProblemSet. May be null for standalone problems.The parent problem set, eagerly loaded.
ISO 8601 creation timestamp.
ISO 8601 last-updated timestamp.
testCode is fetched alongside the problem record but should not be
exposed to users in the browser — avoid rendering it in client components to
prevent cheating. Prefer loading this field only in Server Components or
API routes that interact with the executor.