Assessment Technology
Live System

Pago Quiz Engine

Pago Quiz is a standalone NestJS service built to handle quiz and assessment logic across multiple TecSolPro platforms. It exposes a GraphQL API via Apollo Server, uses TypeORM with MySQL for data persistence, and implements DataLoader to prevent N+1 query problems in nested GraphQL queries. JWT authentication via Passport guards protected resolvers. GraphQL subscriptions handle real-time quiz events. The code-first schema approach means the schema.gql file is auto-generated from TypeScript decorators, keeping the source of truth in the code. We also added Swagger for REST documentation alongside the GraphQL endpoint.

The Result

A reusable, high-performance quiz microservice consumed by multiple TecSolPro platforms through a single GraphQL API.

Build Something Similar
Pa

Tech Stack

NestJS v11TypeScriptGraphQLApollo Server v5TypeORMMySQLJWTDataLoader

4

Modules

8

Technologies

6

Highlights

Project Ecosystem

Applications in This Project.

This project is built as 1 interconnected application, each with a distinct responsibility.

App 01

pago-quize

NestJS v11 / GraphQL

Quiz & assessment microservice

Key Features

What It Does.

Code-first GraphQL schema with Apollo Server v5

DataLoader for N+1 query prevention

GraphQL subscriptions for real-time quiz events

Technology Stack

How It's Built.

Frontend

TypeScript

Backend / API

NestJS v11GraphQLApollo Server v5TypeORMJWT

Database & Cache

MySQL

Services & Infra

DataLoader
Platform Modules

Under the Hood.

Every module shipped in Pago Quiz Engine — what it does and the features it covers.

Module 01

Auth Module

JWT + Passport guards protecting all GraphQL mutations and sensitive queries.

What's Included

  • GraphQL mutations: login, register
  • JWT strategy (jwt.strategy.ts)
  • JwtAuthGuard protecting resolvers
  • bcryptjs password hashing
  • class-validator DTO validation
Module 02

Quiz Management

Create, update, publish, and score quizzes with multiple question types and time limits.

What's Included

  • Quiz CRUD (resolver + service)
  • Multiple question types
  • Scoring rules configuration
  • Time limit settings
  • Quiz publish/draft workflow
Module 03

Assessment & Scoring

Track user attempts, calculate scores, store results with per-question breakdowns, and emit real-time events.

What's Included

  • User attempt tracking
  • Per-question score breakdown
  • Score calculation service
  • GraphQL subscriptions for real-time results
  • DataLoader for N+1 prevention on nested queries
Module 04

Users Module

User entity management with TypeORM repository pattern and Swagger + GraphQL dual documentation.

What's Included

  • Users resolver + service + repository
  • TypeORM user entity
  • GraphQL queries/mutations for user CRUD
  • Swagger REST docs alongside GraphQL
  • NestJS DI module isolation
Technical Highlights

The Interesting Parts.

Key architectural decisions, patterns, and technical details worth knowing.

01

Code-first GraphQL schema: schema.gql auto-generated from TypeScript decorators — always in sync with code

02

DataLoader prevents N+1 query problems in nested GraphQL resolvers — critical for quiz+question+option chains

03

GraphQL subscriptions via subscriptions-transport-ws deliver real-time quiz events to connected clients

04

NestJS modular architecture: auth, users, quizzes, questions each in isolated modules with DI

05

Swagger REST docs exposed alongside the GraphQL endpoint for API consumers who prefer REST

06

bcryptjs password hashing + class-validator DTO validation on every resolver input

Data Models

Core Models & Tables.

The primary database models that power Pago Quiz Engine.

User (TypeORM)

Auth user entity

Quiz

Quiz with scoring rules

Question

Quiz question

Option

Question option/answer

Attempt

User quiz attempt

Score

Per-question score record

Battle-Tested in Production

Want Something Like This?

We've built systems like this before — we know the pitfalls, the patterns that work, and how to scope it correctly from day one.