Case study · 01 / 03

The ResearchHub workspace overview: sidebar navigation, a question box that asks across five sources, recent documents and recent AI activity.

ResearchHub — case study

Source-grounded collaborative AI workspace for students and researchers.

Status

Active development

My role

Sole contributor to the repository.

Repository

Public

Shown as

Screenshots and source

Canonical URL

igorkadziela.dev/projects/researchhub

01

Project overview

A shared workspace where a group collects sources, writes a report and asks an AI that stays grounded in those sources. Charts, tables, calculations and generated claims keep provenance back to the source file, fragment, dataset or executed analysis.

Status
Active development
Source
Public repository
02

Problem

Research material lives in many formats (PDFs, DOCX files, spreadsheets, datasets) while the report is written somewhere else. When an AI assistant answers without pointing back to that material, its claims cannot be checked, and a chart or table cannot be tied to the data that produced it. ResearchHub starts from the opposite premise: every generated claim and every computed result stays traceable to its source.

03

Product and users

For: students and researchers working in teams. What the workspace lets them do:

  • Add PDFs, DOCX files, spreadsheets and datasets as versioned sources
  • Ask questions answered only from the selected sources, with traceable citations
  • Write a shared report together in realtime, with comments on selected text
  • Inspect a dataset and run computations in an isolated sandbox
  • Insert computed tables and charts into the report with provenance back to the exact inputs
04

My contribution

GitHub lists a single contributor for this repository: me. The Spring Boot backend, the React frontend, the Python worker, the infrastructure code and the documentation are my own work.

Backend
Spring Boot modular monolith: workspace authorization, durable PostgreSQL-backed job dispatch, a structured model gateway with audited calls.
Frontend
React and TypeScript: workspace, source pages, the collaborative report editor with comments, and analysis results.
AI / data worker
Internal Python FastAPI worker for source extraction, chunking and embeddings, plus the pinned scientific sandbox image.
Quality and delivery
Coverage gates, architecture decision records, Bicep infrastructure with offline validation, a one-command local demo.
05

Architecture

A Spring Boot modular monolith owns product logic, authorization and a durable job dispatcher backed by PostgreSQL. An internal Python worker extracts, chunks and embeds sources; Spring indexes the chunks in pgvector. Realtime editing runs in a separate Hocuspocus service that uses short-lived credentials issued by Spring.

Browser
React · TypeScript · TanStack Query
Tiptap / ProseMirror · Yjs

React · TypeScript
Tiptap · Yjs
Hocuspocus
Realtime collaboration server
Credentials issued by Spring

Realtime sync
Yjs documents
Spring Boot API
Java 25 · Spring Boot 4.1
Authorization · job dispatcher · model gateway

Java 25 · Boot 4.1
Auth · dispatcher
FastAPI worker (internal)FastAPI worker
Python 3.13 · extraction
Chunking · embeddings

Python 3.13
Ingest · embeddings
PostgreSQL + pgvectorPostgreSQL
Sessions · quotas · job queue
Documents · vector search

+ pgvector
State · vectors
Azure Blob Storage / AzuriteBlob Storage
Versioned source files
Azurite for local runs

Azure / Azurite
Source files
Arrows: documented calls between components. Schematic only; the blob store is used by the Spring backend, and generated analysis code runs in a separate Docker sandbox.Arrows: documented calls. Schematic only.

Spring owns everything with product meaning: who may see a workspace, which job runs next, what a citation points at. Python owns the AI, data and scientific work and is only ever called by Spring, so the Java domain never depends on that ecosystem.

06

Key engineering challenges

  1. Keeping claims traceable

    Generated text must stay linked to the exact source chunks it relies on, across versioned sources, and a question with no supporting evidence must say so.

  2. Running generated code safely

    Analyses execute in a pinned Docker sandbox with limits, durable execution records and reruns that preserve earlier evidence.

  3. Realtime collaborative editing

    Shared documents on Yjs, Hocuspocus and Tiptap. Every accepted edit is committed before it is broadcast, and the state is stored atomically in PostgreSQL.

  4. Authorization and workspace boundaries

    Access to sources, documents and AI features is scoped by workspace and enforced by the server, including calls between internal services.

