Skip to content
jeeva-m-21Public

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Lekt logo

Lekt

A reading-native research paper feed and progressive-disclosure paper reader.

Live App · Architecture · Quick Start · Daily Ingest


Lekt turns daily arXiv preprints into a calm, editorial reading feed—combining fast triage on the surface with lossless primary-source depth when a paper earns your attention.

Highlights

  • Hook-First Triage Feed (/): Tight, scannable cards with venue/category metadata, author summary, a 1–2 sentence core hook, reading time, and an inline PMRC (Problem · Method · Results · Limitations) breakdown.
  • Two-Layer Single Paper View (/paper/[id]):
    • Compact Mode: Structured, LLM-curated section guides (3–4 substantive points per section), selected key figures with rationale on an archival #FAF8F4 frame, and first-use-only clickable technical term popovers.
    • Original Mode: Verbatim, lossless ar5iv HTML sections, display/inline KaTeX equations, and extracted <img src> + <object data="...svg"> figures—zero words altered.
    • User-Controlled Disclosure: Toggle Compact | Original globally in the sticky header or inline per section, plus Aa typeface (sans/serif), size (14px/16px/19px), and light/dark theme controls.
  • Two-Speaker Researcher Audio Briefs: On-demand dialogue scripts synthesized into MP3 via edge-tts (Host + Researcher) and cached on the API server.
  • Automated Daily Harvest: A scheduled GitHub Actions workflow (cron: "0 6 * * *") harvests new cs.AI, cs.LG, and cs.CL papers from arXiv OAI-PMH, parses ar5iv HTML, generates compact overlays & embeddings, and upserts them into Postgres.

Architecture

flowchart LR
  GH["GitHub Actions\n(Daily 06:00 UTC Ingest)"] -->|arXiv OAI-PMH + ar5iv| FW["Fireworks AI\n(LLM + Embeddings)"]
  GH -->|Upsert papers & cards| DB[("Supabase Postgres\n+ pgvector")]
  Web["Next.js 15\n(apps/web · Vercel)"] -->|SSR + Client API| API["FastAPI\n(apps/api · Render)"]
  Mobile["Expo\n(apps/mobile)"] -->|REST + SSE Sync| API
  API --> DB
  API -->|Dialogue MP3| TTS["edge-tts\nAudio Cache"]
Loading

Monorepo Structure

Path Stack Purpose
apps/web Next.js 15, Tailwind CSS, KaTeX Editorial feed, /paper/[id] progressive reader, audio player
apps/api FastAPI, SQLAlchemy (async), Alembic Feed ranking (RRF + MMR), ar5iv parser, TTS, SSE sync
apps/mobile Expo / React Native Mobile companion client
packages/shared TypeScript, Zod Shared API contracts & schemas (@lekt/shared)
.github/workflows/daily-ingest.yml GitHub Actions Daily arXiv harvest + full-document pipeline

Quick Start

Prerequisites

  • Node.js 20+ & pnpm 9.15.0
  • Python 3.12+
  • Docker (for local Postgres + pgvector, Redis, and MinIO)

1. Start local infrastructure

docker compose up -d

This starts:

  • Postgres (pgvector/pgvector:pg16) on localhost:55432 (lekt / lekt_dev_password)
  • Redis on localhost:6379
  • MinIO on localhost:9000 (console :9001)

2. Run the FastAPI backend (apps/api)

cd apps/api
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"

# Point DATABASE_URL to the local Docker Postgres instance (port 55432)
export DATABASE_URL="postgresql+asyncpg://lekt:lekt_dev_password@localhost:55432/lekt"
export FIREWORKS_API_KEY="your_fireworks_api_key" # optional for offline/standalone dev

alembic upgrade head
uvicorn app.main:app --host 127.0.0.1 --port 8001 --reload

3. Run the Next.js frontend (apps/web)

From the repository root:

pnpm install
pnpm --filter @lekt/shared build
NEXT_PUBLIC_API_URL=http://127.0.0.1:8001 pnpm --filter @lekt/web dev

Open http://localhost:3000.


Daily Ingest

The .github/workflows/daily-ingest.yml workflow runs daily at 06:00 UTC (and supports manual workflow_dispatch):

  1. Harvests recent arXiv papers (cs.AI, cs.LG, cs.CL) via harvest_and_generate_cards.
  2. Runs process_paper_full_pipeline on new cards to extract verbatim ar5iv sections/equations/figures and generate compact guides + paper-specific glossaries.

Required repository secrets for the workflow:

  • DATABASE_URL — Postgres connection string (postgresql+asyncpg://...)
  • FIREWORKS_API_KEY — Fireworks AI API key

Testing & Verification

# Backend unit & API tests
cd apps/api && .venv/bin/pytest -v

# Shared package & Web typecheck
pnpm --filter @lekt/shared build
cd apps/web && ./node_modules/.bin/tsc --noEmit

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages