Skip to content

πŸ“š A full-stack book recommendation platform featuring Retrieval-Augmented Generation (RAG), a conversational AI chatbot (Ollama), and LLM tool-calling for semantic retrieval, personalized search, and user-generated reviews. Built with FastAPI, React, PostgreSQL, and Docker for containerized deployment.

License

Notifications You must be signed in to change notification settings

Chengyuli33/reading-bee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

444 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐝 Reading Bee Project Introduction

Welcome to Reading Bee, where every book finds its buzz! ✨

Reading Bee is an online database and personalized book recommendation platform. It integrates an LLM chatbot, advanced search, and similarity-based recommendations into one unified system.

✨ At a Glance

  1. LLM Chatbot for book suggestions
  2. Advanced Book Search & Filtering
  3. Save favorite books to "My List"
  4. Similar Book Recommendations based on semantic search
  5. Full-Stack: backend + frontend + PostgreSQL database
  6. Data engineering and sentiment analysis

Homepage

πŸ“ Key Features

1. LLM Chatbot:

  • πŸ’¬ A conversational interface based on Retrieval-Augmented Generation (RAG). User can ask for book suggestions in natural language. Ollama LLM Chatbot returns relevant titles and summarize results (embeddings and metadata).

  • βš™ LLM dynamically triggers tool calling to backend. User messages (such as book descriptions or ISBNs) are parsed and perform a vector search (PostgreSQL + pgvector/FAISS) to retrieve similar books.

chatbot

2. Book Search & Filtering

  • ⚑️ Quick search by title, author, or ISBN with validation checks (e.g. minimum text length, 13-digit ISBN requirement).

  • πŸ” Advanced search and filter by year, rating, price, publisher, category, etc. Results are ranked by relevance and rating, with book detail pages showing metadata, cover, and reader reviews.

filtering

3. Personal Collections

  • πŸ“š Registered users can create a personal bookshelf, "My List", to organize their favorite books. Adding or removing items anytime.

mylist

4. Similar Recommendations

  • ❀️ On each book detail page, "You Might Also Like" section suggests related books with similar themes, authors, or content (via semantic search).

similarbook

5. Full-Stack Architecture

  • πŸ–₯️ Backend APIs – RESTful endpoints built with FastAPI + Pydantic, connecting to a PostgreSQL database. πŸ‘‰ Backend API

  • 🎨 Frontend UI – Responsive React interface with dynamic components (grids, filters, hover effects, book cards). Designed in Figma with user-friendly layouts. πŸ‘‰ Frontend & UI design

  • πŸ—„οΈ Database β€” A normalized PostgreSQL schema (3NF) with junction tables for many-to-many relationships. Supports efficient joins, aggregated views, and complex SQL queries. Semantic similarity search powered by FAISS(Facebook AI Similarity Search) with Sentence-BERT embeddings. πŸ‘‰ Database Docs

  • πŸ” Authentication – Secure sign-up/login with JWT tokens, where each user account is identified by a UUID (uuid4). Tokens include user id, issue time, and expiration, only authorized users can manage their profile.

signlogin

6. Data Engineering & Ops

  • πŸ“‚ Integrated Data Sources – Combines Amazon Books and Book-Crossing raw data into a unified datasets. Large-scale metadata joins and review aggregation.

  • 🧹 Processing & Normalization – Cleaning, merging, handling missing values, data standardization, book title canonicalization, and author deduplication, etc.

  • βš™οΈ Feature Engineering – Sentence-BERT embeddings, FAISS vector index for semantic similarity, and sentiment scoring (positivity/negativity with VADER + GPT for multilingual reviews). πŸ‘‰ Data Processing Docs

πŸ”§ Tech Stack

  • Frontend: React, HTML, CSS, JavaScript
  • Backend: FastAPI, JWT, Pydantic, Pytest, Postman
  • Database: PostgreSQL
    • Vector Search: FAISS (Facebook AI Similarity Search)
    • Data Processing: Python, Pandas, scikit-learn, Google Colab
  • Version Control: Git, GitHub
  • Recommendation System:
    • Retrieval-Augmented Generation (RAG) pipeline
    • Sentence-BERT embeddings
    • GPT + Ollama LLM
    • VADER sentiment analysis
    • FAISS (Facebook AI Similarity Search)
  • Deployment: Docker, Docker Compose for DevOps

πŸ“ Project Structure

