Skip to content

devanshi14malhotra/BiblioDrift

Repository files navigation

BiblioDrift πŸ“šβ˜•

Netlify Live App - Click here to view!

"Find yourself in the pages."

BiblioDrift is a cozy, visual-first book discovery platform designed to make finding your next read feel like wandering through a warm, quiet bookstore rather than scrolling through a database.

Open Source Events Navigation

Nexus Spring of Code- Contributor Guide

🌟 Core Philosophy

  • "Zero UI Noise": No popups, no aggressive metrics. Just calm browsing.
  • Tactile Interaction: 3D books that you can pull from the shelf and flip over.
  • Vibe-First: Search for feelings ("rainy mystery"), not just keywords.

πŸš€ Features (MVP & Roadmap)

  • Interactive 3D Books: Hover to pull, click to flip and expand.
  • Virtual Library: Realistic wooden shelves to save your "Want to Read", "Currently Reading", and "Favorites" list (Persistent via LocalStorage).
  • Glassmorphism UI: A soothing, modern interface that floats above the content.
  • AI-Powered Recommendations (Planned): All book recommendations must be generated exclusively by AI.
    No manual curation, static lists, or hardcoded recommendations are permitted.
  • Dynamic Popups: Click a book to see an expanded view with AI-generated blurbs.
  • Curated Tables: Horizontal scrolling lists based on moods like "Monsoon Reads".

πŸ› οΈ Tech Stack

Frontend

Vanilla JS β€’ CSS3 3D β€’ HTML5

API & Data

Google Books API β€’ LocalStorage

Backend & AI

Python Flask β€’ FAISS / LLM

System Architecture

To maintain our strict AI-driven model, BiblioDrift utilizes a decoupled flow where the backend acts as the "Curator" and the frontend acts as the "Librarian."

graph TD
    A[Vanilla JS Frontend] -->|Vibe Query| B[Flask Backend]
    B -->|Prompt Engineering| C[AI Service / LLM]
    C -->|Generated Blurb| B
    B -->|JSON Response| A
    A -->|Book Details| D[Google Books API]
    A -->|Persistence| E[LocalStorage]

    style A fill:#f9f,stroke:#333,stroke-width:2px
    style C fill:#000,stroke:#fff,stroke-width:2px,color:#fff
Loading

πŸ€– Project Structure

BIBLIODRIFT/
BIBLIODRIFT/
β”‚
β”œβ”€β”€ backend/                     #  Python backend logic
β”‚   β”œβ”€β”€ app.py
β”‚   β”œβ”€β”€ ai_service.py
β”‚   β”œβ”€β”€ cache_service.py
β”‚   β”œβ”€β”€ config.py
β”‚   β”œβ”€β”€ error_responses.py
β”‚   β”œβ”€β”€ models.py
β”‚   β”œβ”€β”€ security_utils.py
β”‚   β”œβ”€β”€ validators.py
β”‚   β”‚
β”‚   β”œβ”€β”€ mood_analysis/          # mood-based recommendation logic
β”‚   └── purchase_links/         # purchase link generation
|   β”œβ”€β”€ price_tracker/   
β”‚
β”œβ”€β”€ frontend/                   #  UI (client-side)
β”‚   β”œβ”€β”€ pages/                  # HTML files
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   β”œβ”€β”€ auth.html
β”‚   β”‚   β”œβ”€β”€ chat.html
β”‚   β”‚   β”œβ”€β”€ library.html
β”‚   β”‚   β”œβ”€β”€ profile.html
β”‚   β”‚   └── 404.html
β”‚   β”‚
β”‚   β”œβ”€β”€ js/                     # JavaScript
β”‚   β”‚   β”œβ”€β”€ app.js
β”‚   β”‚   β”œβ”€β”€ chat.js
β”‚   β”‚   β”œβ”€β”€ config.js
β”‚   β”‚   β”œβ”€β”€ footer.js
β”‚   β”‚   └── library-3d.js
β”‚   β”‚
β”‚   β”œβ”€β”€ css/                    # Styles
β”‚   β”‚   β”œβ”€β”€ style.css
β”‚   β”‚   β”œβ”€β”€ style_main.css
β”‚   β”‚   └── style-responsive.css
β”‚   β”‚
β”‚   β”œβ”€β”€ assets/                 # Images, sounds
β”‚   β”‚   β”œβ”€β”€ images/
β”‚   β”‚   └── sounds/
β”‚   β”‚
β”‚   └── script/                 # extra JS (header scroll etc.)
β”‚
β”œβ”€β”€ config/                     # βš™οΈ Configuration
β”‚   β”œβ”€β”€ .env.development
β”‚   β”œβ”€β”€ .env.example
β”‚   β”œβ”€β”€ .env.testing
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── runtime.txt
β”‚
β”œβ”€β”€ docs/                       # πŸ“š Documentation
β”‚   β”œβ”€β”€ contributing.md
β”‚   β”œβ”€β”€ Open-Source-Event-Guidelines.md
β”‚   β”œβ”€β”€ TUTORIAL.md
β”‚   └── page.png
β”‚
β”œβ”€β”€ tests/                      # πŸ§ͺ Test files
β”‚   β”œβ”€β”€ test_api.py
β”‚   β”œβ”€β”€ test_llm.py
β”‚   └── test_validation.py
β”‚
β”œβ”€β”€ .gitignore
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ netlify/                    # deployment config
β”œβ”€β”€ script/ (if any left)       
β”œβ”€β”€ venv/                       
└── .vscode/

