- Removed deprecated functions related to document parsing and blob storage in blobstore.ts. - Introduced new PDF rendering logic in pdf-preview-renderer.ts and pdf-preview-pdfjs-runtime.ts. - Updated previews-render.ts to utilize the new PDF rendering functions. - Refactored user-whisper-align-job.ts to use the compute-worker client for alignment requests. - Enhanced artifact.ts and operation.ts to validate parsed PDF artifacts and resolve current PDF parses. - Updated snapshot.ts to align with new worker operation types. - Adjusted runtime-config.ts to check for compute-worker availability. - Modified types in parsed-pdf.ts and tts.ts to reflect changes in the compute-worker protocol. - Added unit tests for PDF artifact validation and compute-worker client contract. - Removed obsolete pdf-op-key.vitest.spec.ts test file.
69 lines
4 KiB
Markdown
69 lines
4 KiB
Markdown
---
|
|
title: Stack
|
|
---
|
|
|
|
## Framework
|
|
|
|
- [Next.js](https://nextjs.org/) 15 (App Router, Turbopack in dev)
|
|
- [React](https://react.dev/) 19
|
|
- [TypeScript](https://www.typescriptlang.org/)
|
|
- [pnpm](https://pnpm.io/) workspaces monorepo
|
|
|
|
## Containerization and runtime
|
|
|
|
- [Docker](https://www.docker.com/) (linux/amd64 and linux/arm64)
|
|
- Shared entrypoint that runs DB migrations by default and can bootstrap embedded SeaweedFS before app startup
|
|
|
|
## Next.js client
|
|
|
|
- UI: [Tailwind CSS](https://tailwindcss.com), [Headless UI](https://headlessui.com), [@tailwindcss/typography](https://tailwindcss.com/docs/typography-plugin)
|
|
- Interactions: `react-dnd`, `react-dropzone`
|
|
- Server state: [TanStack Query](https://tanstack.com/query) (React Query v5)
|
|
- Authentication: [Better Auth](https://www.better-auth.com/) client SDK
|
|
- Local storage/cache: [Dexie.js](https://dexie.org/) (IndexedDB)
|
|
- Audio playback: [Howler.js](https://howlerjs.com/)
|
|
- Notifications: `react-hot-toast`
|
|
- Document rendering:
|
|
- PDF: [react-pdf](https://github.com/wojtekmaj/react-pdf), [pdf.js](https://mozilla.github.io/pdf.js/)
|
|
- EPUB: [react-reader](https://github.com/gerhardsletten/react-reader), [epubjs](https://github.com/futurepress/epub.js/)
|
|
- Markdown/Text: [react-markdown](https://github.com/remarkjs/react-markdown), [remark-gfm](https://github.com/remarkjs/remark-gfm)
|
|
- Text preprocessing/matching: [compromise](https://github.com/spencermountain/compromise), [cmpstr](https://github.com/remsky/cmpstr)
|
|
- Analytics: [Vercel Analytics](https://vercel.com/analytics)
|
|
|
|
## Next.js server
|
|
|
|
- APIs: Route Handlers for sync, blob/content access, migrations, audiobook export, TTS/Whisper proxying
|
|
- State sync: request-based today (not realtime push updates)
|
|
- Authentication: [Better Auth](https://www.better-auth.com/) server handlers/adapters with anonymous session support
|
|
- Metadata DB: [Drizzle ORM](https://orm.drizzle.team/) with SQLite (`better-sqlite3`) by default and optional Postgres (`pg`)
|
|
- App tables are manually maintained in Drizzle schema files
|
|
- Auth tables are auto-generated by the [Better Auth](https://www.better-auth.com/) CLI and migrated alongside app tables via Drizzle
|
|
- Blob storage: embedded [SeaweedFS](https://github.com/seaweedfs/seaweedfs) (`weed mini`) by default, or external S3-compatible storage via AWS SDK v3
|
|
- TTS providers: OpenAI-compatible API (`openai` SDK), [Replicate](https://replicate.com/) (`replicate` client), DeepInfra, and custom OpenAI-compatible endpoints — credentials are encrypted at rest
|
|
- Audio pipeline: [ffmpeg](https://ffmpeg.org/) (`ffmpeg-static`) for audiobook assembly, `archiver` for export packaging
|
|
- Utilities: `lru-cache` for in-process caching, `fast-xml-parser` for EPUB/XML parsing, `uuid` for identifier generation, `zod` for schema validation
|
|
|
|
## External compute worker (optional)
|
|
|
|
Standalone worker package:
|
|
|
|
- **`@openreader/compute-worker`** — standalone Node.js compute service containing its private inference and queue runtime
|
|
- ONNX runtime: `onnxruntime-node` with `@huggingface/tokenizers`
|
|
- Whisper alignment: `onnx-community/whisper-base_timestamped` (q4) for word-level timestamps
|
|
- PDF layout: `Bei0001/PP-DocLayoutV3-ONNX` for document block detection and layout parsing
|
|
- PDF rendering: `pdfjs-dist`, `@napi-rs/canvas` for server-side page rasterization
|
|
- Utilities: `jszip`, `ffmpeg-static`
|
|
- HTTP server: [Fastify](https://fastify.dev/) v5 with a versioned OpenAPI contract
|
|
- Job queue + state: [NATS](https://nats.io/) JetStream WorkQueue pull consumers + NATS KV (`jobs.whisper`, `jobs.layout`)
|
|
- Storage: AWS SDK v3 S3 client for reading/writing blobs
|
|
- Logging: [Pino](https://getpino.io/)
|
|
- Validation: [Zod](https://zod.dev/)
|
|
- The Next.js app communicates with the worker only through the versioned HTTP API generated from OpenAPI.
|
|
|
|
## Tooling and testing
|
|
|
|
- ESLint
|
|
- TypeScript
|
|
- [Playwright](https://playwright.dev/) end-to-end tests
|
|
- Drizzle migration/generation scripts
|
|
- [Docusaurus](https://docusaurus.io/) documentation site (`docs-site/`)
|