Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FlashAI - English Learning Web Application

A comprehensive web application for English language learning featuring AI-powered flashcard generation, grammar checking, text enhancement, and interactive chatbot functionality.

Features

  • 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

Technology Stack

Backend

  • 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

Frontend

  • 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

Quick Start

🚀 One-Command Setup

For Linux/macOS:

./app.sh

For Windows:

app.bat

These 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

Manual Setup

If you prefer to set up manually or need to troubleshoot:

Prerequisites

  • Python 3.12 or higher
  • Node.js 18 or higher
  • npm package manager

Environment Configuration

  1. Create .env file in the root directory:
    OPENAI_API_KEY=your_api_key_here
    

Backend Setup

cd backend
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.py

Frontend Setup

cd frontend
npm install
npm run dev

Application URLs

Once running, access the application at:

API Endpoints

Flashcards

  • GET /flashcards - Get all flashcards
  • POST /flashcards - Create a new flashcard
  • PUT /flashcards/{word} - Update a flashcard
  • DELETE /flashcards/{word} - Delete a flashcard
  • PUT /flashcards/{word}/learned - Mark flashcard as learned

AI Services

  • POST /chat - Chat with AI assistant
  • POST /grammar-check - Check grammar
  • POST /enhance-text - Enhance text quality
  • POST /humanize-text - Humanize AI-generated text
  • POST /ai-check - Check if text is AI-generated

Project Structure

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

Troubleshooting

Common Issues

  1. 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
  2. Python virtual environment issues

    • Delete backend/venv folder and run the script again
    • Ensure Python 3.12+ is installed and in PATH
  3. Node.js dependency issues

    • Delete frontend/node_modules folder and run the script again
    • Ensure Node.js 18+ and npm are installed
  4. API key not working

    • Verify your OpenAI API key in the .env file
    • Check that the key has sufficient credits and permissions

Logs and Debugging

  • 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

Contributing

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

License

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


Built with ❤️ using Next.js, FastAPI and OpenAI

EnglishLearningWeb

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages