Architecture
React frontend, FastAPI API, Python engine, SQLite and persistent storage.
Browser
│ HTTP + SSE
▼
React / Vite ─────► FastAPI / Uvicorn
│
┌───────────┼────────────┐
▼ ▼ ▼
Python engine SQLite data/jobs/
│ tradoc.db documents
▼
LLM providerInterface
The frontend lives in web/. During development, Vite listens on port 2499 and proxies /api calls to FastAPI on port 8000. In the production Docker image, FastAPI also serves the compiled frontend.
API
api/app.py initializes the application, security headers, request limiting and health route. api/routes.py exposes providers, projects, segments, glossaries, exports and events.
Engine
The core/ directory contains parsers, segmentation, the LLM client, cleanup, the asynchronous engine, glossaries, credential storage and checkpoints.
Persistence
SQLite operates in WAL mode. Every new project has an isolated input and output directory under data/jobs/<id>/. Glossaries and provider credentials also live under data/.
One consistent backup
Back up the entire data/ directory, not only tradoc.db. The database references the project documents and directories stored alongside it.