07

Technical decisions and trade-offs

DecisionWhyTrade-off
Spring modular monolith, with Python only for AI and data workProduct logic and authorization stay in one place, while extraction, embeddings and scientific computation use the Python ecosystem.Two runtimes and an internal contract to maintain.
Durable processing in PostgreSQL (ADR-011)Sessions, quotas and job dispatch share one transactional store, with no extra infrastructure.No Redis or Service Bus. Scaling evidence is limited to recorded local two-instance tests.
Immutable source versions (ADR-005)A citation or an analysis can always be traced to the exact bytes it used.No complete retention or erasure workflow yet; it is proposed in ADR-014.
Docker sandbox for generated analysis code (ADR-008)Filesystem, network and resource limits around execution, with results that can be reproduced.Local isolation does not prove isolation on Azure. A cloud runner is only proposed (ADR-015).
Azure as Bicep infrastructure code, validated offline (ADR-017)A reproducible definition of the infrastructure without paying for a standing cloud environment.No subscription deployment is recorded, so there is no claim of cloud availability.
08

Stack

Backend & AI worker

  • Java 25
  • Spring Boot 4.1
  • Maven
  • Flyway
  • Python 3.13
  • FastAPI

Frontend & realtime

  • React
  • TypeScript
  • Webpack
  • TanStack Query
  • Tiptap / ProseMirror
  • Yjs
  • Hocuspocus

Data & infrastructure

  • PostgreSQL 17
  • pgvector
  • Azure Blob Storage / Azurite
  • Docker
  • Bicep (Azure IaC)
09

Testing and quality

Integration tests run against real PostgreSQL 17 and Azurite containers (Testcontainers), and line-coverage gates are enforced per module. The repository itself states that it is not production-ready.

Coverage gates
At least 80% line coverage, enforced separately for the source-processing, AI / retrieval and analysis modules (Maven) and for the Python worker (pytest).
Kinds of tests
Java integration tests with Testcontainers, pytest for the worker, Jest for the frontend, browser end-to-end checks, and opt-in sandbox attack and cleanup tests.
Evidence limits
Local runs only. No hosted release, no live Azure validation and no production claim.
10

Screenshots

Pinned screenshots from a local run of the project. It is not deployed, so there is no live demo.

The ResearchHub workspace overview: sidebar navigation, a question box that asks across five sources, recent documents and recent AI activity.
Workspace overview in a local run with synthetic data: ask across five sources, recent documents and AI activity.
The synthetic RC lab report is open beside the workspace source list and document outline.
Local synthetic lab: the shared report and workspace sources in one view.
Three immutable uploads of a synthetic CSV appear in version history, each with a download action.
Three real uploads; every version remains downloadable.
A synthetic CSV preview shows sample rows, a sheet tab, inferred types, one missing cell and Analyze this data.
Synthetic CSV: bounded preview, inferred types and a missing temperature value.
The CSV column profile lists inferred types and exact missing-value counts for all four columns.
The synthetic CSV profile records one missing temperature value out of four rows.
Beside the report, a research conversation answers the time-constant question with links to source fragments.
A source-linked answer beside the report. Deterministic fixture AI.
Beside the report, the research panel says the sources contain no evidence about room humidity.
Unrecorded humidity returns insufficient evidence. Deterministic fixture AI.
A saved RC discharge chart appears beside its accepted plan, code hash and recorded sandbox runtime.
Real sandbox output and recorded runtime; deterministic fixture AI supplied the plan.
The saved analysis shows its exact workbook version, run history, source hash and accepted plan.
Saved input version, run history and plan. Deterministic fixture AI plan.
The report shows an anchored review thread, a reply and a second signed-in editor’s cursor.
An anchored review thread and cursor from two real local editor sessions.
11

Source code