πŸ€– AI Recommendation Policy

BiblioDrift follows a strict AI-only recommendation model.

  • All recommendations must be generated dynamically using AI/LLMs.
  • Manual curation, editor picks, static mood lists, or hardcoded book mappings are not allowed.
  • AI outputs should be based on abstract signals such as:
    • Vibes
    • Mood descriptors
    • Emotional tone
    • Reader intent

This ensures discovery stays organic, scalable, and aligned with BiblioDrift’s philosophy of vibe-first exploration.

πŸ“¦ Installation & Setup

Frontend (Current MVP)

  1. Clone the repository:
    git clone https://github.com/devanshi14malhotra/bibliodrift.git
  2. Open index.html in your browser.
    • That's it! No build steps required for the vanilla frontend.

Backend (Future)

Planned implementation using Python Flask.

🚒 Deployment Notes

  • Netlify should serve the static frontend from the generated dist/ bundle.
  • The Flask backend, database, Redis, and AI services are not hosted by Netlify.
  • To make the API work in production, deploy the backend separately and point the frontend MOOD_API_BASE to that host.

Screenshots

Discovery & Virtual Library

Home Page

Virtual Library Sign In Page

Capturing the tactile, vibe-first essence of BiblioDrift.

🧠 AI Service Integration

To keep the frontend and backend synced, use the following mapping:

Feature Frontend Call (app.js) API Endpoint (app.py) Logic Provider (ai_service.py)
Book Vibe POST /api/v1/generate-note handle_generate_note() generate_book_note()

API Integration

  • Endpoint: POST /api/v1/generate-note
  • Logic: Processed by ai_service.py

πŸ“‘ API Request & Response Examples

Endpoint: Generate Book Note

Method: POST URL: /api/v1/generate-note Description: Generates an AI-powered "bookseller note" based on the book's vibe, mood, and metadata.


Request

Headers

{
  "Content-Type": "application/json"
}

Body

{
  "title": "The Night Circus",
  "author": "Erin Morgenstern",
  "mood": "mysterious, magical, slow-burn romance"
}

Response

Success (200 OK)

{
  "status": "success",
  "note": "A dreamlike duel unfolds in a wandering circus of shadows and light. Perfect for readers who crave atmospheric magic and quiet intensity."
}

Error (400 Bad Request)

{
  "status": "error",
  "message": "Missing required fields: title or mood"
}

API Flow Explanation

  1. Frontend sends a POST request from app.js to /api/v1/generate-note.
  2. The Flask backend (app.py) receives the request via handle_generate_note().
  3. Input data (title, author, mood) is validated.
  4. The request is passed to generate_book_note() in ai_service.py.
  5. The AI model generates a contextual "bookseller note".
  6. The backend returns the generated note as a JSON response.
  7. Frontend displays the note in the book popup UI.

🀝 Contributing

We welcome contributions to make BiblioDrift cozier!

  1. Fork the repo.
  2. Create a feature branch such as feature/cozy-mode.
  3. Make your changes and test them locally.
  4. Push your branch and open a Pull Request.

See CONTRIBUTING.md for the fuller workflow and contribution rules.

πŸ“„ License

MIT License.


Built by Devanshi Malhotra and contributors, with β˜• and code.

If you like this project, please consider giving the repository a ⭐ STAR ⭐.

Releases

No releases published

Packages

 
 
 

Contributors