How aprxty3/project-baca works
Project Baca is an offline-first digital reader for public-domain classics. Readers browse a catalog, open and paginate through books, and can save progress; the web client also supports authentication and offline storage. Separate API capabilities include semantic quote discovery, chapter recaps and insight cards, reading streaks and badges, and administration. Admin EPUB jobs are consumed by a Python worker for parsing, chunking, embedding, and publishing. The graph follows documented routes and sampled calls; unsampled feature wiring is intentionally left general.
Main entry points: src/lib.rs REST API · src/lib.rs Web application · mod.rs Web API client · worker.py EPUB worker
Components 25
Reader experience
- Web application
crates/web/src/lib.rs - Catalog pages
crates/web/src/pages/home.rs - Book details
crates/web/src/pages/book.rs - Pagination reader
crates/web/src/pages/reader.rs - Profile and insights
crates/web/src/pages/profile.rs - Browser storage
crates/web/src/storage/mod.rs - Web API client
crates/web/src/api/mod.rs
API and domain
- REST API
crates/server/src/lib.rs - Authentication
crates/server/src/routes/auth.rs - Catalog and reading
crates/server/src/routes/books.rs - Insights and quotes
crates/server/src/routes/insights.rs - Progress and badges
crates/server/src/routes/progress.rs - Admin jobs
crates/server/src/routes/admin.rs
Persistence and services
- Data repositories
crates/infra/src/repositories/mod.rs - Catalog queries
crates/infra/src/repositories/book_repository.rs - Quotes and recaps
crates/infra/src/repositories/quote_repository.rs - Reading activity
crates/infra/src/repositories/progress_repository.rs - Account records
crates/infra/src/repositories/user_repository.rs - PostgreSQL
- Embedding provider
crates/infra/src/ai/embedding.rs
EPUB ingestion
- Redis streams
- EPUB worker
python_worker/worker.py - EPUB object storage
crates/infra/src/storage/s3.rs
Other components
- Reader
- Gemini API
Connections 31
- Reader → Web application: opens
- Web application → Catalog pages: routes to
- Web application → Book details: routes to
- Web application → Pagination reader: routes to
- Web application → Profile and insights: routes to
- Catalog pages → Web API client: requests catalog
- Book details → Web API client: requests details
- Pagination reader → Web API client: syncs progress
- Pagination reader → Browser storage: reads and writes
- Profile and insights → Web API client: requests account data
- Web API client → REST API: calls
- REST API → Authentication: dispatches
- REST API → Catalog and reading: dispatches
- REST API → Insights and quotes: dispatches
- REST API → Progress and badges: dispatches
- REST API → Admin jobs: dispatches
- Authentication → Account records: reads and writes
- Catalog and reading → Catalog queries: queries
- Insights and quotes → Quotes and recaps: queries
- Progress and badges → Reading activity: updates
- Catalog queries → PostgreSQL: queries
- Quotes and recaps → PostgreSQL: queries
- Reading activity → PostgreSQL: reads and writes
- Account records → PostgreSQL: reads and writes
- Admin jobs → EPUB object storage: stores uploads
- Admin jobs → Redis streams: queues jobs
- EPUB worker → Redis streams: consumes jobs
- EPUB worker → EPUB object storage: downloads EPUB
- EPUB worker → PostgreSQL: publishes book data
- EPUB worker → Gemini API: requests embeddings
- Embedding provider → Gemini API: sends embedding requests