quill

OpenPrism Logo # OpenPrism ### OpenPrism โ€” Vibe Writing for Academia [![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE) [![GitHub Stars](https://img.shields.io/github/stars/OpenDCAI/OpenPrism?style=social)](https://github.com/OpenDCAI/OpenPrism/stargazers) [![GitHub Forks](https://img.shields.io/github/forks/OpenDCAI/OpenPrism?style=social)](https://github.com/OpenDCAI/OpenPrism/network/members) [![GitHub Issues](https://img.shields.io/github/issues/OpenDCAI/OpenPrism)](https://github.com/OpenDCAI/OpenPrism/issues) [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/OpenDCAI/OpenPrism)](https://github.com/OpenDCAI/OpenPrism/pulls) [ไธญๆ–‡](README_ZH.md) | [English](/) --- ### โœจ Highlights | ๐Ÿค– AI Assistant | โœ๏ธ Compile & Preview | ๐Ÿ“š Templates | |:---:|:---:|:---:| | Chat / Agent history
Tools multi-step edits | TexLive / Tectonic / Auto
PDF preview & download | ACL / CVPR / NeurIPS / ICML
One-click conversion | | ๐Ÿ”„ Template Transfer | | | |:---:|:---:|:---:| | Legacy (LaTeXโ†’LaTeX) / MinerU (PDFโ†’MDโ†’LaTeX)
LLM-powered migration + auto compile fix + VLM layout check | | | | ๐Ÿ”ง Advanced Editing | ๐Ÿ—‚๏ธ Project Management | โš™๏ธ Configuration | |:---:|:---:|:---:| | AI autocomplete / Diff / diagnose | Multi-project + file tree + upload | OpenAI-compatible endpoint
Local-first privacy | | ๐Ÿ” Search | ๐Ÿ“Š Charting | ๐Ÿง  Recognition | |:---:|:---:|:---:| | WebSearch / PaperSearch | Chart from tables | Formula/Chart recognition | | ๐Ÿ‘ฅ Collaboration | ๐Ÿ“ Peer Review | | |:---:|:---:|:---:| | Multi-user real-time editing
Cursor sync & online management | AI Review Report / Consistency
Missing Citations / Compile Summary | | --- Quickstart Features Contributing WeChat

๐Ÿ“ข News

[!WARNING] ๐Ÿšง Template Transfer is under testing
The Template Transfer feature is currently in beta and may contain known or unknown bugs. If you encounter any issues, please report them via Issues.

[!TIP] ๐Ÿ†• 2025-02 ยท Template Transfer (Dual Mode)
Two transfer modes are now available: Legacy mode (LaTeXโ†’LaTeX direct migration) and MinerU mode (PDFโ†’Markdownโ†’LaTeX via MinerU API). Both modes feature LLM-powered content migration, automatic compile error fixing, and optional VLM-based layout checking.

[!TIP] ๐Ÿ†• 2025-02 ยท Real-time Collaboration
Multi-user simultaneous editing is now available, powered by CRDT with automatic conflict resolution and cursor sync. Current version requires a server with a public IP; invite remote collaborators via token-based links.



OpenPrism Home
โœจ Home preview: three-panel workspace + editor + preview


โœจ Core Features

OpenPrism is a local-first LaTeX + AI workspace for academic writing, optimized for fast editing, controlled changes, and privacy.

๐Ÿค– AI Assistant

โœ๏ธ Compile & Preview

๐Ÿ“š Template System

๐Ÿ”„ Template Transfer

๐Ÿ—‚๏ธ Project Management

โš™๏ธ Configuration

๐Ÿ” Search & Reading

๐Ÿ“Š Charts & Recognition

๐Ÿ“ Peer Review

๐Ÿ‘ฅ Real-time Collaboration


๐ŸŽจ Showcase

๐Ÿ–ฅ๏ธ Three-Panel Workspace


Three-panel workspace
โœจ AI Assistant | LaTeX Editor | PDF Preview

โœ๏ธ Editor View


Editor view
โœจ Synchronized editing and preview

๐Ÿค– Agent Mode


Agent mode
โœจ Generate diff suggestions for review

๐Ÿงช One-Click Diagnose


One-click diagnose
โœจ Parse compile errors and jump to locations

๐ŸŒ WebSearch


WebSearch
โœจ Online search with concise summaries

๐Ÿ“„ PaperSearch


PaperSearch
โœจ Academic search and citation info

๐Ÿ“Š Table-to-Chart


Chart generation
โœจ Turn tables into charts in one step

๐Ÿง  Formula/Chart Recognition


Formula recognition
โœจ Recognize structures for editable outputs

๐Ÿ”ง AI Autocomplete


AI autocomplete
โœจ Option/Alt + / to trigger, Tab to accept

๐Ÿ“ Peer Review


Peer Review
โœจ AI Quality Check: Review Report / Consistency Check / Missing Citations / Compile Summary

๐Ÿ‘ฅ Real-time Collaboration


Real-time Collaboration
โœจ Multi-user real-time collaborative editing with cursor sync and online user management


๐Ÿš€ Quick Start

๐Ÿ“‹ Requirements

