A modern book recommendation system built with FastAPI and React. The application helps users discover new books based on their ratings and preferences, with a focus on technical and non-technical books. I use this by importing my Goodreads CSV and rating books that helps the LLM generate recommendations.
Check it out at https://liberopus.vercel.app/
- 📚 Book discovery and recommendations powered by Google's Gemini LLM
- ⭐ Rate books and track your reading history
- 📋 Maintain a personal wishlist
- 🏷️ Technical vs non-technical book categorization
- 📊 Average rating system
- Backend: FastAPI (Python)
- Database: SQLite
- Frontend: React with TypeScript
- AI: Google Gemini Pro LLM
- Python 3.8+
- Node.js 14+
- SQLite
- Google Cloud API Key (for Gemini Pro)
GET /books- Get all booksPOST /add-book- Add a new bookPOST /import-goodreads- Import books from Goodreads CSV
GET /ratings- Get all ratingsPOST /ratings- Rate a book{ "book_id": "string", "rating": number (1-5) }
POST /get-recommendations- Get personalized book recommendations{ "user_history": ["book_id1", "book_id2"], "user_ratings": { "book_id": rating } }
GET /wishlist- Get user's wishlistPOST /wishlist/add- Add book to wishlistDELETE /wishlist/remove/{book_id}- Remove book from wishlistPUT /wishlist/reorder- Reorder wishlist items
POST /dismiss-book- Dismiss a book (won't show in recommendations)GET /dismissed-books- Get list of dismissed books
books:
- id (TEXT PRIMARY KEY)
- title (TEXT)
- author (TEXT)
- description (TEXT)
- average_rating (REAL)
- topics (TEXT)
- technical_level (TEXT)
- publication_year (INTEGER)
- page_count (INTEGER)
ratings:
- id (INTEGER PRIMARY KEY)
- book_id (TEXT)
- rating (INTEGER)
- timestamp (DATETIME)
wishlist:
- id (INTEGER PRIMARY KEY)
- book_id (TEXT)
- notes (TEXT)
- added_at (DATETIME)
- display_order (INTEGER)
dismissed_books:
- id (INTEGER PRIMARY KEY)
- book_id (TEXT)
- timestamp (DATETIME)Create a .env file in the root directory:
DATABASE_URL=books.db
GOOGLE_API_KEY=your_google_api_key # Required for Gemini recommendationsThe recommendation system uses Google's Gemini Pro LLM (main.py) to provide personalized book suggestions based on:
- User's reading history
- Book ratings
- Technical preferences
- Reading patterns
The LLM analyzes the user's preferences and book metadata to generate contextually relevant recommendations, taking into account factors like:
- Technical vs non-technical preferences
- Author similarity
- Topic relationships
- Reading level progression
-
Backend: Deploy as a Web Service
- Build Command:
pip install -r requirements.txt - Start Command:
uvicorn api:app --host 0.0.0.0 --port $PORT
- Build Command:
-
Frontend: Deploy as a Static Site
- Build Command:
npm run build - Publish Directory:
dist
- Build Command:
- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
This project is licensed under the MIT License.
