Skip to content

baveet256/ReadEaseAI

Repository files navigation

ReadEaseAI

AI-Powered Accessibility Platform for Inclusive Reading Experiences

Next.js TypeScript Claude AI License

ReadEaseAI transforms PDF documents into personalized, accessible reading experiences tailored for individuals with diverse learning needs and disabilities. Powered by Claude AI and OpenAI, our platform adapts content in real-time to support dyslexia, visual impairments, autism, and ADHD.


πŸ“‹ Table of Contents


✨ Features

Core Capabilities

  • 🎯 Multi-Modal Accessibility: Four specialized reading modes optimized for different disabilities
  • πŸ€– AI-Powered Transformation: Claude Sonnet 4.5 intelligently adapts content structure and complexity
  • πŸ”Š Text-to-Speech: Natural voice narration powered by OpenAI TTS
  • πŸ“š PDF Intelligence: Advanced document parsing with context-aware extraction
  • 🎨 Customizable Display: Adaptive fonts, spacing, and visual layouts
  • β™Ώ WCAG Compliant: Designed with accessibility-first principles

AI Features

  • Semantic Simplification: Multi-level text complexity reduction
  • Conversational Q&A: Interactive document exploration with memory
  • Structured Learning: Auto-generated lessons with quizzes and visual aids
  • Content Chunking: ADHD-optimized micro-lessons with engagement tracking
  • Voice Navigation: Hands-free document interaction for blind users

🧩 Disability-Specific Modes

1. Dyslexia Support (/dyslexia)

Optimized for reading comprehension challenges

  • βœ… OpenDyslexic Font: Specialized typeface with weighted bottoms
  • βœ… Adjustable Letter Spacing: 0-5px customization via sidebar
  • βœ… Three Reading Levels:
    • Mild: Simplified sentence structure (15-20 words)
    • Moderate: Middle-school vocabulary (≀15 words/sentence)
    • Severe: Elementary-level language (≀10 words/sentence)
  • βœ… Color Overlays: Reduce visual stress
  • βœ… Text-to-Speech: Synchronized audio reading

AI Processing: Claude analyzes text complexity and rewrites content while preserving meaning (api/levels)


2. Visual Impairment / Blindness (/blindness)

Complete audio-first experience

  • βœ… Conversational AI Assistant: Ask questions about document content
  • βœ… Voice-Controlled Navigation: Spacebar-activated speech recognition
  • βœ… PDF-to-Narration Conversion: Describes text AND images
  • βœ… Keyboard-Only Controls: Full accessibility without mouse
  • βœ… Conversation Memory: Context-aware dialogue across questions

Interaction Flow:

  1. Press & hold SPACEBAR β†’ Ask question
  2. Release SPACEBAR β†’ Submit query
  3. Claude analyzes document β†’ Generates spoken answer
  4. Press SPACEBAR during playback β†’ Interrupt/new question

AI Processing:

  • /api/narrate - Converts PDF to conversational narration
  • /api/conversation - Handles Q&A with document context

3. Autism Spectrum Support (/autism)

Structured, predictable learning environment

  • βœ… Chunked Content: Manageable sections with clear progression
  • βœ… Concrete Examples: Abstract concepts explained literally
  • βœ… Visual Vocabulary Aids: Term β†’ Definition β†’ Example tables
  • βœ… Interactive Assessments:
    • True/False with explanations
    • Multiple choice (4 options)
    • Short answer with rubrics
  • βœ… "Draw-It" Visual Learning: Diagram instructions with labels
  • βœ… Spaced Repetition: Auto-generated review schedule
  • βœ… Age Personalization: Content adapts to grade level

AI Processing: /api/generate-lesson returns strict JSON schema:

{
  "summary": ["5-7 bullet points"],
  "vocabulary": [{"term": "...", "definition": "...", "example": "..."}],
  "questions": {
    "trueFalse": {...},
    "multipleChoice": {...},
    "shortAnswer": {...}
  },
  "drawIt": {"title": "...", "labels": [...], "caption": "..."},
  "reviewPlan": ["Tomorrow", "In 3 days"]
}

4. ADHD Support (/adhd)