Basic Environment

LaTeX Compilation Environment (Required)

OpenPrism requires a LaTeX engine to generate PDFs. Choose one of the following options based on your OS:

Option 1: TexLive (Recommended)

Option 2: Tectonic (Lightweight)

Note: TexLive full installation is ~5-7GB, Tectonic is lighter but with fewer features. TexLive is recommended for Linux servers.

๐Ÿ“ฆ Install & Run

Development Deployment

# 1. Clone repository
git clone https://github.com/OpenDCAI/OpenPrism.git
cd OpenPrism

# 2. Install dependencies
npm install

# 3. Start dev server (frontend + backend)
npm run dev

Access:

Production Deployment

# 1. Build frontend and backend
npm run build

# 2. Start production server
npm start

Complete Linux Server Deployment Example

# 1. Install Node.js (Ubuntu example)
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs

# 2. Install TexLive
sudo apt-get update
sudo apt-get install -y texlive-full

# 3. Verify installation
node --version  # Should show >= 18.0.0
pdflatex --version  # Should show TexLive version

# 4. Clone and deploy project
git clone https://github.com/OpenDCAI/OpenPrism.git
cd OpenPrism
npm install
npm run build

# 5. Configure environment variables (optional)
cat > .env << EOF
OPENPRISM_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
OPENPRISM_LLM_API_KEY=your-api-key
OPENPRISM_LLM_MODEL=gpt-4o-mini
OPENPRISM_DATA_DIR=/var/openprism/data
PORT=8787
EOF

# 6. Start service
npm start

# 7. Use PM2 for process management (recommended)
sudo npm install -g pm2
pm2 start npm --name "openprism" -- start
pm2 save
pm2 startup

โš™๏ธ Configuration

Environment Variables

Create a .env file in the project root (optional):

# LLM Configuration
OPENPRISM_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
OPENPRISM_LLM_API_KEY=your-api-key
OPENPRISM_LLM_MODEL=gpt-4o-mini

# Data storage path
OPENPRISM_DATA_DIR=./data

# Backend service port
PORT=8787

# MinerU API Configuration (for PDFโ†’MDโ†’LaTeX transfer)
OPENPRISM_MINERU_API_BASE=https://mineru.net/api/v4
OPENPRISM_MINERU_TOKEN=your-mineru-token

LLM Configuration

OpenPrism supports any OpenAI-compatible endpoint, including custom base_url:

Method 1: Environment Variables

# .env file
OPENPRISM_LLM_ENDPOINT=https://api.openai.com/v1/chat/completions
OPENPRISM_LLM_API_KEY=sk-your-api-key
OPENPRISM_LLM_MODEL=gpt-4o-mini

Method 2: Frontend Settings Panel


Model Configuration Settings
โœจ LLM Configuration Settings Panel

Supported Third-party Services:

LaTeX Compilation Configuration

Supported Compilation Engines:

Configuration Method:

  1. Select compilation engine in frontend โ€œSettingsโ€ panel
  2. Set to โ€œAutoโ€ for automatic fallback to available engines
  3. Customize TexLive resource path

Data Storage Configuration

Default data storage is in ./data directory, can be modified via environment variable:

# Custom data directory
OPENPRISM_DATA_DIR=/var/openprism/data

Directory Structure:

data/
โ”œโ”€โ”€ projects/           # User projects
โ”‚   โ”œโ”€โ”€ project-1/
โ”‚   โ”‚   โ”œโ”€โ”€ main.tex
โ”‚   โ”‚   โ””โ”€โ”€ references.bib
โ”‚   โ””โ”€โ”€ project-2/
โ””โ”€โ”€ templates/          # Template cache

๐Ÿ‘ฅ Collaboration Guide

OpenPrism includes a built-in real-time collaboration system based on CRDT (Yjs) + WebSocket, allowing multiple users to edit the same document simultaneously without any third-party service.

Collaboration Environment Variables

Add the following to your .env file:

# Token signing secret (must change for production)
OPENPRISM_COLLAB_TOKEN_SECRET=your-secure-random-string

# Require token for collaboration (default: true, set false for local dev)
OPENPRISM_COLLAB_REQUIRE_TOKEN=true

# Token TTL in seconds (default: 86400 = 24 hours)
OPENPRISM_COLLAB_TOKEN_TTL=86400

How to Use

  1. Deploy: Deploy OpenPrism to a server with a public IP, configure a domain and HTTPS
  2. Generate invite: Click โ€œGenerate Invite Linkโ€ in the collaboration panel on the editor page
  3. Share link: Send the generated link to your collaborator
  4. Join: Collaborator opens the link, token is verified automatically, and they enter the editor
  5. Edit together: Multiple cursors visible in real time, edits sync automatically, conflicts resolved by CRDT