root/
β”‚
β”œβ”€β”€ reading-bee-data-private/         ← Data repository (separate)
β”‚   β”œβ”€β”€ *.csv                         ← Book metadata CSVs
β”‚   β”œβ”€β”€ description_embeddings.npy
β”‚   └── description_index.faiss
β”‚
β”‚
└── reading-bee/
    β”‚
    β”œβ”€β”€ backend/                ← FastAPI backend service
    β”‚   β”œβ”€β”€ routes/             ← API route handlers
    β”‚   β”œβ”€β”€ main.py             ← App entry point
    β”‚   β”œβ”€β”€ db.py               ← Database connection
    β”‚   └── ...
    β”‚
    β”œβ”€β”€ frontend/               ← React frontend app
    β”‚   β”œβ”€β”€ assets/             ← Static assets
    β”‚   β”œβ”€β”€ components/         ← Source code (JSX, CSS)
    β”‚   β”œβ”€β”€ index.html          ← Main entry point for the website
    β”‚   └── ...
    β”‚
    β”œβ”€β”€ database/               ← SQL scripts and schema
    β”‚
    β”œβ”€β”€ docker/                 ← Docker-related configs
    β”‚   └── ...
    β”‚
    β”œβ”€β”€ data/                   ← raw data and processing notebooks
    β”‚   β”œβ”€β”€ raw/                ← Raw data files
    β”‚   β”œβ”€β”€ data-processing/    ← Data analysis and processing
    β”‚   └── ...
    β”‚
    β”œβ”€β”€ docker-compose.yml      ← Main Docker Compose config
    β”œβ”€β”€ start_dev.sh            ← Development launcher script
    └── README.md               ← Project overview

πŸš€ Getting Started

This project uses Docker + Ollama for local development and LLM, please follow the instructions below.

βœ… Step 1: Clone the repository:

Cloning the data repo:

git clone https://github.com/Chengyuli33/reading-bee-data-private.git
cd ..

Cloning the main Reading Bee repo:

git clone https://github.com/Chengyuli33/reading-bee.git
cd reading-bee

⚠️ Check: reading-bee-data-private/ should be placed under the same root as the reading-bee/ folder:

root/
β”œβ”€β”€ reading-bee 
└── reading-bee-data-private

🧰 Step 2: Install Prerequisites if needed (macOs)

Download Docker Desktop to run containers locally:

brew install --cask docker

Download Ollama LLM:

brew install ollama

Then, start Docker Desktop manually:

⌘ + Space β†’ Docker

Start Ollama service in background and pull the model (first time only):

ollama serve &
ollama pull llama3

This will download and launch the llama3 model (1st time β‰ˆ 4GB, may take a few mins)

🐳 Step 3: Start local services

# Make the script executable
chmod +x start_dev.sh

# Run the development environment
./start_dev.sh

You will see the following logs if everything is running smoothly:

🌟 Welcome to Reading Bee Dev Environment!
🐝 Starting up...
βœ… Ollama service is already running
βœ… llama3 model ready
🐳 Starting Docker services...
πŸ” Using docker compose (v2+)
[+] Building 
[+] Running 7/7
...
✨ All services started!

🌐 Step 4: Access the App in Browser

πŸ“± Frontend Website: http://localhost:3000
πŸ”§ Backend FastAPI: http://localhost:8000/docs
πŸ€– Ollama: http://localhost:11434

πŸ”§ Troubleshooting

If you see port conflicts:

# Check what's using the port
lsof -i :3000  # or :8000, :5432

# Stop existing containers
docker compose down

πŸ§ͺ Testing the Setup

After starting all services, verify everything works:

Database Test

docker exec -it readingbee-db psql -U postgres -d reading_bee \
  -c "SELECT COUNT(*) FROM all_book_full_details_view;"

Expected output: 273225

Backend API Test

Visit http://localhost:8000/docs or use curl:

curl "http://localhost:8000/books/search?title=harry+potter" | jq

Expected output: JSON with a total of 25706 book search results.

Frontend Test

Open http://localhost:3000 in the browser.

Ollama Test

curl http://localhost:11434/api/tags

Should return list of models {"models": ...} including llama3.

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.

About

πŸ“š A full-stack book recommendation platform featuring Retrieval-Augmented Generation (RAG), a conversational AI chatbot (Ollama), and LLM tool-calling for semantic retrieval, personalized search, and user-generated reviews. Built with FastAPI, React, PostgreSQL, and Docker for containerized deployment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published