Skip to main content
Version: Next

Local Development

Prerequisites

Node.js + pnpm (required)
brew install nvm pnpm
mkdir -p ~/.nvm
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.zshrc
echo '[ -s "$(brew --prefix nvm)/nvm.sh" ] && . "$(brew --prefix nvm)/nvm.sh"' >> ~/.zshrc
source ~/.zshrc
nvm install --lts
nvm use --lts
node -v
pnpm -v
SeaweedFS weed binary (required unless using external S3)
brew install seaweedfs
weed version
SeaweedFS Compatibility Note (April 16, 2026)

If you see intermittent S3 InternalError upload failures with embedded storage, use SeaweedFS 4.18. OpenReader currently pins 4.18 in CI and Docker builds while 4.19 compatibility is investigated.

LibreOffice (optional, for DOCX conversion)
brew install libreoffice
whisper.cpp (optional, for word-by-word highlighting)

Install build dependencies:

brew install cmake

Build whisper.cpp:

# clone and build whisper.cpp (no model download needed – OpenReader handles that)
git clone https://github.com/ggml-org/whisper.cpp.git
cd whisper.cpp
cmake -B build
cmake --build build -j --config Release

# point OpenReader to the compiled whisper-cli binary
echo WHISPER_CPP_BIN="$(pwd)/build/bin/whisper-cli"

If you are not on Debian/Ubuntu, install equivalent packages with your distro package manager:

  • Fedora/RHEL: use dnf (gcc gcc-c++ make cmake curl git tar xz)
  • Arch: use pacman (base-devel cmake curl git tar xz)
tip

Set WHISPER_CPP_BIN in your .env to enable word-by-word highlighting.

Steps

Required flow

  1. Clone the repository.
git clone https://github.com/richardr1126/openreader.git
cd openreader
  1. Install dependencies.
pnpm i
  1. Configure the environment.
cp .env.example .env

Then edit .env.

Use one of these .env mode templates:

API_BASE=http://host.docker.internal:8880/v1
API_KEY=none
# Leave BASE_URL and AUTH_SECRET unset to keep auth disabled.
# (Admin panel is unavailable without auth.)
# API_BASE/API_KEY seed a shared default provider if you want shared mode.
Env vars vs. admin panel

On first boot, API_KEY / API_BASE and any NEXT_PUBLIC_* flags you've set get auto-seeded into the admin-managed runtime config (DB-backed, keys encrypted at rest). After that, the admin UI is authoritative and editing those env vars no longer changes app behavior. See Admin Panel.

User BYOK restriction default

If you want each user to enter personal provider credentials, set restrictUserApiKeys=false (from Settings → Admin when auth/admin is enabled, or via legacy first-boot seed NEXT_PUBLIC_RESTRICT_USER_API_KEYS=false for no-admin bootstrap flows).

info

For all environment variables, see Environment Variables.

See Auth for app/auth behavior. See Admin Panel for the shared-provider and feature-flag management UI. Storage configuration details are in Object / Blob Storage. Refer to Database for database modes. Learn about migration behavior and commands in Migrations.

  1. Start the app.
pnpm dev
API Base Reachability

API_BASE must be reachable from the Next.js server process, not just your browser.

Visit http://localhost:3003.

Optional workflows

Run manual DB migrations only for troubleshooting or explicit migration workflows:

  • Migrations run automatically on startup through the shared entrypoint for both pnpm dev and pnpm start.
pnpm migrate
info

If POSTGRES_URL is set, migrations target Postgres; otherwise local SQLite is used. To disable automatic startup migrations, set RUN_DRIZZLE_MIGRATIONS=false and/or RUN_FS_MIGRATIONS=false. You can run storage migration manually with pnpm migrate-fs.