$ show shutootaki/bookwith
BookWith is a next-generation e-reader application that enhances traditional book reading with AI capabilities. The system allows users to upload and read EPUB books, annotate text, interact with an AI chatbot for contextual questions about the content, and generate AI-powered podcasts from book material. The architecture follows a client-server model with a Next.js/React frontend and a FastAPI/Python backend, employing domain-driven design principles. Key features include a multi-layer memory system for maintaining conversation context, semantic search via Weaviate vector database, and integration with external AI services like Gemini and Google Cloud Text-to-Speech. The frontend uses modern React patterns with Zustand/Jotai for state management, Tailwind CSS for styling, and shadcn/ui-inspired components. The backend utilizes PostgreSQL for relational data, implements clean architecture with separate domain/application/infrastructure layers, and provides a well-structured API with automatic OpenAPI schema generation.
The LLM identified 4 files worth highlighting for reuse:
A highly reusable UI button component built with Radix UI primitives and Tailwind CSS. It supports multiple variants (default, destructive, outline, secondary, ghost, link) and sizes, demonstrating excellent encapsulation of styling and behavior. The component is framework-agnostic in design and could be extracted to any React/Tailwind project with minimal adaptation.
A custom React hook that encapsulates complex text selection logic, including range management, event handling, and state updates. It provides a clean API for obtaining selected text and coordinates, making it reusable in any text-heavy application (e.g., editors, readers, annotation tools). The hook abstracts away browser inconsistencies and exposes a simple interface for tracking selection changes.
A reusable Python decorator that implements exponential backoff retry logic for external service calls. It handles transient failures with configurable attempts, delay, and jitter, significantly improving resilience when integrating with unreliable APIs. The decorator is completely decoupled from business logic and can be applied to any function making external requests, demonstrating a clean separation of concerns.
An abstraction layer over Weaviate vector database that provides CRUD operations with built-in multi-tenancy support. It encapsulates complex vector operations (search, insert, update, delete) while handling connection management and error translation. The service is designed for easy substitution with other vector stores and demonstrates sophisticated handling of high-dimensional data operations in a tenant-isolated manner.