Skip to main content

Documentation 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.

The problemSetRouter provides two public query procedures for listing and retrieving AI/ML problem sets. Problem sets are curated collections of coding challenges grouped by topic (e.g., NumPy fundamentals, ML model training). No authentication is required to call either procedure.

problemSet.getAll

Returns every problem set in the database, ordered by creation date (newest first). Each record includes a _count.problems field so you can display problem counts without fetching the full problem list. Type: query — Auth: public Input: none
import { api } from '~/trpc/server';

const sets = await api.problemSet.getAll();
// sets[0]._count.problems => number of problems in the set

Response

An array of ProblemSet objects. Each element has the following shape:
id
string
required
Unique CUID identifier for the problem set.
title
string
required
Human-readable title of the problem set (e.g., "NumPy Fundamentals").
slug
string
required
URL-safe unique identifier used in routing (e.g., "numpy-fundamentals").
description
string | null
Optional longer description of the problem set. Stored as full text; may be null.
createdAt
DateTime
required
ISO 8601 timestamp of when the problem set was created.
updatedAt
DateTime
required
ISO 8601 timestamp of the last update to the problem set record.
_count
object
required
Prisma aggregation object included on every result.

problemSet.getBySlug

Fetches a single problem set by its unique slug, including the full ordered list of problems that belong to it. Returns null if no matching record is found. Type: query — Auth: public Input: { slug: string }
slug
string
required
The URL-safe slug of the problem set to fetch (e.g., "numpy-fundamentals"). Validated by Zod as a non-empty string.
import { api } from '~/trpc/server';

const set = await api.problemSet.getBySlug({ slug: 'numpy-fundamentals' });

if (!set) {
  notFound();
}

// set.problems is ordered by `order` ascending

Response

A single ProblemSet object — or null when no record matches the given slug.
id
string
required
Unique CUID identifier for the problem set.
title
string
required
Human-readable title (e.g., "NumPy Fundamentals").
slug
string
required
URL-safe unique identifier.
description
string | null
Optional full-text description of the problem set.
createdAt
DateTime
required
ISO 8601 creation timestamp.
updatedAt
DateTime
required
ISO 8601 last-updated timestamp.
problems
Problem[]
required
Ordered list of problems that belong to this set (orderBy: { order: 'asc' }).
getBySlug uses Prisma’s findUnique, so it performs a single indexed lookup on the slug column. The included problems array is sorted by order ascending, reflecting the intended curriculum sequence.

Build docs developers (and LLMs) love