# Build a Document Review App in 3 Hours (Python, React, Azure)

## Executive summary

This video provides an end-to-end guide for building a sophisticated document review application designed for invoice and receipt processing. The solution utilizes a modern monorepo architecture, integrating Python (FastAPI) for the backend logic, React for the frontend UI, and Microsoft Azure services (Document Intelligence and Azure OpenAI) for core AI capabilities. The process demonstrates creating a robust, multi-stage pipeline that handles document classification, data extraction, business rule validation, and general ledger account suggestion.

## Key takeaways

- Hybrid Document Processing Pipeline: The application uses a hybrid approach by combining specialized pre-trained models (Azure Document Intelligence) for high accuracy/low cost extraction with general LLMs (Azure OpenAI) for complex tasks like classification and suggesting General Ledger accounts. This ensures robustness against edge cases.
- Structured Data Modeling: Pydantic is used extensively to enforce strict schemas on extracted data, transforming raw JSON output into predictable Python objects for reliable business logic application.
- Modular Pipeline Design Pattern: The backend implements a chainable pipeline pattern (Classification -> Extraction -> Validation -> GL Suggestion). This modular design allows individual steps to be easily added, swapped, or removed without breaking the overall workflow.
- Enterprise Cloud Setup: The entire system is designed for enterprise readiness by utilizing Azure services and demonstrating deployment via Azure Container Apps (ACA), emphasizing best practices for production environments.

## Technical details

- Architecture & Setup: The project uses a monorepo structure with separate `backend` and `frontend` folders. Environment setup involves using `uv sync` within the backend directory to manage dependencies.
- Azure CLI & Resource Management: The Azure environment is managed via the Command Line Interface (CLI). Key steps include creating a resource group (`az group create`) and provisioning services like Document Intelligence and Azure OpenAI through the CLI for efficiency.
- Backend API Layer: The backend is built using FastAPI to expose endpoints that connect the frontend UI to the core processing pipeline. The database layer uses SQLite locally.
- AI Integration (Extraction): Document Intelligence is used for extraction, providing pixel-level metadata alongside content. Azure OpenAI is integrated as a fallback/complementary LLM source.
- Frontend Stack: The frontend is built using React and TypeScript (with Tailwind CSS for styling), designed to consume the FastAPI API layer and provide a visual review workflow for the finance user.

## Practical implications

- The video demonstrates a complete client-facing solution lifecycle, from initial requirements gathering (client brief) to final deployment.
- It emphasizes the importance of using structured data models (Pydantic) early in the pipeline to ensure business logic can operate reliably on extracted data.
- By separating concerns into distinct services (Classification, Extraction, Validation), the architecture remains modular and scalable for future feature additions.
- The use of Azure's managed services provides a path toward enterprise-grade security and compliance.

## Topics

AI Engineering, Document Processing, Cloud Architecture, Backend Development, Monorepo, Azure Document Intelligence, Azure OpenAI / Azure AI Foundry, Pydantic, FastAPI, React / TypeScript

Source: https://www.youtube.com/watch?v=YYeZh6Hac9E
