Add Vocabulary Learning Platform (Phase 1: DB + API + Editor)
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-school (push) Successful in 59s
CI / test-go-edu-search (push) Successful in 45s
CI / test-python-klausur (push) Failing after 3m7s
CI / test-python-agent-core (push) Successful in 24s
CI / test-nodejs-website (push) Successful in 31s

Strategic pivot: Studio-v2 becomes a language learning platform.
Compliance guardrail added to CLAUDE.md — no scan/OCR of third-party
content in customer frontend. Upload of OWN materials remains allowed.

Phase 1.1 — vocabulary_db.py: PostgreSQL model for 160k+ words
with english, german, IPA, syllables, examples, images, audio,
difficulty, tags, translations (multilingual). Trigram search index.

Phase 1.2 — vocabulary_api.py: Search, browse, filters, bulk import,
learning unit creation from word selection. Creates QA items with
enhanced fields (IPA, syllables, image, audio) for flashcards.

Phase 1.3 — /vocabulary page: Search bar with POS/difficulty filters,
word cards with audio buttons, unit builder sidebar. Teacher selects
words → creates learning unit → redirects to flashcards.

Sidebar: Added "Woerterbuch" (/vocabulary) and "Lernmodule" (/learn).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-04-24 13:36:28 +02:00
parent 7fc5464df7
commit 7ff9860c69
6 changed files with 900 additions and 1 deletions

View File

@@ -48,6 +48,12 @@ ALERTS_AGENT_ENABLED = os.getenv("ALERTS_AGENT_ENABLED", "false").lower() == "tr
@asynccontextmanager
async def lifespan(app: FastAPI):
logger.info("Backend-Lehrer starting up (DB search_path=lehrer,core,public)")
# Initialize vocabulary tables
try:
from vocabulary_db import init_vocabulary_tables
await init_vocabulary_tables()
except Exception as e:
logger.warning(f"Vocabulary tables init failed (non-critical): {e}")
yield
logger.info("Backend-Lehrer shutting down")
@@ -109,6 +115,10 @@ app.include_router(learning_units_router, prefix="/api")
from progress_api import router as progress_router
app.include_router(progress_router, prefix="/api")
# --- 4c. Vocabulary Catalog ---
from vocabulary_api import router as vocabulary_router
app.include_router(vocabulary_router, prefix="/api")
from unit_api import router as unit_router
app.include_router(unit_router) # Already has /api/units prefix