Engagement-optimized micro-learning

  • βœ… Micro-Lessons: 100-150 word chunks with emoji anchors
  • βœ… Focus Timer: 25-minute Pomodoro sessions
  • βœ… Gamified Progress: πŸŒ±β†’πŸŒΏβ†’πŸŒ³β†’πŸ† milestone tracking
  • βœ… Active Highlighting: Visual focus on current section
  • βœ… Break Reminders: Prevents burnout
  • βœ… Interactive Checkpoints: Quick questions after each chunk
  • βœ… 6 Voice Options: Personalize narration (alloy, echo, fable, onyx, nova, shimmer)

Content Structure:

πŸ“Œ Quick Summary (3-5 bullets)
  ↓
🎯 Micro-Lesson 1 (100-150 words)
  ↓
βœ… Checkpoint Question
  ↓
🎯 Micro-Lesson 2...

AI Processing: /api/convert transforms PDFs with ADHD-specific constraints (short sentences, emojis, whitespace optimization)


πŸ›  Tech Stack

Frontend

Technology Version Purpose
Next.js 15.2.4 React framework with App Router
React 19.0.0 UI library
TypeScript 5.x Type safety
Tailwind CSS 4.x Utility-first styling
Radix UI Latest Accessible component primitives
Lucide React 0.487.0 Icon library
react-markdown 10.1.0 Markdown rendering

Backend / AI

Technology Version Purpose
Claude AI Sonnet 4.5 Document processing, Q&A, content transformation
OpenAI 4.91.1 Text-to-Speech (TTS-1, TTS-1-HD)
pdf-parse 1.1.1 PDF text extraction
pdfjs-dist 5.1.91 PDF rendering
Web Speech API Native Browser speech recognition (blindness mode)

Infrastructure

  • Vercel: Deployment platform
  • Vercel Analytics: Usage tracking
  • Environment Variables: Secure API key management

πŸš€ Getting Started

Prerequisites


πŸ“¦ Installation

  1. Clone the repository

    git clone https://github.com/yourusername/ReadEaseAI.git
    cd ReadEaseAI
  2. Install dependencies

    pnpm install
    # or
    npm install
  3. Set up environment variables

    cp .env.example .env

    Edit .env and add your API keys:

    ANTHROPIC_API_KEY=your_anthropic_key_here
    OPENAI_API_KEY=your_openai_key_here
  4. Run the development server

    pnpm dev
    # or
    npm run dev
  5. Open your browser Navigate to http://localhost:3000


πŸ”‘ Environment Variables

Create a .env file in the root directory:

# Required
ANTHROPIC_API_KEY=sk-ant-xxxxx
OPENAI_API_KEY=sk-xxxxx

# Optional
NODE_ENV=development
NEXT_PUBLIC_ANALYTICS_ID=your_analytics_id

πŸ’» Usage

Basic Workflow

  1. Select Accessibility Mode: Choose from Dyslexia, Blindness, Autism, or ADHD on the home page
  2. Upload PDF: Drag & drop or select a PDF document
  3. AI Processing: Document is analyzed and transformed (10-30 seconds)
  4. Customized Reading: Interact with content optimized for your needs

Mode-Specific Tips

Dyslexia Mode

  • Use the sidebar to adjust letter spacing (find your sweet spot)
  • Try different reading levels to match your comfort
  • Enable TTS for audio reinforcement

Blindness Mode

  • Press and HOLD spacebar to ask questions
  • Navigate with Tab/Enter for keyboard-only control
  • Ask: "Summarize page 3" or "What is the main argument?"

Autism Mode

  • Progress through sections linearly for predictable structure
  • Use the Draw-It section for visual reinforcement
  • Review vocabulary before diving into content

ADHD Mode

  • Set a realistic timer goal (start with 10 minutes)
  • Complete checkpoints to maintain engagement
  • Celebrate milestones (track your πŸŒ±β†’πŸŒΏβ†’πŸŒ³β†’πŸ† journey)

πŸ”Œ API Documentation

Core Endpoints

POST /api/narrate

Convert PDF to audio narration

Request:
{
  file: Buffer,          // PDF file as buffer
  fileName: string       // Original filename
}

