How botirbakhtiyarov/filefinder works
Project Overview
• FileFinder is a Python-based desktop application with a modern GUI (via customtkinter) that functions as a smart file search and chat assistant.
• It leverages a separate Flask-based API (api_server.py) to handle AI-driven features such as text/image embedding and OCR processing.
• The application integrates with several external dependencies (Tesseract for OCR, Poppler for PDF processing, SentenceTransformers, and ChineseCLIP for embeddings).
Main Components
• Desktop Application Client:
• This is the main GUI layer, implemented in app.py.
• The 'assets/ui' directory contains several UI modules (chat_frame.py, main_app.py, search_frame.py, setup_wizard.py, summary_window.py) which indicate different views and dialogs.
• API Server Backend:
• The Flask API provided by api_server.py exposes endpoints such as /embed_text, /embed_image, /embed_clip_text, /extract_pdf_with_ocr, and /extract_image_ocr.
• This server acts as a middleware for performing AI-based processing tasks.
• Utility & File Management Layer:
• Found in assets/utils/file_utils.py, this module provides file handling utilities which support file search and potentially file indexing operations.
• AI Model Resources:
• The models directory (with instructive text) along with configuration in api_server.py hint at a central repository for storing AI model assets.
• External Dependencies:
• Tesseract OCR for text extraction from images.
• Poppler for PDF-to-image conversions.
Diagramming the Architecture
a. Components & Their Labels:
• "Desktop Client UI" (build using customtkinter)
• Represents the main application window and subcomponents (e.g., search, chat, settings).
• "Flask API Server"
• "File Management Utilities"
• Shows supporting modules (assets/utils) that interface with file operations.
• "AI Models & Resources"
• Represents the models directory along with the libraries (SentenceTransformers, ChineseCLIP).
• "External Dependencies"
• Nodes for Tesseract OCR and Poppler, indicating their integration with the API server for document/image processing.
b. Relationships and Data Flow:
• Another layer where the File Management Utilities interact with the Desktop Client to manage file indexing and search functionalities.
c. Architectural Patterns and Design Principles:
• Separation of Concerns: Clearly separate the UI (client) from the processing logic (API server) and the file utility layers.
• Modularity: Each area (UI, API, file management) is designed as a module or component, supporting extensibility.
• External Integration: Emphasize how external libraries and tools (Tesseract and Poppler) are integrated via the API server for specialized processing.