Skip to main content

Overview

The PyqDeck API is a RESTful API built with Express.js. It is documented using OpenAPI 3.0 and serves as the source of truth for the generated frontend SDK.

Swagger UI

The live API documentation (Swagger UI) is available at: https://backend.pyqdeck.in/api-docs

SDK Generation Flow

We follow an API-first approach:
  1. Backend: Routes are annotated with JSDoc @swagger.
  2. Export: pnpm run openapi:export generates backend/openapi.json.
  3. Frontend: pnpm run gen:api consumes openapi.json and generates frontend/src/lib/api-generated.ts.
For a deep-dive into this flow, see the SDK Flow documentation.

Authentication

Most endpoints require authentication via Clerk.
  • Header: Authorization: Bearer <clerk_jwt_token>
  • Internal Handling: The requireAuthentication middleware validates the token.

Main Resource Groups

GroupDescription
UniversitiesManagement of university entities.
SubjectsAcademic subject catalog and offerings.
PapersQuestion papers, years, and metadata.
QuestionsIndividual questions, types, and difficulties.
SolutionsStep-by-step solutions for questions.
UsersUser profiles and role management.