Scriptor

Role / Services

Full-stack Development & Product Engineering

Industry

EdTech / Academic

Location & Year

Remote © 2026

Scriptor homepage with the headline 'Every note your supervisor would make, anchored to the page' beside a sample logical-errors finding card
Platform

Web (responsive)

Project length

Ongoing

Live since

2026

Main tech stack
Next.js 16TypeScriptSupabasePostgreSQLOpenAITailwind v4pdf.js

About the project

Scriptor - An AI thesis supervisor that anchors every finding to the exact words on the page

Scriptor reviews a student's thesis end to end: it reads the PDF, runs a catalogue of academic checks across it, scores the result, and shows every issue highlighted on the page it came from.

Citation style, argumentation, coherence, logical fallacies, cover page, chapter order, inclusive language, terminology and source density - plus grammar, bibliography verification against live academic databases, a prioritised revision plan, and generated viva questions drawn from the thesis's own weakest ground.

I built it end to end: the PostgreSQL schema and its row-level security, the queue-backed ingestion pipeline, the model layer and its cost accounting, and the entire Next.js 16 App Router frontend - including the PDF viewer that draws per-word highlight overlays.

The problem

A supervisor has weeks of turnaround and a hundred pages to read. Generic AI writing tools answer in seconds but say your citations are inconsistent without ever pointing at one. Neither tells a student what to fix, on which page, in what order, before the deadline. A finding that cannot be located in the source is worse than no finding at all - so Scriptor drops it rather than guessing at a highlight.

Scriptor shown responsive on a laptop and a phone, both displaying the anchored-findings homepage

Features

01Word-anchored findings
02Ten-check analysis suite
03Reference health verification
04Requirements import
05Prioritised revision plan
06Viva defence practice

Technologies used

Frontend
  • Next.js 16 - App Router
  • React Server Components
  • TypeScript (strict)
  • Tailwind CSS v4
  • Radix UI
  • pdf.js
  • TanStack Query & Zustand
  • Recharts & Framer Motion
Backend & Data
  • Supabase - PostgreSQL
  • Row-level security
  • Postgres job queue
  • FOR UPDATE SKIP LOCKED
  • pg_cron & Supabase Vault
  • OpenAI
  • Zod validation
  • Resend
Infrastructure
  • Vercel
  • Supabase Storage
  • Supabase Realtime
  • Database-scheduled cron
  • Vitest

Project goals

The aim was to make automated feedback specific enough to act on. It needed to:

  • -read any thesis PDF and anchor every finding to exact words on the page;
  • -run a catalogue of supervisor-grade checks into one weighted, explainable score;
  • -verify that every source in the bibliography actually exists, with evidence;
  • -turn a completed review into a prioritised revision plan and viva preparation;
  • -keep AI spend measured per analysis rather than invisible.

Development journey

01Phase 1

Schema & ingestion

Designed the PostgreSQL schema - 38 tables, 17 enums, row-level security on every one - and built the four-stage ingestion pipeline: PDF parsing with per-word geometry, structural page classification, and a deterministic compatibility gate that costs no model call.

PostgreSQLRLSPDF ParsingJob Queue
02Phase 2

Analysis engine & anchored viewer

Built the check runner with immutable prompt versioning, the weighted scoring model as a single pure module, and the PDF viewer that draws highlight overlays from stored word coordinates - the feature the whole product rests on.

OpenAIPrompt Versioningpdf.jsScoring
03Phase 3

References & requirements

Bibliography extraction and in-text pairing, five-provider verification with evidence-ranked verdicts, and university requirement files parsed into checks that run beside the standard catalogue.

CrossrefOpenAlexSemantic ScholarDOI Resolution
04Phase 4

Coaching & operations

Revision to-do generation, viva question generation, the notification and digest pipeline, scheduled retention purges, and per-analysis token and cost telemetry with a spend guard on every run.

Task PlanningNotificationsCost TelemetryRetention

Challenges & solutions

Challenge

Making AI output verifiable

Solution

Findings must quote the thesis verbatim. Each quote is resolved against that page's own stored words into a concrete word range at the moment the check runs. Anything that cannot be located is dropped and counted - never approximated.

Challenge

Row-level security at 50,000 rows per thesis

Solution

user_id is denormalised onto every child table and written by BEFORE INSERT triggers that overwrite whatever the client sends, so each policy becomes a single indexed equality check that cannot be forged.

Challenge

Reliable background work on serverless

Solution

A Postgres queue claimed with FOR UPDATE SKIP LOCKED, kicked immediately on enqueue and swept every minute by pg_cron in the database rather than the platform. Handlers are idempotent, and a reaper returns jobs wedged by a crashed worker.

Challenge

Model cost that stays visible

Solution

One module owns every model call and writes token usage; checks are page-scoped so a cover-page check never pays to read the body; prompt caching is measured separately; and a cost guard runs before spend, not after.

Challenge

Keeping a result true to the bytes it read

Solution

A revised draft inserts a new upload row against the same paper and never updates the old one. Entitlements are snapshotted at upload time, so an analysis from last year keeps the terms it was granted - and draft-over-draft comparison stays possible.

Results & impact

38

Tables

Row-level security on every one, across seven aggregates

~50K

Words anchored

Per thesis, each with its own bounding box

10

Academic checks

Versioned prompts feeding one weighted score

5

Verification sources

Evidence-ranked, cheapest signal resolved first

Key learnings

  • -An AI finding that cannot be located in the source is worse than no finding - dropping it is a feature, not a failure.
  • -RLS policy shape sets the performance ceiling long before query tuning does.
  • -Store document geometry in document units; pixels bake in a zoom level and break the viewer at every other scale.
  • -Prompts are versioned data, not code - otherwise you cannot tell whether last month's result would still hold today.
  • -Platform limits belong in the architecture decision, not in a workaround discovered after deploy.
Next case