TrashTheTest turns academic PDFs into grounded study notes, flashcards, practice questions, an AI tutor, syllabus insights and a published study website. Open source, self-hostable, and built around the document rather than a chat box.




Upload material, generate the study set, practise it, then publish it. Every artifact is grounded in retrieved source chunks with page-level citations, and anything that cannot be supported is reported as a gap instead of invented.
Topic-by-topic generation in source order, coverage checks, and a PDF with TOC, bookmarks and page numbers.
Atomic, source-anchored cards with difficulty. Definitions become cloze cards instead of trivia prompts.
MCQs with explanations and citations. Cells without enough distinct evidence are left unfilled, never padded.
Project-scoped RAG. Greetings skip retrieval; academic questions answer with sources.
Generated from the same grounded retrieval pipeline, persisted, and rendered consistently in the app and on the published site.




Docker Compose brings up the API, worker, PostgreSQL with pgvector, Redis and the frontend. You bring a provider key.
git clone https://github.com/ItsAakif/trashthetest.git
cd trashthetest
cp .env.example .env
docker compose up -d --build
docker compose exec api alembic upgrade head
Open http://localhost:5174. Health check: http://localhost:8000/health. Set JWT_SECRET, DATABASE_URL and GROQ_API_KEY (or OPENROUTER_API_KEY) in .env first.
Managed PostgreSQL 16 with pgvector, then alembic upgrade head.
python -m services.jobs.worker as its own process. The queue is in Postgres, no broker required.
Local volume by default, or S3-compatible via STORAGE_BACKEND=s3 and S3_*.
Server-side env only. Provider keys never reach the browser.
| Layer | Choice |
|---|---|
| Frontend | React 19, TypeScript, Vite, TailwindCSS, TanStack Query, wouter, Radix UI |
| API | Python 3.13, FastAPI, Pydantic v2, SQLAlchemy 2 async |
| Data | PostgreSQL 16, pgvector (HNSW), tsvector FTS, Alembic |
| Jobs | Postgres SKIP LOCKED queue, dedicated worker, optional Celery/Redis bridge |
| AI | Qwen3-Embedding-0.6B (1024d), bge-reranker-v2-m3, Groq primary / OpenRouter fallback, structured outputs |
| Documents | PyMuPDF, pdfplumber, PP-OCRv6 tiny (ONNX, CPU), ReportLab |
| Ops | Docker Compose, storage abstraction (local / S3), structured logs |