A comprehensive web application for English language learning featuring AI-powered flashcard generation, grammar checking, text enhancement, and interactive chatbot functionality.
- Flashcard Generation: AI-powered flashcard creation with translations, pronunciations, and synonyms
- Learn Flashcards: Interactive learning system with progress tracking
- Grammar Checking: AI-based grammar correction and suggestions
- Text Enhancement: Improve writing quality with AI assistance
- AI Chatbot: Interactive conversation practice
- Humanize AI Text: Convert AI-generated text to more natural language
- AI Detection: Check if text was generated by AI
- FastAPI: Modern, fast web framework for building APIs
- Python 3.12: Core programming language
- OpenAI API: AI-powered language processing
- Uvicorn: ASGI server for running the application
- Pydantic: Data validation and settings management
- Pandas: Data manipulation and analysis
- Next.js: React framework for production
- TypeScript: Type-safe JavaScript
- Tailwind CSS: Utility-first CSS framework
- React Hot Toast: Toast notifications
- Axios: HTTP client for API requests
- Chart.js: Data visualization
For Linux/macOS:
./app.shFor Windows:
app.batThese scripts will automatically:
- Check for required dependencies (Python, Node.js, npm)
- Create and activate Python virtual environment
- Install all backend dependencies
- Install all frontend dependencies
- Create environment configuration files
- Kill any processes using ports 3000 and 8000
- Start both backend and frontend servers
- Provide health checks to ensure everything is running
If you prefer to set up manually or need to troubleshoot:
- Python 3.12 or higher
- Node.js 18 or higher
- npm package manager
- Create
.envfile in the root directory:OPENAI_API_KEY=your_api_key_here
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.pycd frontend
npm install
npm run devOnce running, access the application at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
GET /flashcards- Get all flashcardsPOST /flashcards- Create a new flashcardPUT /flashcards/{word}- Update a flashcardDELETE /flashcards/{word}- Delete a flashcardPUT /flashcards/{word}/learned- Mark flashcard as learned
POST /chat- Chat with AI assistantPOST /grammar-check- Check grammarPOST /enhance-text- Enhance text qualityPOST /humanize-text- Humanize AI-generated textPOST /ai-check- Check if text is AI-generated
EnglishLearningWeb/
├── app.sh # Linux/macOS startup script
├── app.bat # Windows startup script
├── .env # Environment variables
├── backend/
│ ├── clients/ # External API clients
│ ├── data/ # Data storage
│ ├── repositories/ # Data access layer
│ ├── services/ # Business logic
│ ├── utils/ # Utility functions
│ ├── config.py # Configuration settings
│ ├── main.py # FastAPI application
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── app/ # Next.js app directory
│ ├── pages/ # Page components
│ ├── components/ # Reusable components
│ ├── styles/ # CSS styles
│ └── package.json # Node.js dependencies
└── README.md
-
Port already in use
- The startup scripts automatically kill processes on ports 3000 and 8000
- If issues persist, manually kill processes:
lsof -ti:3000,8000 | xargs kill -9
-
Python virtual environment issues
- Delete
backend/venvfolder and run the script again - Ensure Python 3.12+ is installed and in PATH
- Delete
-
Node.js dependency issues
- Delete
frontend/node_modulesfolder and run the script again - Ensure Node.js 18+ and npm are installed
- Delete
-
API key not working
- Verify your OpenAI API key in the
.envfile - Check that the key has sufficient credits and permissions
- Verify your OpenAI API key in the
- Backend logs: Check the terminal running the backend for detailed error messages
- Frontend logs: Check the browser console and terminal running the frontend
- API logs: Backend logs all API requests and responses with timestamps
- 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 - see the LICENSE file for details.
Built with ❤️ using Next.js, FastAPI and OpenAI