Skip to content

R4M-0/previo

Repository files navigation

Previo

Collaborative Markdown + LaTeX writing platform


☕ Support the Project

If you find Previo useful and want to support its development:

👉 https://buymeacoffee.com/r4m0

Your support helps maintain and improve the platform ❤️


Highlights

  • Authentication: Email/password + Google/GitHub OAuth
  • Projects: Markdown/LaTeX editing, import .md/.tex, search, delete
  • Collaboration: Invite by email, accept/deny workflow, shared access
  • Versioning: Snapshot history, diff view, save comments, revert
  • Rendering: Markdown preview/export + LaTeX preview/export (PDF)
  • Workspace: Per-project file/image uploads accessible from LaTeX
  • Workspace References: use /projectId/path/to/file.ext inside Markdown/LaTeX (resolved in preview/export)
  • AI Co-Writer: local Ollama-powered draft generation + in-editor assistant
  • AI Conversations: create/switch/delete conversations with persisted history
  • CLI: Cross-platform previo start <port> / previo stop

Screenshots

Auth

Login

Signup

Projects

New Project

Import Project

Project Editor

Profile

Profile

Collaboration

Collaborators

Version History

Version History

Workspace

Project Workspace

AI Co-Writer

AI Co-Writer

LaTeX Features

LaTeX Autocompletion

Project Structure

previo/
├── backend/
│   ├── db/postgres_service.py
│   ├── latex/
│   ├── markdown/
│   └── requirements.txt
├── ui/
│   ├── app/
│   ├── components/
│   ├── lib/
│   ├── types/
│   └── package.json
├── screenshots/
├── bin/previo.js
└── package.json

Requirements

  • Node.js 18+
  • npm
  • Python 3.10+
  • PostgreSQL 14+ (or Docker Compose)
  • LaTeX compiler (pdflatex)
  • Docker + Docker Compose (recommended for full stack)
  • Ollama (required for AI features)

Quick Start (Recommended)

  1. Clone and enter project:
git clone https://github.com/R4M-0/previo.git
cd previo
  1. Configure .env at repo root (copy from .env.example):
POSTGRES_DB=previo
POSTGRES_USER=previo
POSTGRES_PASSWORD=previo
PREVIO_DATABASE_URL=postgresql://previo:previo@postgres:5432/previo
NEXT_PUBLIC_APP_URL=http://localhost:3000
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
PREVIO_OLLAMA_BASE_URL=http://host.docker.internal:11434
PREVIO_OLLAMA_MODEL=llama3.1:8b
PREVIO_OLLAMA_TIMEOUT_MS=300000
  1. Install and start Ollama on your host machine:
# install (Linux/macOS)
curl -fsSL https://ollama.com/install.sh | sh

# pull a model used by Previo (example default)
ollama pull llama3.1:8b

On Linux, make Ollama reachable from Docker containers:

sudo systemctl edit ollama

Add:

[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"

Then restart:

sudo systemctl daemon-reload
sudo systemctl restart ollama

Quick check:

curl http://localhost:11434/api/tags
  1. Install the CLI once:
npm link
  1. Start app:
previo start 3000
  1. Stop app:
previo stop

Open http://localhost:3000.

Local Development (Without CLI)

UI dependencies

cd ui
npm install

Python dependencies

python3 -m venv .venv
source .venv/bin/activate
pip install -r backend/requirements.txt

Run dev server

cd ui
npm run dev

Open http://localhost:3000.

AI Co-Writer Setup Details

Previo uses Ollama via environment variables only:

  • PREVIO_OLLAMA_BASE_URL: Ollama endpoint reachable by the UI container
  • PREVIO_OLLAMA_MODEL: model name to use for generate/chat
  • PREVIO_OLLAMA_TIMEOUT_MS: timeout per request in milliseconds

Optional tuning variables:

  • PREVIO_OLLAMA_DRAFT_MAX_TOKENS
  • PREVIO_OLLAMA_CHAT_MAX_TOKENS
  • PREVIO_OLLAMA_NUM_CTX
  • PREVIO_OLLAMA_TEMPERATURE
  • PREVIO_OLLAMA_CHAT_MAX_HISTORY

By default, Previo does not hard-cap generation/context for chat and draft quality (unless you set the optional vars above).

Common values:

  • Dockerized app + Ollama on host:
    • PREVIO_OLLAMA_BASE_URL=http://host.docker.internal:11434
  • Non-dockerized local app + Ollama on same machine:
    • PREVIO_OLLAMA_BASE_URL=http://localhost:11434

If AI requests time out often:

  • keep your model warmed up (ollama run <model> once),
  • increase PREVIO_OLLAMA_TIMEOUT_MS (e.g. 420000),
  • use a smaller/faster model.

Docker Notes

  • docker compose up uses docker-compose.override.yml (dev mode with bind mounts)
  • docker compose -f docker-compose.yml up --build uses production image
  • Workspace files are persisted in workspaces_data and available under PREVIO_WORKSPACES_DIR
  • For AI features, Ollama must run on host and be reachable from container (PREVIO_OLLAMA_BASE_URL)

OAuth Callback URLs

  • Google: http://localhost:3000/api/auth/oauth/google/callback
  • GitHub: http://localhost:3000/api/auth/oauth/github/callback

Use a consistent host (localhost recommended).

Main Features

Auth

  • Signup/login with email/password
  • Google OAuth
  • GitHub OAuth
  • Session cookie auth

Projects

  • Create Markdown or LaTeX projects
  • Import existing .md / .tex
  • Search by title/content/format
  • Delete owned projects

Collaboration

  • Invite collaborators by email
  • Accept or deny invitations
  • Shared editing access for accepted members
  • Remote save sync in open editors

Versioning

  • Auto snapshot on save
  • Optional save comments
  • Diff viewer for each version
  • Revert to any previous snapshot

Rendering

  • Markdown preview + HTML export
  • LaTeX preview + PDF export

Workspace

  • Per-project file storage
  • Upload/list/open/delete files
  • Copy and use shorthand references like /projectId/assets/diagram.png
  • Shorthand references are auto-resolved in Markdown/LaTeX preview and export

AI Co-Writer

  • AI draft generation during project creation (description-based)
  • In-editor chat assistant for Markdown and LaTeX
  • Replace suggestions with Approve/Modify workflow
  • Multi-conversation management (new/switch/delete)
  • Conversation history persisted in PostgreSQL

License

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

Additional Docs

About

Collaborative Markdown + LaTeX editor with AI-powered writing assistance.

Resources

License

Stars

11 stars

Watchers

0 watching

Forks

Contributors