$ show piglei/ai-vocabulary-builder
AI Vocabulary Builder is a full-stack web application (FastAPI backend, Vue.js frontend) that uses LLM APIs (OpenAI, Gemini, Anthropic, DeepSeek) to help users build and learn English vocabulary. The backend exposes REST APIs for translating text, extracting rare words, managing a vocabulary store (TinyDB), generating stories and quizzes from learned words, and exporting to Anki/CSV. The frontend provides an intuitive single-page interface with build, learn (words list, quiz, story) and settings views. The architecture follows a modular monolith with clear separation of concerns: `builder` for vocabulary extraction, `learn` for quiz/story features, `system` for settings and model configuration, and `infras` for persistence and AI model abstraction. The codebase is well-structured with comprehensive unit tests, CI/CD via GitHub Actions, and rigorous linting/formatting (ruff, mypy).
The LLM identified 2 files worth highlighting for reuse:
A self-contained, reusable API error handling framework. Implements an `APIError` exception class with templated messages, chained formatting, and a descriptor-based `ErrorCode` class for declarative error code definitions. Could be extracted into any FastAPI project to provide consistent error responses.
Provides `tokenize_text` and `get_word_candidates` functions with a built-in list of common English stop words. Clean, well-tested, and easily reusable in any NLP pipeline for extracting meaningful words from text.