How kotorcat/expired-bread works
Expired Bread is a Django document-management application. Users upload PDF/DOCX files, the system extracts text or falls back to GigaChat Vision, AI results enter a human review step, and confirmed documents become searchable and usable for document-grounded Q&A. The graph preserves these stages, persistence, and the separate search and Q&A capabilities. Relationships are based on the README and excerpted source; template rendering and some UI wiring are documented or visible only by path, so uncertain links are omitted.
Main entry points: views.py Document views · document_service.py Processing workflow · llm.py GigaChat analysis · search_service.py Document search
Components 12
Web interface
- Document views
documents/views.py - Upload and review forms
documents/forms.py
Document processing
- Processing workflow
documents/services/document_service.py - PDF/DOCX extraction
documents/services/extractors.py - GigaChat analysis
documents/services/llm.py
Search and Q&A
- Document search
documents/services/search_service.py - Search normalization
documents/services/normalization.py - Question answering
documents/services/qa_service.py
Document data
- Document records
documents/models.py - Original files
documents/models.py
Other components
- User
- GigaChat service
Connections 16
- User → Document views: uses
README.md - Document views → Upload and review forms: validates
documents/views.py - Document views → Document records: reads/writes
documents/views.py - Document views → Processing workflow: starts processing
documents/views.py - Processing workflow → Document records: updates
documents/services/document_service.py - Processing workflow → Original files: reads file
documents/services/document_service.py - Processing workflow → PDF/DOCX extraction: extracts text
documents/services/document_service.py - Processing workflow → GigaChat analysis: analyzes text
documents/services/document_service.py - Processing workflow → GigaChat analysis: vision fallback
documents/services/document_service.py - GigaChat analysis → GigaChat service: requests analysis
README.md - Document views → Document search: searches
documents/views.py - Document search → Document records: queries
documents/services/search_service.py - Document views → Question answering: asks question
documents/views.py - Question answering → Document search: finds candidates
documents/services/qa_service.py - Question answering → GigaChat analysis: sends context
documents/services/qa_service.py - Search normalization → Document search: prepares text