Response:
{
  narration: string,     // Conversational narration text
  success: boolean
}

Model: Claude Sonnet 4.5 (4000 tokens)


POST /api/conversation

Q&A with document context

Request:
{
  question: string,
  documentContext: string,
  conversationHistory: Message[]
}

Response:
{
  answer: string,        // Audio-optimized response
  success: boolean
}

Model: Claude Sonnet 4.5 (1000 tokens)


POST /api/generate-lesson

Generate autism-friendly structured lesson

Request:
{
  file: Buffer,
  age: number,
  sectionNumber: number
}

Response:
{
  summary: string[],
  vocabulary: Vocabulary[],
  questions: Questions,
  drawIt: DrawItSection,
  reviewPlan: string[]
}

Model: Claude Sonnet 4.5 (4000 tokens)


POST /api/convert

Transform PDF for ADHD mode

Request:
{
  file: Buffer,
  mode: "adhd" | "dyslexic" | "deaf" | "autism"
}

Response:
{
  converted: string,     // Markdown content with "---" separators
  success: boolean
}

Model: Claude Sonnet 4.5 (4000 tokens)


POST /api/parse

Extract and clean PDF text for dyslexia

Request:
{
  file: Buffer,
  useAI?: boolean        // Default: false
}

Response:
{
  text: string,          // Cleaned, dyslexia-friendly text
  success: boolean
}

Model: Claude Sonnet 4.5 (4096 tokens) - if useAI=true


POST /api/levels

Adjust reading complexity level

Request:
{
  text: string,
  level: "mild" | "moderate" | "severe"
}

Response:
{
  summary: string,
  rephrased: string
}

Model: Claude Sonnet 4.5 (4096 tokens, temp: 0.3)


POST /api/tts

Generate Text-to-Speech audio

Request:
{
  text: string,
  voice?: "alloy" | "echo" | "fable" | "onyx" | "nova" | "shimmer"
}

Response:
{
  audio: string          // Base64-encoded MP3
}

Model: OpenAI TTS-1


πŸ— Architecture

Project Structure

ReadEaseAI/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/                    # API Routes
β”‚   β”‚   β”‚   β”œβ”€β”€ ai-process/         # Reading level simplification
β”‚   β”‚   β”‚   β”œβ”€β”€ conversation/       # Blindness Q&A
β”‚   β”‚   β”‚   β”œβ”€β”€ convert/            # ADHD content transformation
β”‚   β”‚   β”‚   β”œβ”€β”€ generate-lesson/    # Autism lesson generation
β”‚   β”‚   β”‚   β”œβ”€β”€ narrate/            # PDF to narration
β”‚   β”‚   β”‚   β”œβ”€β”€ parse/              # PDF parsing
β”‚   β”‚   β”‚   β”œβ”€β”€ tts/                # Text-to-Speech
β”‚   β”‚   β”‚   └── tts_adhd/           # ADHD-specific TTS
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ adhd/                   # ADHD mode pages
β”‚   β”‚   β”œβ”€β”€ autism/                 # Autism mode pages
β”‚   β”‚   β”œβ”€β”€ blindness/              # Blindness mode pages
β”‚   β”‚   β”œβ”€β”€ dyslexia/               # Dyslexia mode pages
β”‚   β”‚   β”œβ”€β”€ processed/              # Dyslexia reader view
β”‚   β”‚   β”œβ”€β”€ reader/                 # ADHD chunked reader
β”‚   β”‚   β”œβ”€β”€ refined/                # Alternative dyslexia reader
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ fonts/                  # Font files (OpenDyslexic)
β”‚   β”‚   β”œβ”€β”€ layout.tsx              # Root layout with global sidebar
β”‚   β”‚   β”œβ”€β”€ page.tsx                # Home page (mode selection)
β”‚   β”‚   └── globals.css             # Global styles
β”‚   β”‚
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ ui/                     # Reusable UI components
β”‚   β”‚   β”‚   β”œβ”€β”€ button.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ card.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ dialog.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ FileUploader.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ fontSelector.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ input.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ slider.tsx
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   └── app-sidebar.tsx         # Global sidebar (font/spacing controls)
β”‚   β”‚
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   └── use-mobile.ts           # Mobile detection hook
β”‚   β”‚
β”‚   └── lib/
β”‚       └── utils.ts                # Utility functions
β”‚
β”œβ”€β”€ public/
β”‚   └── fonts/                      # Public font assets
β”‚
β”œβ”€β”€ .env                            # Environment variables (gitignored)
β”œβ”€β”€ .env.example                    # Environment template
β”œβ”€β”€ package.json                    # Dependencies
β”œβ”€β”€ tsconfig.json                   # TypeScript config
β”œβ”€β”€ next.config.ts                  # Next.js config
β”œβ”€β”€ tailwind.config.ts              # Tailwind config
β”œβ”€β”€ components.json                 # shadcn/ui config
└── README.md                       # This file

Data Flow

User uploads PDF
       ↓
Next.js API Route
       ↓
PDF Parser (pdf-parse)
       ↓
Claude AI Processing
  β”œβ”€ Narration generation
  β”œβ”€ Text simplification
  β”œβ”€ Lesson structuring
  └─ Q&A answering
       ↓
OpenAI TTS (optional)
       ↓
Client-side rendering
  β”œβ”€ Custom fonts
  β”œβ”€ Accessibility controls
  └─ Interactive UI

🀝 Contributing

We welcome contributions from the community! Here's how to get started:

Development Workflow

  1. Fork the repository
  2. Create a feature branch
    git checkout -b feature/amazing-feature
  3. Make your changes
    • Follow TypeScript best practices
    • Maintain accessibility standards
    • Test across all disability modes
  4. Commit with descriptive messages
    git commit -m "feat(dyslexia): add color overlay customization"
  5. Push to your fork
    git push origin feature/amazing-feature
  6. Open a Pull Request

Code Standards

  • TypeScript: Strict mode enabled, no implicit any
  • Accessibility: WCAG 2.1 Level AA compliance
  • Formatting: Use Prettier (run pnpm format)
  • Linting: Pass ESLint checks (pnpm lint)
  • Testing: Include tests for new features

Areas We Need Help

  • 🌍 Internationalization: Support for non-English languages
  • πŸ“± Mobile Optimization: Enhanced touch interfaces
  • 🎨 Design: Improved visual accessibility
  • πŸ§ͺ Testing: Unit/integration test coverage
  • πŸ“– Documentation: Tutorials and user guides
  • β™Ώ Accessibility: Additional disability modes (e.g., hearing impairment)

πŸ—Ί Roadmap

See FUTURE_ROADMAP.md for detailed expansion plans including:

  • Multi-Agent Systems: AI orchestration with LangGraph
  • RAG Integration: Vector database for document intelligence
  • MCP Support: Model Context Protocol for extensibility
  • Advanced Features: Eye-tracking, spatial audio, haptic feedback
  • Personalization: User profiles and adaptive learning

πŸ“Š Performance

  • PDF Processing: 10-30 seconds (varies by document size)
  • Text-to-Speech: Real-time streaming
  • API Response Times:
    • Narration: ~15-20s (4000 tokens)
    • Q&A: ~3-5s (1000 tokens)
    • Lesson Generation: ~20-25s (4000 tokens)
  • Browser Support: Chrome, Firefox, Safari (latest 2 versions)

πŸ”’ Privacy & Security

  • No Data Storage: PDFs are processed in-memory and discarded
  • API Key Security: Keys stored in environment variables, never exposed to client
  • HTTPS Only: All communication encrypted in transit
  • Client-Side Processing: Where possible, processing happens in browser (Web Speech API)

πŸ“„ License

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


πŸ™ Acknowledgments

  • Anthropic: For Claude AI and accessibility research
  • OpenAI: For TTS capabilities
  • Radix UI: For accessible component primitives
  • Vercel: For hosting and deployment infrastructure
  • OpenDyslexic: For the dyslexia-friendly font

πŸ“ž Support


🌟 Star History

If this project helps you or someone you know, please consider starring it on GitHub! ⭐


Built with ❀️ for accessibility and inclusion

Website β€’ Documentation β€’ Demo

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •