How kb-dhanush/inkgrader works
InkGrader accepts exam questions, reference material, and student-answer scans, extracts structured content, then grades answers and streams score updates. Its primary authenticated web workflow is served by the React frontend and FastAPI backend; a separate demo frontend submits a single answer for evaluation. The README describes OCR, agent grading, and JWT authentication, while sampled source confirms route orchestration, MongoDB access, OCR.Space integration, and Redis-backed updates. FileProcessor internals and several agent integrations were not sampled, so their detailed wiring is omitted.
Main entry points: backend/routes.py Exam and grading routes · app.py FastAPI application · utils.py Document processing · Auth/routes.py Authentication routes
Components 19
Web interfaces
- Main web app
frontend/src/App.jsx - Landing page
frontend/src/pages/LandingPage.jsx - Login and signup
frontend/src/pages/LoginSignUp.jsx - Single-answer demo
demo-frontend/src/App.jsx
API and identity
- FastAPI application
backend/app.py - Exam and grading routes
backend/routes.py - Authentication routes
backend/Auth/routes.py - JWT and password utilities
backend/Auth/utils.py
Document processing
- Document processing
backend/FileProcessor/utils.py - OCR.Space client
backend/FileProcessor/__init__.py - Extraction agent
backend/Agents/extraction_agent.py
Evaluation
- Grading agent
backend/Agents/grading_agent.py - Retrieval and search tools
backend/Agents/tools.py - Text chunking and embeddings
backend/Agents/rag_pipeline.py
State and messaging
- MongoDB
- Redis pub/sub
backend/redis_pubsub.py
Other components
- Teacher or user
- OCR.Space API
- Reference search services
Connections 27
- Teacher or user → Landing page: browses
- Landing page → Login and signup: opens login
- Teacher or user → Login and signup: authenticates
- Login and signup → FastAPI application: calls auth API
- FastAPI application → Authentication routes: dispatches auth
- Authentication routes → JWT and password utilities: uses tokens
- Authentication routes → MongoDB: reads/writes users
- Teacher or user → Main web app: submits exam
- Main web app → FastAPI application: calls exam API
- FastAPI application → Exam and grading routes: dispatches exams
- Exam and grading routes → Document processing: processes uploads
- Document processing → OCR.Space client: requests OCR
- OCR.Space client → OCR.Space API: sends images
- Document processing → Extraction agent: extracts content
- Document processing → MongoDB: stores extracted data
- Exam and grading routes → MongoDB: reads exam data
- Exam and grading routes → Grading agent: grades answers
- Grading agent → Retrieval and search tools: retrieves context
- Retrieval and search tools → Text chunking and embeddings: embeds text
- Retrieval and search tools → Reference search services: searches references
- Grading agent → MongoDB: updates marks
- Exam and grading routes → Redis pub/sub: publishes progress
- Redis pub/sub → Exam and grading routes: delivers events
- Exam and grading routes → MongoDB: loads graded totals
- Teacher or user → Single-answer demo: uploads answer
- Single-answer demo → FastAPI application: posts demo request
- FastAPI application → Exam and grading routes: dispatches demo