Skip to content

Latest commit

 

History

15 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Book Recommendation System Assistant

This project is a book recommendation system that leverages the Google Books API to recommend books based on user preferences such as genre, author, or keywords. It features a backend service built with FastAPI and a frontend interface developed using Streamlit for interactive user input. Additionally, it incorporates the OpenAI Assistant API to assist with user queries, providing an AI-powered chatbot experience for enhanced user interaction and personalized recommendations.

Streamlit Front-End View

Book.Recommendation.System.Streamlit.App.mp4

book-recommendation-system

React Front-End View

Screenshot 2024-12-17 155618

Screenshot 2024-12-17 155657

Screenshot 2024-12-17 155736

Project Workflow

Input

  • User provides preferences such as:
  • Genre (e.g., "fantasy," "science fiction," "romance")
  • Optional author or keyword filter

Processing

  • Query the Google Books API using the provided genre and optional filters.
  • Extract and format relevant book details like title, author, description, and average rating.

Output

  • Return a list of book recommendations, including:
  • Title, author, genre
  • A brief description
  • Average rating (if available)

Files in the Project

  • main.py: Backend file using FastAPI to handle API requests for fetching book recommendations.
  • frontend.py: Frontend file using Streamlit to provide an interactive UI for the user to enter preferences.
  • requirements.txt: List of dependencies required for the project.
  • .gitignore: Specifies files and directories to be ignored by Git.
  • .env: Environment variables for sensitive information like API keys.
  • pycache: Compiled Python files.
  • myenv: Virtual environment folder for the project.

How to Run the Project

Prerequisites

Make sure you have the following installed:

  • Python 3.x
  • Streamlit
  • FastAPI
  • Google Books API access (for fetching book data)

Setup

  1. Clone this repository to your local machine.

  2. Navigate to the project folder and create a virtual environment:

    • python -m venv myenv
  3. Activate the virtual environment:

    • On Windows:
      • myenv\Scripts\activate
    • On macOS/Linux:
      • source myenv/bin/activate
  4. Install the required dependencies:

    • pip install -r requirements.txt
  5. Running the Backend (Start the FastAPI server)

    • myenv\Scripts\activate
    • python main.py
  6. The backend will be running at http://localhost:8000.

Running the Frontend (Streamlit)

  1. Open New Terminal & Start the Streamlit frontend:

    • myenv\Scripts\activate
    • streamlit run frontend.py
  2. The frontend will be running at http://localhost:8501.

  3. The frontend will open in your browser, where you can provide inputs like genre and receive book recommendations.

Example Output

For user input like "Recommend books in the fantasy genre," the output will look something like this:

  1. The Hobbit by J.R.R. Tolkien

    • Description: Bilbo Baggins embarks on an epic journey...
    • Rating: 4.7
    • More Info: The Hobbit
  2. Harry Potter and the Sorcerer's Stone by J.K. Rowling

    • Description: A young wizard begins his magical education...
    • Rating: 4.8
    • More Info: Harry Potter

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgements

  • Google Books API: Used for fetching book data.
  • FastAPI: Used for backend development.
  • Streamlit: Used for frontend development.
  • OpenAI Assistant API: Used for assistance with user queries

About

This project is a book recommendation system using the Google Books API to suggest books based on user preferences like genre, author, or keywords. It features a FastAPI backend, a Streamlit frontend for user input, and an OpenAI-powered AI chatbot for query assistance and personalized recommendations.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages