HotFalcon2.github.io

Audiobook Recommender

A personalized audiobook recommendation system powered by OpenAI that analyzes your reading history and suggests new audiobooks you’ll love. Also includes a library availability checker for Libby, Hoopla, and Audible.

Features

Prerequisites

Installation

  1. Navigate to the audiobooks directory:
    cd audiobooks
    
  2. Install dependencies:
    npm install
    
  3. The OpenAI API key is already configured in .env.local (this file is gitignored for security)

  4. Start the development server:
    npm run dev
    
  5. Open your browser and navigate to http://localhost:3000

Usage

Getting Recommendations

  1. Import your reading history (optional):
    • Export your library from Goodreads or StoryGraph as a CSV file
    • Click “Choose File” and select your CSV file
    • The app will automatically categorize your books
  2. Add manual entries (optional):
    • Enter books in the format “Title by Author” (one per line)
    • Fill in Past Audiobooks, Currently Reading, and Want to Read sections
    • Add any additional preferences
  3. Generate recommendations:
    • Click “Get Recommendations”
    • The app will suggest 5 audiobooks tailored to your reading preferences
    • Click “Refresh Recommendations” to get new suggestions (won’t repeat previous suggestions)

Checking Library Availability

  1. Click “Check Library Availability” in the header
  2. Select the formats you want to check (Audiobooks, eBooks, Physical Books)
  3. Click “Search Availability”
  4. View results for Libby, Hoopla, and Audible

Deployment

  1. Push your code to a Git repository (GitHub, GitLab, or Bitbucket)

  2. Go to Vercel and sign in

  3. Click “New Project” and import your repository

  4. Configure your project:
    • Framework Preset: Next.js
    • Root Directory: audiobooks
    • Build Command: npm run build
    • Output Directory: .next
  5. Add environment variable:
    • Key: OPENAI_API_KEY
    • Value: Your OpenAI API key
  6. Click “Deploy”

  7. Once deployed, update the link in index.html to point to your Vercel URL

Deploy to Netlify

  1. Build the project:
    npm run build
    
  2. Go to Netlify and sign in

  3. Drag and drop the .next folder or connect your Git repository

  4. Configure build settings:
    • Build command: npm run build
    • Publish directory: .next
  5. Add environment variables in Netlify dashboard:
    • OPENAI_API_KEY: Your OpenAI API key

Other Hosting Options

This is a Next.js application with API routes, so it requires a Node.js server. You can deploy to:

Project Structure

audiobooks/
├── app/
│   ├── api/
│   │   ├── books/          # Fetch book metadata from Open Library
│   │   ├── library/check/  # Check library availability
│   │   └── suggest/        # Generate AI recommendations
│   ├── library-check/      # Library availability checker page
│   ├── globals.css         # Global styles
│   ├── layout.tsx          # Root layout
│   └── page.tsx            # Main recommendation page
├── components/
│   ├── AvailabilityCard.tsx  # Library availability display
│   └── BookCard.tsx          # Book recommendation display
├── lib/
│   ├── csvParser.ts        # CSV parsing utilities
│   └── storage.ts          # LocalStorage management
├── .env.local              # Environment variables (gitignored)
├── .gitignore
├── next.config.ts
├── package.json
├── postcss.config.mjs
└── tsconfig.json

Environment Variables

Security Notes

Technologies Used

License

This project inherits the license from the parent repository (Creative Commons Attribution 4.0 International License).