How prasanthkumarkb/ledgerlens works
InvoicePilot (LedgerLens) is a Streamlit invoice-management UI backed by a FastAPI service. Users upload invoice images, which the service stores as documents; extraction and watermarking populate processed invoice data for browsing, dashboard reporting, and manual review. The README describes processing as automatic after upload, while the sampled route code exposes extraction as a separate endpoint, so that distinction is retained. Source excerpts support the backend orchestration and review calls; several other UI-to-API details are documented only at the feature level.
Main entry points: routes.py REST endpoints · backend/app.py FastAPI setup · frontend/app.py Page navigation · loader.py Loading indicator
Components 21
Streamlit UI
- Page navigation
frontend/app.py - Invoice upload
frontend/upload.py - Document browser
frontend/documents.py - Manual review
frontend/review.py - Dashboard views
frontend/dashboard.py - Loading indicator
frontend/components/loader.py - UI styling
frontend/styles.py
API workflows
- REST endpoints
backend/api/routes.py - Invoice schemas
backend/schemas/invoice.py
Invoice processing
- AI extraction
backend/services/vision.py - Image watermarking
backend/services/watermark.py
Document storage
- Document records
backend/models/document.py - SQLite database
backend/database/database.py - Uploaded images
backend/uploads - Processed images
backend/processed
API platform
- FastAPI setup
backend/app.py - Exception handlers
backend/core/handlers.py - Domain exceptions
backend/core/exceptions.py - Request logging
backend/core/middleware.py - Application logger
backend/core/logger.py
Other components
- Invoice user
Connections 31
- Invoice user → Page navigation: uses
README.md - Page navigation → Invoice upload: dispatches
frontend/app.py - Page navigation → Document browser: dispatches
frontend/app.py - Page navigation → Manual review: dispatches
frontend/app.py - Page navigation → Dashboard views: dispatches
frontend/app.py - Page navigation → UI styling: loads
frontend/app.py - Invoice upload → REST endpoints: uploads to
README.md - Document browser → REST endpoints: lists from
README.md - Manual review → REST endpoints: reads and updates
frontend/review.py - Dashboard views → REST endpoints: requests metrics
README.md - Manual review → Loading indicator: shows
frontend/review.py - Dashboard views → Loading indicator: uses
frontend/dashboard.py - Invoice upload → Loading indicator: uses
frontend/upload.py - Document browser → Loading indicator: uses
frontend/documents.py - REST endpoints → SQLite database: queries and commits
backend/api/routes.py - REST endpoints → Document records: creates and updates
backend/api/routes.py - REST endpoints → Invoice schemas: validates responses
backend/api/routes.py - REST endpoints → AI extraction: extracts fields
backend/api/routes.py - REST endpoints → Image watermarking: generates watermark
backend/api/routes.py - REST endpoints → Uploaded images: saves image
backend/api/routes.py - REST endpoints → Processed images: records image path
backend/api/routes.py - Document records → SQLite database: uses base
backend/models/document.py - FastAPI setup → REST endpoints: registers
backend/app.py - FastAPI setup → SQLite database: creates tables
backend/app.py - FastAPI setup → Exception handlers: registers handlers
backend/app.py - FastAPI setup → Domain exceptions: handles type
backend/app.py - FastAPI setup → Request logging: adds
backend/app.py - FastAPI setup → Application logger: logs startup
backend/app.py - Exception handlers → Domain exceptions: formats errors
backend/core/handlers.py - Request logging → Application logger: uses
backend/core/middleware.py - AI extraction → Application logger: logs extraction
backend/services/vision.py