Nginx Reverse Proxy (Recommended, For Public Servers) Collaboration requires WebSocket. Nginx must be configured with upgrade headers: ```nginx server { listen 443 ssl; server_name your-domain.com; location / { proxy_pass http://127.0.0.1:8787; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; } } ``` > **Tip**: Local access (127.0.0.1) bypasses token verification by default, suitable for local development.
No Public Server? Use Tunnel (ngrok) You can collaborate remotely without a public server. OpenPrism has built-in tunnel support โ€” one command exposes your local service to the internet. #### Quick Start (ngrok, Recommended) 1. Sign up for a free [ngrok](https://dashboard.ngrok.com/get-started/your-authtoken) account and get your authtoken 2. Run the following commands: ```bash export NGROK_AUTHTOKEN=your_token_here npm run tunnel:ngrok ``` 3. On startup, the terminal prints a public URL. Share it with your collaborator: ``` OpenPrism started at http://localhost:8787 Tunnel active (ngrok): Public URL: https://xxxx.ngrok-free.app Share this URL to collaborate remotely! ``` 4. Your collaborator opens the URL in their browser and starts editing in real-time #### Other Tunnel Options | Option | Command | Notes | |--------|---------|-------| | localtunnel | `npm run tunnel` | Zero-config, but may be unstable | | Cloudflare Tunnel | `npm run tunnel:cf` | Requires [cloudflared](https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/installation/) installed | > **Note**: Tunnel is off by default. Regular `npm start` does not create a tunnel. You can also set it via env var: `OPENPRISM_TUNNEL=ngrok npm start`

๐ŸŽฏ Usage Guide (Quick)

  1. Create Project: Create new project in Projects panel and select template
  2. Write Paper: Edit LaTeX in Files tree
  3. AI Edits: Switch to Agent / Tools, generate diff and confirm
  4. Compile & Preview: Click โ€œCompile PDFโ€, preview on right side
  5. Export PDF: Click โ€œDownload PDFโ€ in preview toolbar

๐Ÿ“ Project Structure

OpenPrism/
โ”œโ”€โ”€ apps/
โ”‚   โ”œโ”€โ”€ frontend/           # React + Vite frontend
โ”‚   โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app/App.tsx    # Main application logic
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app/TransferPanel.tsx  # Template transfer UI
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api/client.ts  # API calls
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ latex/         # TexLive integration
โ”‚   โ””โ”€โ”€ backend/            # Fastify backend
โ”‚       โ””โ”€โ”€ src/
โ”‚           โ”œโ”€โ”€ index.js       # API / compile / LLM proxy
โ”‚           โ”œโ”€โ”€ routes/transfer.js  # Transfer API endpoints
โ”‚           โ””โ”€โ”€ services/
โ”‚               โ”œโ”€โ”€ mineruService.js        # MinerU API integration
โ”‚               โ””โ”€โ”€ transferAgent/          # LangGraph transfer workflows
โ”‚                   โ”œโ”€โ”€ graph.js            # Legacy transfer graph
โ”‚                   โ”œโ”€โ”€ graphMineru.js       # MinerU transfer graph
โ”‚                   โ”œโ”€โ”€ state.js            # Transfer state schema
โ”‚                   โ””โ”€โ”€ nodes/              # Workflow nodes
โ”œโ”€โ”€ templates/              # LaTeX templates (ACL/CVPR/NeurIPS/ICML)
โ”œโ”€โ”€ data/                   # Project storage directory (default)
โ””โ”€โ”€ README.md

๐Ÿ—บ๏ธ Roadmap

Feature Status Description
๐Ÿ‘ฅ Real-time Collaboration Done Multi-user real-time editing with cursor sync and online user management (currently requires a server with public IP)
๐ŸŒ Serverless Collaboration Planned Local collaboration without a public server: โ‘  built-in tunnel integration (ngrok / Cloudflare Tunnel) to expose local services in one click; โ‘ก WebRTC-based P2P direct connection without third-party relay
๐Ÿ” Enhanced WebSearch Planned Integrate third-party Search APIs (e.g. Google / Baidu / SerpAPI) for improved search quality and coverage
๐Ÿ“š Template Transfer (Dual Mode) Done Legacy (LaTeXโ†’LaTeX) and MinerU (PDFโ†’MDโ†’LaTeX) dual-mode template transfer with LLM-powered migration, auto compile fix, and VLM layout check
๐Ÿ“ธ Version Snapshots & Rollback Planned Project version management with snapshot saving and one-click rollback
๐Ÿ“– Citation Search Assistant Planned Auto-search related papers and generate BibTeX citations

๐Ÿค Contributing

Welcome to submit Issues or PRs:

  1. Fork the repository
  2. Create a new branch
  3. Commit your changes
  4. Submit a PR

Development commands:

npm run dev
npm run dev:frontend
npm run dev:backend
npm run build

๐Ÿ“„ License

MIT License. See LICENSE.


๐Ÿ™ Acknowledgments


**If this project helps you, please give us a โญ๏ธ Star!** [![GitHub stars](https://img.shields.io/github/stars/OpenDCAI/OpenPrism?style=social)](https://github.com/OpenDCAI/OpenPrism/stargazers) [![GitHub forks](https://img.shields.io/github/forks/OpenDCAI/OpenPrism?style=social)](https://github.com/OpenDCAI/OpenPrism/network/members)
OpenPrism WeChat Community
Scan to join the community WeChat group

Made with โค๏ธ by OpenPrism Team