Skip to content

latenightcoder-git/PersonalLibraryAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“š AI Book Tracker & Reading Advisor

An intelligent book management web application built using Flask, SQLite, and Google Gemini AI.

The application allows users to maintain their personal reading library, track reading progress, search books, edit book details, and receive personalized AI-powered reading recommendations based on their reading history and current interests.


πŸš€ Features

πŸ“– Book Management

  • Add new books to your personal library
  • Store:
    • Title
    • Author
    • Genre
    • Reading Status
  • Update book information anytime
  • Delete books from the collection

πŸ” Smart Search

Search books by:

  • Title
  • Author
  • Genre

The search updates dynamically from the database and helps users quickly locate books in large collections.


πŸ“Š Reading Status Tracking

Each book can be categorized as:

  • Unread
  • Reading
  • Completed

This helps users monitor their reading progress efficiently.


✏️ Inline Editing

Books can be edited directly from the library page:

  • Modify title
  • Change author
  • Update genre
  • Change reading status No separate edit page is required.

πŸ€– AI Reading Advisor

Powered by Google Gemini 2.5 Flash.

The recommendation engine:

  • Analyzes completed books
  • Examines books currently being read
  • Understands reading preferences
  • Suggests books that align with the user's interests

Users can also request recommendations for a specific genre.

Example:

Mystery
Science Fiction
Fantasy
Thriller
Business
Biography

πŸ› οΈ Tech Stack

Frontend

  • HTML5
  • CSS3
  • Jinja2 Templates

Backend

  • Python
  • Flask

Database

  • SQLite3

AI Integration

  • Google Gemini API
  • Gemini 2.5 Flash Model

Environment Management

  • python-dotenv

πŸ“‚ Project Structure

BOOK-TRACKER/
β”‚
β”œβ”€β”€ codes/
β”‚   β”‚
β”‚   β”œβ”€β”€ static/
β”‚   β”‚   └── style.css
β”‚   β”‚
β”‚   β”œβ”€β”€ templates/
β”‚   β”‚   └── index.html
β”‚   β”‚
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ init_db.py
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ .env
β”‚   β”œβ”€β”€ .gitignore
β”‚   └── booktracker.db
β”‚
β”œβ”€β”€ OutputImages/
β”‚   β”œβ”€β”€ AddingBook.png
β”‚   β”œβ”€β”€ BookAdded.png
β”‚   β”œβ”€β”€ BookDeleted.png
β”‚   β”œβ”€β”€ DashBoard.png
β”‚   β”œβ”€β”€ AIRecommendation.png
β”‚   β”œβ”€β”€ AIRecommendationBasedonGenre.png
β”‚   β”œβ”€β”€ SearchResultFantasyGenre.png
β”‚   └── SearchResultGamesGenre.png
β”‚
└── README.md

βš™οΈ Database Schema

The application uses a SQLite database named:

booktracker.db

Table:

CREATE TABLE books (
    book_id INTEGER PRIMARY KEY AUTOINCREMENT,
    title TEXT NOT NULL,
    author TEXT NOT NULL,
    genre TEXT,
    status TEXT
);

πŸ”„ Application Workflow

Step 1: Add Books

User enters:

  • Title
  • Author
  • Genre
  • Reading Status Book is stored in SQLite database.

Step 2: Manage Library

Users can:

  • View all books
  • Edit existing books
  • Delete books
  • Update reading progress

Step 3: Search Books

Search functionality queries:

title
author
genre

using SQL LIKE operations.


Step 4: Generate AI Recommendations

The system:

  1. Retrieves unfinished books.
  2. Retrieves completed books.
  3. Builds a reading profile.
  4. Sends the profile to Gemini.
  5. Gemini returns a personalized recommendation.

🧠 AI Recommendation Logic

The recommendation engine considers:

Current Reading Goals

Books marked:

Unread
Reading

These represent the user's future reading intentions.

Historical Preferences

Books marked:

Completed

These represent previously enjoyed books.

Genre Preference

Users can optionally provide a genre. Example:

Fantasy

The AI then generates recommendations specifically within that genre.


πŸ” Environment Variables

Create a .env file inside the project directory.

GEMINI_API_KEY=YOUR_GEMINI_API_KEY
FLASK_SECRET_KEY=YOUR_SECRET_KEY

πŸ“¦ Installation

Clone Repository

git clone https://github.com/your-username/book-tracker.git

cd book-tracker/codes

Create Virtual Environment

Windows

python -m venv venv

venv\Scripts\activate

Linux / Mac

python3 -m venv venv

source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

▢️ Running the Application

python app.py

Open:

http://127.0.0.1:5000

πŸ“Έ Application Screenshots

Dashboard

Dashboard


Adding a New Book

Adding Book


Book Successfully Added

Book Added


Search Results

Fantasy Genre

Fantasy Search

Games Genre

Games Search


AI Recommendation

AI Recommendation


Genre Based Recommendation

Genre Recommendation


Delete Book Confirmation

Delete Book


🌟 Future Enhancements

  • User Authentication
  • Multiple User Libraries
  • Book Cover Integration
  • Goodreads API Integration
  • Reading Analytics Dashboard
  • Reading Streak Tracking
  • Favorite Books Collection
  • Dark Mode
  • Export Library to CSV/PDF
  • AI Reading Plan Generator

🎯 Learning Outcomes

This project demonstrates:

  • CRUD Operations using Flask
  • SQLite Database Integration
  • Environment Variable Management
  • AI API Integration
  • Prompt Engineering
  • Search Functionality
  • Full Stack Web Development

πŸ‘¨β€πŸ’» Author

Madhuchhanda Das

B.Tech Computer Science & Engineering

Project: AI Book Tracker & Reading Advisor


πŸ“„ License

This project is created for educational and learning purposes.

About

A Flask-based personal library management system with AI-powered book recommendations using Google Gemini, featuring book tracking, search, editing, and reading progress management.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors