This file is the end-to-end development plan for the MVP. Use the markdown checkboxes to track progress as we move from documentation and scaffolding to a full demo-ready intake and review flow.
- Keep this file high level and execution-oriented.
- Mark a task
[x]only when the outcome is actually usable, not just partially started. - Add child tasks in the relevant implementation doc or issue tracker if a checkbox becomes too large.
- Use
docs/agent/as the source of truth for scope, architecture, API, pipeline, and validation rules.
- AI documentation split into task-oriented files under
docs/agent/ -
AGENTS.mdreduced to a short context router - Extraction schemas moved to
docs/agent/schemas/*.json - Frontend design guidance moved to
docs/design/frontend-design-system.md -
docs/agent/playbooks/added for recurring task workflows - Backend application scaffold created
- Frontend application scaffold created
- End-to-end demo flow implemented
- Replace monolithic
AGENTS.mdwith a router + doc map - Create domain-focused docs under
docs/agent/ - Separate machine-readable extraction schemas from narrative docs
- Move frontend design system into
docs/design/ - Validate task-based doc bundles for backend, frontend, and QA/demo work
- Add
docs/agent/playbooks/for common execution paths - Add one playbook for upload flow implementation
- Add one playbook for OCR or pipeline debugging
- Add one playbook for review UI changes
- Scaffold
backend/with FastAPI app structure fromdocs/agent/04-backend-structure.md - Scaffold
frontend/with Next.js app structure fromdocs/agent/05-frontend-review-ui.md - Add Dockerfiles for backend and frontend
- Add
docker-compose.ymlwithfrontend,backend,postgres,minio - Add environment-variable configuration for DB, MinIO, and LLM settings
- Add MinIO bucket initialization flow
- Confirm the full stack boots locally with one command
- Implement SQLAlchemy models for applications, documents, document pages, extracted fields, validation flags, and review actions
- Add Alembic migrations for the initial schema
- Implement database session and repository base patterns
- Implement application and document repositories
- Implement MinIO storage client and deterministic storage-key generation
- Persist raw uploads to MinIO and document metadata to PostgreSQL
- Implement
POST /applications - Implement
GET /applications - Implement
GET /applications/{application_id} - Implement
POST /applications/{application_id}/documents - Validate supported file types and reject empty files
- Compute file hash and prepare duplicate-upload detection hooks
- Set initial document status to
uploaded
- Implement
POST /documents/{document_id}/process - Convert PDF uploads into page images
- Normalize image uploads into the same page model
- Preprocess pages with OpenCV
- Run PaddleOCR page by page
- Persist
document_pagesrecords with OCR text and OCR JSON - Store OCR artifacts in MinIO
- Compute and persist aggregate OCR confidence
- Handle corrupted PDF, empty OCR output, and incomplete page conversion gracefully
- Implement rule-based document classification for
id_card,payslip, andbank_statement - Support
unknownclassification with validation flags - Add document-specific extraction prompts
- Integrate LLM extraction with strict JSON-only output validation
- Validate extraction output against
docs/agent/schemas/*.json - Retry once on invalid JSON output
- Fall back to rule-based partial extraction when parsing still fails
- Normalize dates, salary or balance fields, account numbers, and names
- Persist raw and normalized extraction payloads
- Implement field-level validation for ID card, payslip, and bank statement
- Implement completeness warnings for important missing fields
- Implement quality flags for low-quality image and OCR cases
- Implement cross-document name checks across application documents
- Compute
quality_score,ocr_confidence, andextraction_confidence - Route documents into
processed,needs_review, orfailedbased on outcome - Persist validation flags for reviewer visibility
- Implement
GET /documents/{document_id} - Implement
GET /documents/{document_id}/pages - Implement
PATCH /documents/{document_id}/review - Implement
POST /documents/{document_id}/decision - Persist reviewer corrections into review history
- Persist reviewer decisions for
approve,reject, andrequest_reupload - Keep review actions auditable in
review_actions
- Build applications list page
- Build application detail page
- Build document review page
- Show upload status, document type, and warning summary on the application detail page
- Show document preview, editable extracted fields, validation flags, and OCR raw text on the review page
- Allow manual field correction before decision
- Allow approve, reject, and request-reupload actions
- Apply
docs/design/frontend-design-system.mdto the review workflow
- Add upload endpoint test
- Add PDF and image normalization test
- Add OCR service integration-boundary test
- Add extraction parser test
- Add validation rule tests
- Add repository tests for the core persistence flow
- Prepare sample documents for all three supported document types
- Rehearse the demo story from
docs/agent/02-scope-priorities.md - Verify reviewer can correct at least one field and approve successfully
- Verify low-confidence or invalid cases surface visible warnings instead of silent failure
- OCR bounding-box overlay on the review screen
- Duplicate upload detection
- Simple image quality scoring heuristic
- Extraction retry observability or diagnostics
- Lightweight background-job orchestration if synchronous processing becomes too slow
The MVP is done when all of these are true:
- A user can create an application
- A user can upload an ID card, a payslip, and a bank statement
- The system stores raw files and derived artifacts
- The system runs normalization, OCR, classification, extraction, and validation
- The review UI displays extracted fields, confidence signals, and validation flags
- A reviewer can correct a field and approve a document
- The project runs locally with Docker Compose
- Core tests for upload, normalization, extraction, validation, and persistence exist