How renan-gimenez/librarium works
Librarium is a book-catalog browser with an AI chat assistant. A visitor searches, filters, sorts, and pages through books, opens book details or similar-book discovery, and can ask the assistant about the catalog. The API also exposes genre and book administration, including embedding reindexing. The graph separates the web experience, catalog API, chat subsystem, and shared UI. Several client-service and persistence details are not shown in the excerpts, so those connections are omitted rather than assumed.
Main entry points: app.tsx Catalog app · chat.service.ts Chat processing · src UI components · book.service.ts Book operations
Components 24
Web experience
- Catalog app
apps/web/src/app.tsx - Book queries
apps/web/src/hooks/use-books.ts - Book services
apps/web/src/services/books.ts - Chat drawer
apps/web/src/components/chat-drawer.tsx - Chat session
apps/web/src/hooks/use-chat-session.ts - Chat services
apps/web/src/services/chat.ts - Book views
apps/web/src/components/book-grid.tsx - Book card
apps/web/src/components/book-card.tsx - Book details
apps/web/src/components/book-details-modal.tsx - Catalog filters
apps/web/src/components/filter-bar.tsx - Search header
apps/web/src/components/header.tsx - Pagination
apps/web/src/components/pagination.tsx
Catalog API
- Book routes
apps/api/src/modules/book/book.routes.ts - Book operations
apps/api/src/modules/book/book.service.ts - Genre routes
apps/api/src/modules/genre/genre.routes.ts - Catalog database
apps/api/src/lib/prisma.ts
Chat assistant
- Chat routes
apps/api/src/modules/chat/chat.routes.ts - Chat processing
apps/api/src/modules/chat/chat.service.ts - Prompt building
apps/api/src/modules/chat/chat.prompts.ts - Catalog tools
apps/api/src/modules/chat/chat.tools.ts - Session cache
apps/api/src/lib/redis.ts - OpenAI service
apps/api/src/lib/openai.ts
Shared UI
- UI components
packages/ui/src
Other components
- Visitor
Connections 22
- Visitor → Catalog app: uses
- Catalog app → Book queries: queries
apps/web/src/app.tsx - Catalog app → Search header: renders
apps/web/src/app.tsx - Catalog app → Catalog filters: renders
apps/web/src/app.tsx - Catalog app → Book views: renders
apps/web/src/app.tsx - Catalog app → Pagination: renders
apps/web/src/app.tsx - Catalog app → Book details: renders
apps/web/src/app.tsx - Catalog app → Chat drawer: renders
apps/web/src/app.tsx - Book views → Book card: renders
apps/web/src/components/book-grid.tsx - Book details → UI components: uses
apps/web/src/components/book-details-modal.tsx - Chat drawer → UI components: uses
apps/web/src/components/chat-drawer.tsx - Catalog filters → UI components: uses
apps/web/src/components/filter-bar.tsx - Search header → UI components: uses
apps/web/src/components/header.tsx - Book routes → Book operations: calls
apps/api/src/modules/book/book.routes.ts - Genre routes → Catalog database: reads/writes
apps/api/src/modules/genre/genre.routes.ts - Chat routes → Chat processing: calls
apps/api/src/modules/chat/chat.routes.ts - Chat processing → Prompt building: builds prompts
apps/api/src/modules/chat/chat.service.ts - Chat processing → Catalog tools: uses tools
apps/api/src/modules/chat/chat.service.ts - Catalog tools → Book operations: queries catalog
apps/api/src/modules/chat/chat.tools.ts - Book operations → Catalog database: reads/writes
- Chat processing → Session cache: stores sessions
- Chat processing → OpenAI service: requests completions