Skip to content
yumin2002Public

About

πŸ“– ✨AI-powered reading companion that provides real-time plot summaries, character analysis, translation, and relationship mapping to enhance your literary experience.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

LitGuide - AI-Powered Interactive Reading Companion

AI-powered reading companion that provides real-time plot summaries, character analysis, and relationship mapping to enhance your literary experience.

Overview

LitGuide is a React Native mobile application that transforms traditional book reading into an interactive, AI-enhanced experience. Built with Google's Gemini AI, it provides intelligent insights and analysis as you read, making complex literature more accessible and engaging.

Core Features

πŸ“– Interactive Reading Experience

  • Paginated book display with smooth navigation
  • Chapter-based navigation with quick jump functionality
  • Text selection and highlighting capabilities
  • Clean, distraction-free reading interface

πŸ€– AI-Powered Analysis

  • Plot Summaries: Real-time spoiler-free plot summaries based on your current reading position
  • Chapter Summaries: Detailed chapter-by-chapter breakdowns
  • Character Analysis: Individual character summaries and development tracking
  • Relationship Mapping: Visual relationship graphs showing character connections

πŸ”„ Text Enhancement

  • Language Conversion: Convert selected text to modern, standard English
  • Context-Aware Processing: AI analyzes text based on your current reading position
  • Spoiler-Free Content: All AI responses are designed to avoid spoilers

πŸ“± Mobile-First Design

  • Native iOS and Android support via React Native
  • Intuitive touch-based navigation
  • Collapsible content sections for organized information display
  • Responsive design optimized for mobile reading

Technical Architecture

Frontend (React Native)

  • Navigation: React Navigation for seamless screen transitions
  • UI Components: Custom modals, collapsible sections, and pagination
  • State Management: React hooks for local state management
  • File System: React Native FS for local book file handling

Backend (Node.js/Express)

  • AI Integration: Google Gemini AI for content analysis
  • Database: PostgreSQL with Google Cloud SQL for chapter summaries
  • API Endpoints: RESTful API for all AI-powered features
  • Graph Visualization: Graphviz for relationship diagram generation

Key Dependencies

  • @google/generative-ai - Google Gemini AI integration
  • react-native-pager-view - Smooth page navigation
  • @ronradtke/react-native-markdown-display - Rich text rendering
  • @hpcc-js/wasm/graphviz - Relationship graph generation
  • pg - PostgreSQL database connectivity

Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • React Native development environment
  • iOS Simulator or Android Emulator
  • Google Cloud Platform account (for AI services)

Installation

  1. Clone the repository

    git clone <repository-url>
    cd InteractiveReader
  2. Install dependencies

    npm install
    cd ios && pod install && cd ..
  3. Backend Setup

    cd backend
    npm install
    cp .env.example .env
    # Configure your Google AI API key and database credentials
  4. Run the application

    npx expo run:ios
    # or
    npx expo run:android

API Endpoints

  • POST /generatePlotSummary - Generate plot summary for current reading position
  • POST /generateChapterSummary - Generate chapter-specific summary
  • POST /generateCharacterList - Extract characters from current text
  • POST /getCharacterSummary - Get detailed character analysis
  • POST /getRelationshipGraph - Generate character relationship visualization
  • POST /convertToEnglish - Convert selected text to modern English

Project Structure

InteractiveReader/
β”œβ”€β”€ App.js                 # Main application entry point
β”œβ”€β”€ AppNavigator.js        # Navigation configuration
β”œβ”€β”€ ReadingScreen.js       # Main reading interface
β”œβ”€β”€ AIScreen.js           # AI analysis display
β”œβ”€β”€ ChapterModal.js       # Chapter navigation modal
β”œβ”€β”€ ConvertedModal.js     # Text conversion modal
β”œβ”€β”€ backend/              # Node.js backend server
β”‚   β”œβ”€β”€ app.js           # Express server and API routes
β”‚   β”œβ”€β”€ const/           # Constants and sample data
β”‚   └── book.txt         # Source book file
└── assets/              # Static assets and configuration
    β”œβ”€β”€ chapters.json    # Chapter line number mapping
    └── icon.png         # App icon

Configuration

Environment Variables

Create a .env file in the backend directory:

API_KEY=your_google_ai_api_key
DB_USER=your_database_user
DB_PASS=your_database_password
DB_NAME=your_database_name
INSTANCE_CONNECTION_NAME=your_cloud_sql_instance

Book Configuration

  • Place your book text file in backend/book.txt
  • Update assets/chapters.json with chapter line number mappings
  • Modify chapter detection logic in backend if needed

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

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

Acknowledgments

  • Google Gemini AI for powerful language processing capabilities
  • React Native community for excellent mobile development tools
  • Graphviz for relationship visualization
  • The open-source community for various dependencies

Built with ❀️ for literature enthusiasts and AI technology

About

πŸ“– ✨AI-powered reading companion that provides real-time plot summaries, character analysis, translation, and relationship mapping to enhance your literary experience.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages