Skip to main content

Overview

Rendered from corpus/wiki/overview.md · updated 2026-11-02

This page is generated from the project corpus and rewritten on every docs build. Edit the source in corpus/, not here.

Atrium (renamed from "ebook-reader" in the Atrium brand of 2026-07-20, 2026-07-20) is a personal media gallery with per-user accounts and a shared persistent library — books (PDF/EPUB), music (MP3), and video (MP4/WebM) — plus the things you author: Notes for drawing and writing, and LaTeX for documents you compile and publish.

Since the first LaTeX plan (2026-08-26) the premise has a name (D36): Atrium is a personal cloud space — your stuff, reachable from anywhere. Media you collect plus documents you write, sharing one account model, one design system and one deploy. An account is a household and a profile is a person in it (D35).

Since the Reading Room rework (the work of 2026-08-24, D33) there is one home at /: media kind is a filter chip with a live count, not a destination — which reverses the per-type areas's per-type routes (/books /music /videos survive as redirects). Each kind keeps its native card shape (book 2:3, music square, video 16:9) and now carries a paper tint that signals kind without a badge. A Continue strip leads the page in time remaining, a player dock at the foot survives navigation, and a /-focused field searches the whole library. Notes (2026-07-20) and LaTeX (2026-08-27) stay their own destinations, outside the grid — a notebook is authored, not collected, and the rule generalises to every authored thing.

LaTeX (/latex, D37/D38) is multi-file projects compiled by Atrium's own TypeScript engine — no TeX, no binary — previewed in the existing PDF reader and published into the library as documents that accumulate versions. See latex.md and typeset.md. The name/design evolved but the internal npm scope @ebook-reader/* and the books/library code nouns were kept (see decisions.md D32).

The original reader core is unchanged below:

Upload a PDF or EPUB → it's saved and appears as a cover card in the library → reopen and read it anytime. Access is gated by per-user accounts (operator- seeded, no self-registration — D30); the library itself (files + extracted covers) is shared across users and persists server-side in SQLite (D24). Reading progress + exact resume position are per-user (D31). Other view state (font size, theme, chrome) still lives in Zustand in memory and resets on refresh (D9); the paged/scroll mode persists to localStorage.

What it does​

  1. Library home — upload a PDF/EPUB → backend stores the file, extracts a cover, inserts a row → the book shows as a cover card in a gallery. Reopen anytime; delete when done. This is the front door (was: one-step uploader).
  2. Read PDF — open a library book → renders client-side via react-pdf (PDF.js).
  3. Read EPUB — open a library book → renders natively client-side via react-reader (epub.js), reflowable, Kindle-style.
  4. Convert EPUB→PDF — from the EPUB reader → backend shells out to Calibre → PDF streams back as a download.

The cast (monorepo, npm workspaces)​

  • apps/web — React + Vite frontend. The heart of the app (the reader).
  • apps/api — Node + Fastify backend. Owns the library (SQLite CRUD + file/cover storage on disk) and the stateless POST /convert route.
  • packages/shared — Zod schemas + inferred TS types (convert contract + file validation + library book contract), imported by both apps so they can't drift.

The honest tension we settled​

EPUB→PDF conversion discards reflow (EPUB's best trait), so it is strictly an export/download utility — never the primary reading path. Native EPUB reading stays the star. See decisions.md.

Runs​

Deployed on the production site at /atrium/, behind Ward, the estate's sign-in (D53; D58, not deployed yet, gives atrium its own accounts back with Ward as a second way in): the web app is a static build served by Caddy, and the API runs as a container (infrastructure/Dockerfile, infrastructure/docker-compose.yml) that vps-deploy builds on the VPS. Calibre lives in that image, not on the host. The same image carries the native build tools for better-sqlite3 and sharp.

Locally, npm run dev runs web + api on one origin (D54). Sign in with an account from npm run seed:user; "Sign in with Ward" needs the local Ward container. Calibre is optional on the dev machine: the API warns at startup when ebook-convert is missing, and only Convert fails (D5). Steps are in ../../docs/getting-started.md.