Skip to main content
The Judging system includes routers for managing projects, tables, tracks, judging, and time slots.

Project Router

uploadProjects

Type: Mutation
Authentication: Protected (ADMIN role required)
Bulk upload projects for judging.
projects
array
required
Array of project objects
projects[].name
string
required
Project name
projects[].description
string
Project description (defaults to empty string)
Project link/URL (defaults to empty string)
projects[].tracks
string[]
required
Track names this project belongs to
projects[].status
string
Project status (defaults to “Draft”)
Example:
await trpc.project.uploadProjects.mutate([
  {
    name: "Cool App",
    description: "An amazing project",
    link: "https://github.com/user/cool-app",
    tracks: ["General", "Web Development"],
    status: "Active"
  }
]);

createTables

Type: Mutation
Authentication: Protected (ADMIN role required)
Create judging tables based on project distribution.
projectsPerTable
number
required
Number of projects per table (1-25)
Example:
await trpc.project.createTables.mutate({ projectsPerTable: 5 });

getNextProject

Type: Query
Authentication: Protected (ADMIN or JUDGE role required)
Get the next project to judge at a table.
tableId
string
required
Table ID
projectId
string
Specific project ID to retrieve
id
string
Project ID
name
string
Project name
description
string
Project description
Project link
Example:
const nextProject = await trpc.project.getNextProject.useQuery({
  tableId: "table123"
});

getAllProjects

Type: Query
Authentication: Protected
Get all projects for the current DeltaHacks year.
No input parameters
id
string
Project ID
name
string
Project name
Example:
const projects = await trpc.project.getAllProjects.useQuery();

getProjectTimeSlots

Type: Query
Authentication: Protected
Get all time slots for a specific project.
projectId
string
required
Project ID
startTime
datetime
Slot start time
endTime
datetime
Slot end time
table
object
Table information including track
Example:
const slots = await trpc.project.getProjectTimeSlots.useQuery({
  projectId: "proj123"
});

Table Router

getTables

Type: Query
Authentication: Protected
Get all judging tables for the current year.
No input parameters
id
string
Table ID
number
number
Table number
track
object
Associated track information
Example:
const tables = await trpc.table.getTables.useQuery();

getTableProjects

Type: Query
Authentication: Protected
Get all projects assigned to a table, with judging status.
tableId
string
required
Table ID
id
string
Project ID
name
string
Project name
isJudged
boolean
Whether current user has judged this project
TimeSlot
array
Time slots for this project at this table
Example:
const projects = await trpc.table.getTableProjects.useQuery({
  tableId: "table123"
});

Track Router

getTracks

Type: Query
Authentication: Protected
Get all judging tracks for the current year.
No input parameters
id
string
Track ID
name
string
Track name
dhYear
string
DeltaHacks year
Example:
const tracks = await trpc.track.getTracks.useQuery();

createTrack

Type: Mutation
Authentication: Protected (ADMIN role required)
Create a new judging track.
name
string
required
Track name
Example:
await trpc.track.createTrack.mutate({ name: "AI/ML" });

Judging Router

createJudgingResult

Type: Mutation
Authentication: Protected (ADMIN or JUDGE role required)
Submit or update judging scores for a project.
projectId
string
required
Project ID
tableId
string
required
Table ID
responses
array
required
Array of rubric responses
responses[].questionId
string
required
Rubric question ID
responses[].score
number
required
Score (minimum 0)
Example:
await trpc.judging.createJudgingResult.mutate({
  projectId: "proj123",
  tableId: "table456",
  responses: [
    { questionId: "q1", score: 8 },
    { questionId: "q2", score: 9 }
  ]
});

getProjectScores

Type: Query
Authentication: Protected (ADMIN or JUDGE role required)
Get current user’s existing scores for a project.
projectId
string
required
Project ID
questionId
string
Rubric question ID
score
number
Assigned score
Example:
const scores = await trpc.judging.getProjectScores.useQuery({
  projectId: "proj123"
});

createRubricQuestion

Type: Mutation
Authentication: Protected (ADMIN role required)
Create a new rubric question for a track.
question
string
required
Question text
points
number
required
Maximum points (0-100)
title
string
required
Question title
trackId
string
required
Track ID this question belongs to
Example:
await trpc.judging.createRubricQuestion.mutate({
  title: "Innovation",
  question: "How innovative is this project?",
  points: 10,
  trackId: "track123"
});

getRubricQuestions

Type: Query
Authentication: Protected (ADMIN or JUDGE role required)
Get all rubric questions for a track.
trackId
string
required
Track ID
Example:
const questions = await trpc.judging.getRubricQuestions.useQuery({
  trackId: "track123"
});

getLeaderboard

Type: Query
Authentication: Protected (ADMIN role required)
Get project leaderboard with scores.
trackId
string
Filter by track ID
projectId
string
Project ID
projectName
string
Project name
Project link
score
number
Average total score
numberOfJudges
number
Number of judges who scored this project
trackName
string
Track name
Example:
const leaderboard = await trpc.judging.getLeaderboard.useQuery({
  trackId: "track123" // optional
});

importRubricQuestions

Type: Mutation
Authentication: Protected (ADMIN role required)
Bulk import rubric questions for multiple tracks.
questions
object
required
Object mapping track names to question arrays
Example:
await trpc.judging.importRubricQuestions.mutate({
  questions: {
    "General": [
      { title: "Innovation", question: "How innovative?", points: 10 },
      { title: "Design", question: "How well designed?", points: 10 }
    ],
    "Web Dev": [
      { title: "UX", question: "User experience quality?", points: 15 }
    ]
  }
});

Time Slot Router

getTableTimeSlots

Type: Query
Authentication: Protected (ADMIN or JUDGE role required)
Get all time slots for a table.
tableId
string
required
Table ID
startTime
datetime
Slot start time
endTime
datetime
Slot end time
project
object
Project information
Example:
const slots = await trpc.timeSlot.getTableTimeSlots.useQuery({
  tableId: "table123"
});

createTimeSlots

Type: Mutation
Authentication: Protected (ADMIN role required)
Generate time slots for all tables and projects.
slotDurationMinutes
number
required
Duration of each slot in minutes (minimum 1, default 10)
startTime
datetime
required
Start time for judging (ISO 8601 format)
message
string
Success message
endTime
datetime
Calculated end time of judging
numTables
number
Number of tables scheduled
Example:
const result = await trpc.timeSlot.createTimeSlots.mutate({
  slotDurationMinutes: 10,
  startTime: "2024-01-20T10:00:00Z"
});

getAllTimeSlots

Type: Query
Authentication: Protected (ADMIN or JUDGE role required)
Get all distinct time slots.
No input parameters
startTime
datetime
Slot start time
endTime
datetime
Slot end time
Example:
const allSlots = await trpc.timeSlot.getAllTimeSlots.useQuery();

getAssignmentsAtTime

Type: Query
Authentication: Protected (ADMIN role required)
Get table-to-project assignments at a specific time.
time
string
required
Time in ISO format
[tableId]
object
Object mapping table IDs to project info
Example:
const assignments = await trpc.timeSlot.getAssignmentsAtTime.useQuery({
  time: "2024-01-20T10:00:00Z"
});
// Returns: { "table1": { id: "proj1", name: "Cool App" }, ... }

Build docs developers (and LLMs) love