An intelligent English conversation practice application that helps users improve their speaking skills through AI-powered interactions.
- ๐ค Speech Recognition - Real-time voice input with Web Speech API
- ๐ Text-to-Speech - Natural AI voice responses
- ๐ฌ Multiple Conversation Modes:
- Free Talk - Natural conversations
- Grammar Focus - Grammar correction and practice
- Vocabulary Building - Learn new words
- Pronunciation Practice - Improve accent
- Business English - Professional communication
- Travel English - Practical travel phrases
- ๐ญ AI Personalities: Choose between Teacher, Girlfriend, or Friend modes
- ๐ Progress Tracking - Monitor your learning journey with detailed analytics
- ๐ฑ Mobile Optimized - PWA support for mobile devices
- Environment Auto-Detection: Automatically switches between:
- Local Development: Ollama (100% free, runs offline)
- Production: Groq API (fast cloud inference)
- Smart Responses: Context-aware conversations with personality matching
- Learning Analytics: Track improvement over time with detailed metrics
Backend:
- FastAPI (async Python web framework)
- PostgreSQL (database with conversation history)
- WebSocket (real-time communication)
- AI Providers:
- Ollama (local AI - llama3.1:8b)
- Groq API (production - llama-3.3-70b-versatile)
Frontend:
- React 18 + Vite (modern frontend)
- TailwindCSS (responsive styling)
- Framer Motion (smooth animations)
- Web Speech API (voice recognition)
- Zustand (state management)
- Recharts (progress visualization)
Database Schema:
- Users & Profiles
- Conversation Sessions
- Message History
- Learning Progress Analytics
- Feedback System
- Python 3.8+
- Node.js 18+
- PostgreSQL
- Ollama (for local) OR Groq API key (for cloud)
- Clone Repository
git clone https://github.com/algsoch/english_bot.git
cd english_bot- Backend Setup
# Create virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Environment setup
cp .env.template .env
# Edit .env with your settings
# Start the backend
python3 run.py- Frontend Setup
cd frontend
npm install
cp .env.example .env
# Configure frontend environment- Database Setup
# Create database
createdb englishbot
# Run schema
psql -d englishbot -f database/schema.sql- AI Provider Setup
Option A - Local (Free):
# Install Ollama
curl https://ollama.ai/install.sh | sh
# Pull model
ollama pull llama3.1:8bOption B - Cloud (Groq):
- Get API key from Groq Console
- Add to
.env:GROQ_API_KEY=your-key-here
Start Backend:
# Activate virtual environment
source venv/bin/activate # Windows: venv\Scripts\activate
# Run the backend
python3 run.pyStart Frontend:
cd frontend
npm run devVisit: http://localhost:5173
english_bot/
โโโ backend/ # FastAPI Backend
โ โโโ ai_service.py # AI provider management
โ โโโ config.py # Environment configuration
โ โโโ database.py # Database connection
โ โโโ main.py # FastAPI application
โ โโโ models.py # SQLAlchemy models
โ โโโ schemas.py # Pydantic schemas
โโโ frontend/ # React Frontend
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โโโ pages/ # Page components
โ โ โโโ services/ # API & WebSocket
โ โ โโโ store/ # State management
โ โโโ public/ # Static assets
โโโ database/
โ โโโ schema.sql # PostgreSQL schema
โโโ .env.template # Environment template
โโโ requirements.txt # Python dependencies
โโโ README.md
The app automatically detects environment and configures AI providers:
- Uses Ollama locally (free, private)
- Local PostgreSQL database
- Perfect for development and privacy
- Uses Groq API (fast, cloud-based)
- Production PostgreSQL (Render/Railway)
- Optimized for deployment
# Auto-detection
ENVIRONMENT=development
AI_PROVIDER=auto
# Groq (Production)
GROQ_API_KEY=your-api-key
GROQ_MODEL=llama-3.3-70b-versatile
# Ollama (Local)
OLLAMA_HOST=http://localhost:11434
OLLAMA_MODEL=llama3.1:8b
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/englishbot- Fork this repository
- Create Web Service on Render
- Set environment variables:
ENVIRONMENT=productionDATABASE_URL=your-postgres-urlGROQ_API_KEY=your-api-key
- Deploy automatically!
docker-compose up --build- ๐จโ๐ซ Teacher: Professional, educational feedback
- ๐ Girlfriend: Casual, friendly conversations
- ๐ซ Friend: Relaxed, buddy-like chat
- Free Talk: Natural conversation practice
- Grammar Focus: Corrections and explanations
- Vocabulary: Learn new words in context
- Pronunciation: Accent and clarity improvement
- Business: Professional communication
- Travel: Practical phrases and situations
- Click microphone for voice input
- Type messages for text chat
- Get real-time AI feedback
- Track your progress over time
- Real-time speech-to-text
- Multiple language support
- Noise filtering and echo prevention
- Mobile device compatibility
- Context-aware conversations
- Personality-matched responses
- Grammar corrections with explanations
- Vocabulary suggestions and definitions
- Conversation history tracking
- Speaking time and accuracy metrics
- Grammar improvement over time
- Vocabulary growth measurement
- Free Talk: Natural conversation flow
- Grammar Focus: Detailed corrections
- Vocabulary: Word learning in context
- Pronunciation: Accent improvement
- Business: Professional scenarios
- Travel: Practical situations
- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Commit changes:
git commit -m 'Add amazing feature' - Push branch:
git push origin feature/amazing-feature - Open Pull Request
MIT License - feel free to use this project for learning and development.
- FastAPI - Modern Python web framework
- React - Frontend library
- Ollama - Local AI models
- Groq - Fast AI inference
- PostgreSQL - Reliable database
๐ฏ Perfect for English learners who want to practice speaking with AI assistance!
psql -d englishbot -f database/schema.sql
### 2. Configure Environment
```bash
# Copy environment file
cp .env.example .env
# Edit .env with your settings (already configured for local use)
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate # On macOS/Linux
# or
venv\Scripts\activate # On Windows
# Install Python dependencies
pip install --upgrade pip
pip install -r requirements.txt
# Start backend server
python -m backend.mainBackend will run on: http://localhost:8000
Note: Keep the virtual environment activated while running the backend.
# Navigate to frontend
cd frontend
# Install dependencies
npm install
# Start development server
npm run devFrontend will run on: http://localhost:5173
- Open http://localhost:5173
- Enter your name, email, and English level
- Choose a conversation mode
- Click "Start Speaking Practice"
- Hold the microphone button to speak
- AI will respond via voice automatically
- Get instant feedback on grammar, vocabulary, or pronunciation
| Mode | Description |
|---|---|
| Free Talk | Natural, flowing conversation with follow-up questions |
| Grammar Focus | Specific grammar corrections with explanations |
| Vocabulary | Learn new words and alternative expressions |
| Pronunciation | Practice difficult words with phonetic guidance |
| Business English | Professional scenarios (meetings, presentations) |
| Travel English | Travel situations (airports, hotels, directions) |
The app is a Progressive Web App (PWA):
- Open on mobile browser
- Click "Add to Home Screen"
- Use like a native app
- Works offline (basic features)
- Railway (Free tier)
- Render (Free tier)
- Fly.io (Free tier)
- Vercel (Free, unlimited)
- Netlify (Free tier)
- GitHub Pages (Free)
- Supabase (Free PostgreSQL)
- ElephantSQL (Free tier)
- Neon (Free serverless Postgres)
Edit .env:
OLLAMA_MODEL=llama3.1:8b # or mistral, phi, etc.Edit frontend/src/services/speech.js - modify rate, pitch, volume
- Add mode to
backend/ai_service.py - Add mode UI in
frontend/src/pages/Home.jsx
- users - User profiles and preferences
- conversations - Conversation sessions
- messages - All chat messages
- message_feedback - AI-generated feedback
- user_progress - Daily progress tracking
Ollama not connecting:
# Check if Ollama is running
ollama list
# If not, start it:
ollama serveDatabase connection failed:
# Check PostgreSQL is running
psql -l
# Update DATABASE_URL in .envSpeech recognition not working:
- Use Chrome/Edge (best support)
- Allow microphone permissions
- Check HTTPS in production
MIT License - Free to use and modify
Contributions welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests