Book Hive is a no-frills, AI-powered book recommendation system designed to help users find books to read. The app curates suggestions from user input and provides up-to-date book information and purchase options.
Clone the repository:
git clone https://gitlab.com/jagrg/book-hive.git
cd book-hive
Install dependencies:
yarn install
Create a .env file in the root directory with your API keys:
OPENAI_KEY=your_openai_api_key
GOOGLE_BOOKS_KEY=your_google_books_api_key
VITE_API_URL=http://localhost:8888
Start the development server:
BROWSER=none netlify dev
To run tests locally:
yarn test
The frontend is hosted on GitLab with the backend server implemented separately on Netlify.
Total estimated monthly cost for the OpenAI GPT-4o Mini API is between $0.62 and $12.30. The potential for affiliate links to offset these costs will depend on user engagement and conversions. For longer-term scalability and cost reduction, a self-hosted LLM like h2oGPT may be a more suitable option. I'll experiment and report back.
A local cron job generates new recommendations using the generateHive.js script. It runs every Monday and creates a backup of the previous file. Eventually, the task will be delegated to Netlify for improved automation.
The app features a modular, responsive, and scalable architecture, complemented by an intuitive, Google-like UI designed for simplicity and ease of navigation. Built-in optimizations include infinite scrolling, code splitting, lazy loading, and caching strategies, along with multi-language support, carefully balanced color contrast and adequate link-to-body text ratios for enhanced readability.
Additionally, the app integrates with RESTful APIs to ensure secure, efficient, and scalable communication with backend services, supported by authentication, rate limiting, and performance monitoring.
Currently, all user-generated data is encoded directly into the URL. This approach removes the need for persistent server-side storage but results in longer and less user-friendly URLs. Moreover, image URLs for some niche books may not be available, and the accuracy of the results can vary.
The website does not use cookies or collect personally identifiable information. However, it uses GoatCounter to measure page views and interactions anonymously.