Skip to content

realdegrees/text.ur

Repository files navigation

text.ur logo      University of Regensburg

text.ur

A self-hosted collaborative PDF annotation platform

CI/CD License: MIT Python 3.12+ Node 20+ TypeScript Svelte 5 FastAPI PostgreSQL 16


text.ur is a self-hosted platform for real-time collaborative PDF annotation, created for the Institute of German Studies at the University of Regensburg on behalf of Tatjana Kühnast.

Users create groups, upload PDF documents, and invite collaborators via share links or email. Group members can then highlight text passages, write threaded comments in Markdown, and tag or filter annotations - with live cursors, presence tracking, and instant updates across all connected clients. The application is designed for on-premises deployment and runs entirely on your own infrastructure.

✨ Features

👥 Groups & Share Links

Create a group, upload documents, and invite collaborators via email or share link. Share links require registration by default but can optionally allow anonymous access through temporary, device-bound guest accounts. Guests can later upgrade to persistent accounts, keeping all groups, comments, and data.

🏷️ Tags & Descriptions

Admins can add a per-document description for context and instructions, and define custom, color-coded tags describing the kinds of annotations expected. Tags are assigned to comments for categorization and used as filter criteria.

📝 Annotations & Comments

Highlight text in a PDF to create an annotation anchored to that location. Comments support Markdown and threaded replies. Nearby annotations are intelligently grouped to reduce clutter on busy pages.

📡 Real-Time Sync

Comments, replies, tags, online status, and live cursors sync instantly across all clients with no manual refresh.

📌 Comment Pinning

Pin comments to keep them at the top of the sidebar regardless of scroll position or active filters. Pins are local per user - everyone organizes their own view.

🔍 Comment Filtering

Show or hide comments by tag, author, or any combination. Filters stack to progressively narrow results. Like pins, filters are local per user.

💾 Local Persistence

Comment drafts, pins, and filters persist locally across sessions and reconnects. Lose connection mid-edit? Your text is still there when you come back.

👁️ Visibility Controls

Set individual comments to public, restricted (admins only), or private (author only). Admins can also put entire documents into restricted mode where users only see their own comments - ideal for instructor review.

More

Fine-grained permissions - role-based access control with configurable defaults per group

Self-hosted - Docker Compose behind a reverse proxy on your own infrastructure

Multi-language - English and German out of the box

🛠 Tech Stack

Layer Technology
Frontend SvelteKit, Svelte 5, TailwindCSS 4, PDFSlick
Backend FastAPI, SQLModel, Pydantic, Alembic
Database PostgreSQL 16
Storage MinIO (S3-compatible)
Cache & Pub/Sub Redis 8
Deployment Docker Compose, Gunicorn + Uvicorn

📱 Demo

A live demo version of the stable main branch is available at https://textur.realdegrees.dev.

Caution

This demo version is not guaranteed to be up at all times and may be reset without notice. For a stable, private instance, follow the Deployment Guide to set up your own server or contact the maintainers for assistance.

🚀 Quick Start

Prerequisites: Docker, Python 3.12+, Node.js 20+, pnpm 10

1. Clone and configure

git clone https://github.com/realdegrees/text.ur.git
cd text.ur
cp .env.template .env

Edit .env as needed. The template defaults work for local development. For a full description of all variables see the Environment Variables reference.

2. Start infrastructure

docker compose -f docker-compose.dev.yml up -d

This starts PostgreSQL, Redis, MinIO, and MailHog.

3. Backend

cd backend
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
cd database && alembic upgrade head && cd ..
uvicorn app.main:app --reload --port 8000

API docs are available at http://localhost:8000/api/docs.

4. Frontend (separate terminal)

cd frontend
pnpm install
pnpm dev

The app is available at http://localhost:5173. Captured emails can be viewed at http://localhost:6026 (MailHog).

Tip

The repository includes VS Code launch configurations for debugging both the backend (debugpy) and frontend (Node + Chrome DevTools). See the Deployment Guide for details.

For production deployment, see the Deployment Guide.

📖 Documentation

Document Description
🏗️ Architecture System design, auth flow, WebSocket protocol, access control, type sync pipeline
🚢 Deployment Dev setup, production deployment, reverse proxy, environment variables
⚙️ CI/CD Pipeline Pipeline stages, path filtering, Docker image tagging, local CI checks
🤝 Contributing Development workflow, code style, testing, pull requests
🐍 Backend Project structure, patterns, models, dependencies, testing
🟠 Frontend Project structure, Svelte 5 runes, API client, generated files, i18n
🗄️ Database Migrations, initialization, schema

🤝 Contributing

Contributions are welcome. See the Contributing Guide for development setup, code style conventions, and how to submit changes.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages