Skip to content

Repository files navigation

51EnglishTutor

An interactive English learning platform powered by OpenAI's Realtime API and Agents SDK, designed to provide immersive oral and spoken English practice through AI-powered conversation scenarios and listening comprehension exercises.

🌟 Features

Interactive Oral Conversation Practice

  • Real-time voice conversations with AI tutors in authentic campus scenarios
  • 30-second practice sessions with immediate feedback and scoring
  • Multiple conversation contexts including:
    • Library study buddy planning
    • Dorm move-in welcome conversations
    • Club fair exploration and networking
    • Dining hall casual chats
    • Roommate harmony discussions

Listening Comprehension Exercises

  • Immersive listening scenarios with realistic campus announcements and briefings
  • Interactive quiz questions to test comprehension
  • Visual context with campus images to enhance learning
  • Multiple difficulty levels covering:
    • University orientation briefings
    • Library workshop announcements
    • Career center internship preparation
    • Campus events roundups
    • Academic advising reminders

Advanced AI Features

  • Voice Activity Detection (VAD) for natural conversation flow
  • Real-time audio streaming with low latency
  • Intelligent feedback system with scoring and improvement tips
  • Multiple voice options (Alloy, Verse) for varied learning experiences
  • Comprehensive evaluation after each practice session

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • OpenAI API key
  • Modern web browser with WebRTC support

Installation

  1. Clone the repository

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

    npm install
  3. Set up environment variables

    # Copy the sample environment file
    cp .env.sample .env
    
    # Add your OpenAI API key
    echo "OPENAI_API_KEY=your_api_key_here" >> .env
  4. Start the development server

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

🎯 Learning Scenarios

Oral Conversation Practice

Library Study Buddy

  • Context: Planning a study session with a classmate
  • Skills: Polite requests, time coordination, study preferences
  • Duration: 30-second practice sessions
  • Voice: Verse (conversational, friendly)

Dorm Move-In Welcome

  • Context: Greeting first-year students during move-in day
  • Skills: Small talk, introductions, dorm life discussions
  • Duration: 30-second practice sessions
  • Voice: Verse (welcoming, mentor-like)

Club Fair Exploration

  • Context: Exploring campus organizations and interests
  • Skills: Interest expression, organization inquiries, networking
  • Duration: 30-second practice sessions
  • Voice: Verse (guide-like, enthusiastic)

Dining Hall Chat

  • Context: Casual conversation while waiting in line
  • Skills: Food discussions, weekend plans, casual small talk
  • Duration: 30-second practice sessions
  • Voice: Verse (casual, friendly)

Roommate Harmony Check-in

  • Context: Discussing routines and boundaries with roommates
  • Skills: Collaborative communication, conflict resolution, negotiation
  • Duration: 30-second practice sessions
  • Voice: Verse (mediator-like, understanding)

Listening Comprehension Exercises

Orientation Briefing

  • Content: Campus orientation events and procedures
  • Quiz Focus: Check-in locations, event timing, resource access
  • Duration: ~18 seconds of audio + quiz time
  • Voice: Alloy (clear, informative)

Library Workshop Update

  • Content: Research skills workshop announcements
  • Quiz Focus: Registration procedures, workshop details, timing
  • Duration: ~18 seconds of audio + quiz time
  • Voice: Alloy (professional, clear)

Career Center Spotlight

  • Content: Internship preparation series information
  • Quiz Focus: Session topics, scheduling, target audience
  • Duration: ~18 seconds of audio + quiz time
  • Voice: Alloy (motivational, clear)

Campus Events Roundup

  • Content: Weekend campus events and activities
  • Quiz Focus: Event timing, locations, activity details
  • Duration: ~18 seconds of audio + quiz time
  • Voice: Alloy (engaging, informative)

Academic Advising Reminder

  • Content: Course planning meeting instructions
  • Quiz Focus: Deadlines, locations, required materials
  • Duration: ~18 seconds of audio + quiz time
  • Voice: Alloy (professional, clear)

πŸ—οΈ Technical Architecture

Core Technologies

  • Frontend: Next.js 15 with React 19
  • AI Integration: OpenAI Realtime API + Agents SDK
  • Audio Processing: WebRTC for real-time audio streaming
  • Styling: Tailwind CSS for responsive design
  • TypeScript: Full type safety throughout the application

Key Components

Agent Configuration System

// Example: Oral Conversation Agent
new RealtimeAgent({
  name: 'oral_library_study_buddy',
  voice: 'verse',
  instructions: 'You are meeting a classmate in the library...',
  handoffs: [],
  tools: [],
  handoffDescription: 'Library study planning partner',
})

Listening Comprehension Engine

  • Quiz Generation: Dynamic multiple-choice questions
  • Audio Timing: Precise control over when questions appear
  • Visual Context: Campus images to enhance comprehension
  • Immediate Feedback: Real-time answer evaluation

Real-time Audio Processing

  • Voice Activity Detection: Automatic speech recognition
  • Codec Support: Wide-band Opus (48kHz) and narrow-band PCMU/PCMA (8kHz)
  • Low Latency Streaming: Optimized for natural conversation flow
  • Audio Download: Session recording capabilities

🎨 User Interface

Main Features

  • Scenario Selection: Dropdown menus for choosing learning contexts
  • Real-time Transcript: Live conversation display with message history
  • Event Logging: Comprehensive activity tracking and debugging
  • Audio Controls: Playback, recording, and voice activity settings
  • Progress Tracking: Visual feedback on quiz performance

Responsive Design

  • Mobile Optimized: Touch-friendly interface for all devices
  • Accessibility: Screen reader support and keyboard navigation
  • Visual Feedback: Clear indicators for conversation states and quiz results

πŸ”§ Configuration

Environment Variables

OPENAI_API_KEY=your_openai_api_key_here

Customization Options

  • Voice Selection: Choose between Alloy and Verse voices
  • Session Duration: Adjustable practice session lengths
  • Quiz Timing: Configurable delay before showing questions
  • Audio Quality: Toggle between high and low bandwidth codecs

πŸ“š Learning Methodology

Conversational Practice

  1. Warm-up: Brief scenario introduction
  2. Practice Session: 30-second focused conversation
  3. Evaluation: Immediate scoring and feedback
  4. Improvement Tips: Specific suggestions for enhancement

Listening Comprehension

  1. Context Setup: Visual and audio introduction
  2. Listening Phase: Focused audio content delivery
  3. Quiz Assessment: Multiple-choice comprehension check
  4. Feedback: Immediate correct/incorrect response with explanations

πŸš€ Deployment

Production Build

npm run build
npm start

Environment Setup

  • Ensure all environment variables are properly configured
  • Set up HTTPS for WebRTC functionality in production
  • Configure appropriate CORS settings for your domain

🀝 Contributing

We welcome contributions to improve the English learning experience! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Development Guidelines

  • Follow TypeScript best practices
  • Maintain accessibility standards
  • Test across different browsers and devices
  • Update documentation for new features

πŸ“„ License

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

πŸ†˜ Support

For questions, issues, or feature requests:

  • Open an issue on GitHub
  • Check the documentation for common solutions
  • Review the troubleshooting section below

πŸ” Troubleshooting

Common Issues

Audio Not Working

  • Ensure your browser supports WebRTC
  • Check microphone permissions
  • Verify your OpenAI API key is valid

Connection Issues

  • Check your internet connection
  • Verify firewall settings allow WebRTC traffic
  • Try refreshing the page

Performance Issues

  • Close other browser tabs to free up resources
  • Check your browser's audio processing capabilities
  • Ensure you're using a modern browser version

Built with ❀️ for English learners worldwide

Transform your English speaking and listening skills through immersive, AI-powered conversations and exercises designed for real-world success.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages