Skip to content

devliqht/reverse-rrl

Repository files navigation

Reverse RRL Logo

reverseRL

A local reverse literature search engine paired with a lightweight markdown editor. Select a phrase or paragraph, click Review, and get related work from OpenAlex (scholarly) and Gemini Flash (Google Search grounded) side by side. Includes a private admin dashboard for usage metrics and instant feature toggles.

Features

  • Reverse Literature Search: Feed your writing directly into scholarly APIs (OpenAlex and Semantic Scholar) and Gemini Flash to instantly retrieve reference sources.
  • Resilient Retry Options:
    • Auto-Retry: Semantic Scholar calls use recursive exponential backoff when encountering rate limits (429).
    • Manual Retry: Individual retry buttons for failed search targets directly inside the Results Pane.
    • Campus Network Support: Welcome dialog displays helpful redirection links to the proxy site https://rrl.mattliqht.dev when outbound connections fail Turnstile verification.
  • Local Persistence: Automatically saves your active session, sidebar resizing preferences, and general settings to browser local storage.
  • Dark Mode: Responsive theming mapped to a customized, premium color system.
  • External Resources: Quick library access link integrated inside the sidebar footer.
  • Admin Dashboard: Real-time metrics monitoring, call statistics, and individual switch-off toggles for each external tool.

Stack

Next.js (App Router) · TypeScript · Tailwind v4 · shadcn/ui · CodeMirror 6 · better-sqlite3 · iron-session · OpenAlex · @google/genai

  • Sessions: Stored locally in the browser (localStorage) — no account needed.
  • Metrics + Feature Flags: Kept in SQLite on the server.

Develop

cp .env.example .env.local   # then fill in keys
npm run dev                  # http://localhost:3000
npm test                     # unit checks (abstract reconstruction, rate limiter)

Environment (.env.local)

Var Purpose
OPENALEX_API_KEY OpenAlex key (free at openalex.org/settings/api)
GEMINI_API_KEY Google AI Studio key
GEMINI_MODEL defaults to gemini-flash-latest
ADMIN_PASSWORD admin dashboard password
SESSION_SECRET ≥32 random chars (openssl rand -base64 32)
SQLITE_PATH defaults to ./data/app.db
PORT server port

Admin

Visit /login, enter ADMIN_PASSWORD. Dashboard at /admin shows calls, distinct users, Gemini tokens, latency, errors, recent requests, and on/off switches for each tool (toggles take effect on the next Review instantly).

Deploy (PM2 + Apache, e.g. dcism.org subdomain)

Output is standalone. Build, assemble, and run:

npm ci
npm run build

# standalone server needs static assets beside it
cp -r .next/static .next/standalone/.next/static
cp -r public .next/standalone/public 2>/dev/null || true

# start with secrets sourced from .env.local (kept out of git)
set -a; . ./.env.local; set +a
pm2 start ecosystem.config.js --update-env

Point the subdomain at the Node port via Apache (mod_proxy/mod_rewrite; confirm AllowOverride with your admin). .htaccess:

RewriteEngine On
RewriteRule ^(.*)$ http://127.0.0.1:PORT/$1 [P,L]
# or at vhost level:
# ProxyPass / http://127.0.0.1:PORT/
# ProxyPassReverse / http://127.0.0.1:PORT/

Notes

  • better-sqlite3 is native; npm ci on the host builds/fetches its binary. If the standalone bundle is missing it, copy node_modules/better-sqlite3 into .next/standalone/node_modules/.
  • Subdomain (not subpath) ⇒ no Next.js basePath needed.
  • data/ (SQLite) and .env.local are gitignored.

About

AI-powered reverse literature search engine for academe uses.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages