A comprehensive AI-powered language learning platform specifically designed for Telugu speakers learning English. Built with Flask, SQLAlchemy, and Google's Gemini AI.
4-Phase Intelligent Learning System:
- Goal Setting & Onboarding: Set daily time goals and learning focus areas
- AI Proficiency Assessment: Conversational assessment that evaluates English level through natural dialogue
- Personalized Dashboard: Daily streaks, contextual challenges, vocabulary discovery, and adaptive recommendations
- Smart Session Management: AI-powered learning sessions with real-time vocabulary tracking and progress analytics
Key Personalization Features:
- Intelligent Tutoring: AI adapts conversations based on user proficiency and mistakes
- Contextual Vocabulary Learning: Automatically discovers and tracks new words from conversations with Telugu translations
- Mistake Pattern Analysis: AI identifies common errors and generates targeted practice activities
- Daily Challenges: Personalized conversation starters and activities based on learning goals
- Adaptive Content: Difficulty and content type adjust based on assessment results and ongoing performance
- Quiz Generation: Multiple-choice questions with Telugu explanations
- Flashcards: English words with Telugu translations
- Reading Comprehension: English texts with vocabulary explanations
- Writing Practice: Prompts with AI feedback and corrections
- Role-Playing Scenarios: Conversational practice in real-world contexts
- Image Recognition: Vocabulary learning through camera/uploaded images
- AI Tutor Chat: Interactive conversations for practice
- Learning Sessions: Detailed session tracking with time spent, words learned, and AI-generated summaries
- Vocabulary Mastery: Track word discovery, practice frequency, and mastery levels (new โ learning โ mastered)
- Proficiency Progression: Monitor improvement across grammar, vocabulary, fluency, and confidence
- Goal Achievement: Daily and weekly goal tracking with streak maintenance
- Performance Analytics: Average scores, time spent, improvement trends
- Badge System: Earn badges for milestones and achievements
- Points & Leaderboards: Compete with other learners
- Daily Challenges: Complete activities to maintain streaks
- Achievement Tracking: Progress towards learning goals
- User Registration/Login: Secure authentication system
- Profile Management: Track native language, proficiency level
- Dashboard: Comprehensive overview of progress and achievements
- Backend: Flask (Python)
- Database: SQLAlchemy with PostgreSQL/SQLite support
- AI Integration: Google Gemini API
- Cloud Database: Supabase (optional)
- Image Processing: Pillow (PIL)
- Authentication: Werkzeug security
language-learning-platform/
โโโ app/
โ โโโ __init__.py # Flask app factory
โ โโโ models/ # Database models
โ โ โโโ user.py # User & Profile models
โ โ โโโ activity.py # Activity & UserActivityLog models
โ โ โโโ course.py # LearningPath & Course models
โ โ โโโ gamification.py # Badge & Achievement models
โ โ โโโ personalization.py # Personalization models (NEW!)
โ โโโ services/ # Business logic
โ โ โโโ activity_generator_service.py # AI activity generation
โ โ โโโ progress_service.py # Progress tracking
โ โ โโโ gamification_service.py # Badges & achievements
โ โ โโโ personalization_service.py # Personalization features (NEW!)
โ โโโ api/ # REST API endpoints
โ โโโ auth_routes.py # Authentication endpoints
โ โโโ user_routes.py # User management endpoints
โ โโโ activity_routes.py # Activity generation endpoints
โ โโโ gamification_routes.py # Gamification endpoints
โ โโโ personalization_routes.py # Personalization API (NEW!)
โโโ config.py # Configuration settings
โโโ app.py # Application entry point
โโโ init_db.py # Database initialization
โโโ test_activity_generator.py # Activity testing script
โโโ test_personalization.py # Personalization testing script (NEW!)
โโโ requirements.txt # Python dependencies
โโโ PERSONALIZATION_API.md # Personalization API documentation (NEW!)
โโโ .env.example # Environment variables template
# Clone the repository
git clone <repository-url>
cd language-learning-platform
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
# Install dependencies
pip install -r requirements.txt# Copy environment template
cp .env.example .env
# Edit .env file with your configuration:
# - GEMINI_API_KEY: Your Google Gemini API key
# - SECRET_KEY: A secure secret key for Flask
# - Database configuration (SQLite for development)# Initialize database with default data
python init_db.py# Start the Flask development server
python app.pyThe application will be available at http://localhost:5000
# Test the AI activity generation (without API key)
python test_activity_generator.py
# Test the new personalization features (with running server)
python test_personalization.pyPOST /api/auth/register- Register new userPOST /api/auth/login- User loginPUT /api/auth/profile/<user_id>- Update profile
GET /api/user/profile/<user_id>- Get user profileGET /api/user/dashboard/<user_id>- Get dashboard dataPOST /api/user/learning-paths- Create learning pathPOST /api/user/activity-completion- Log activity completion
POST /api/activity/generate/quiz- Generate quizPOST /api/activity/generate/flashcards- Generate flashcardsPOST /api/activity/generate/reading- Generate reading exercisePOST /api/activity/generate/writing-prompt- Generate writing promptPOST /api/activity/generate/role-play- Generate role-play scenarioPOST /api/activity/analyze-image- Analyze image for vocabularyPOST /api/activity/chat- Chat with AI tutorPOST /api/activity/feedback- Get writing feedback
POST /api/personalization/goals- Set user learning goalsPOST /api/personalization/assessment/start- Start proficiency assessmentPOST /api/personalization/assessment/{id}/respond- Submit assessment responsePOST /api/personalization/assessment/{id}/complete- Complete assessmentGET /api/personalization/dashboard- Get personalized dashboardPOST /api/personalization/session/start- Start learning sessionPOST /api/personalization/session/{id}/end- End learning sessionPOST /api/personalization/vocabulary/track- Track vocabulary learningGET /api/personalization/vocabulary- Get user vocabularyPOST /api/personalization/vocabulary/{id}/practice- Practice vocabulary
๐ See PERSONALIZATION_API.md for detailed documentation.
GET /api/gamification/badges/<user_id>- Get user badgesGET /api/gamification/leaderboard- Get leaderboardPOST /api/gamification/check-achievements/<user_id>- Check achievements
python test_activity_generator.py# Start the server first
python app.py
# In another terminal, run the comprehensive test
python test_personalization.pyPersonalization Test Coverage:
- โ User authentication and goal setting
- โ AI-powered proficiency assessment with conversational evaluation
- โ Personalized dashboard with streaks, challenges, and vocabulary
- โ Learning session management with vocabulary tracking
- โ Vocabulary mastery progression and practice recording
Use tools like Postman or curl to test the API endpoints:
# Register a new user
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username": "telugu_learner", "email": "user@example.com", "password": "password123"}'
# Set learning goals
curl -X POST http://localhost:5000/api/personalization/goals \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-d '{"daily_time_goal": 15, "learning_focus": "conversation"}'
# Generate a quiz
curl -X POST http://localhost:5000/api/activity/generate/quiz \
-H "Content-Type: application/json" \
-d '{"topic": "English greetings", "level": "beginner"}'GEMINI_API_KEY: Google Gemini API key for AI generationSECRET_KEY: Flask secret key for securityDATABASE_URL: Database connection stringSUPABASE_URL&SUPABASE_KEY: Supabase configuration (optional)
- Development: SQLite database (default)
- Production: PostgreSQL via Supabase or other providers
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support, please open an issue on the GitHub repository or contact the development team.
- Voice Recognition: Practice pronunciation with speech-to-text
- Mobile App: React Native or Flutter mobile application
- Offline Mode: Download activities for offline learning
- Social Features: Connect with other learners, share progress
- Advanced Analytics: Detailed learning analytics and recommendations
- Custom Courses: User-generated content and courses