# shreyasbgr/pdf-info-extractor architecture

> Architecture diagram of the GitHub repository shreyasbgr/pdf-info-extractor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shreyasbgr/pdf-info-extractor
- Repository: https://github.com/shreyasbgr/pdf-info-extractor

## Overview

##### Project Type and Purpose
- This is a small, monolithic “full-stack” Python app built with Streamlit.
- Purpose: allow users to upload or point to PDF documents, extract information via a PDF parsing library, then enrich or summarize that info by calling the Google Gemini API, and display results in an interactive web UI.

##### File Structure Analysis
- Root files only—no subdirectories:
- app-local.py: Streamlit entrypoint for local dev (loads .env).
- app-streamlit.py: Streamlit entrypoint for cloud deployment.
- requirements.txt: Python dependencies (Streamlit, PDF parser, dotenv, HTTP client).
- .gitignore, README.md.
- No database, no microservices—everything lives in one process.
- Config sourced from a .env file (API key).

##### Key README Insights
- Uses Conda to create a Python 3.10 env.
- Requires a GOOGLE_API_KEY in .env.
- Two execution modes: local vs. Streamlit Cloud.
- Hosted publicly at a Streamlit app URL.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Presentation Layer"
        Client["Client (Browser)"]:::client
    end

    subgraph "Application Layer"
        subgraph "Streamlit Server"
            AppLocal["app-local.py"]:::server
            AppStream["app-streamlit.py"]:::server
            BusinessLogic["Business Logic Layer"]:::logic
            Parser["PDF Parsing Module"]:::parser
            Config[".env (API Key)"]:::config
        end
    end

    Gemini["Google Gemini API"]:::external

    Client -->|"load page & upload PDF"| AppLocal
    Client -->|"load page & upload PDF"| AppStream
    AppLocal -->|"reads config"| Config
    AppStream -->|"reads config"| Config
    AppLocal -->|"user action triggers"| BusinessLogic
    AppStream -->|"user action triggers"| BusinessLogic
    BusinessLogic -->|"invoke parser"| Parser
    Parser -->|"parsed text"| BusinessLogic
    BusinessLogic -->|"HTTP request with API key"| Gemini
    Gemini -->|"API response"| BusinessLogic
    BusinessLogic -->|"render UI response"| Client

    subgraph "Project Files"
        requirements["requirements.txt"]:::config
        readme["README.md"]:::config
        gitignore[".gitignore"]:::config
    end

    click AppLocal "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/app-local.py"
    click AppStream "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/app-streamlit.py"
    click Parser "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/app-local.py"
    click Parser "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/app-streamlit.py"
    click BusinessLogic "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/app-local.py"
    click BusinessLogic "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/app-streamlit.py"
    click Config "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/.env"
    click requirements "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/requirements.txt"
    click readme "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/README.md"
    click gitignore "https://github.com/shreyasbgr/pdf-info-extractor/blob/main/.gitignore"

    classDef client fill:#B3E5FC,stroke:#0277BD,color:#000
    classDef server fill:#BBDEFB,stroke:#0D47A1,color:#000
    classDef logic fill:#C8E6C9,stroke:#2E7D32,color:#000
    classDef parser fill:#DCEDC8,stroke:#558B2F,color:#000
    classDef config fill:#FFF9C4,stroke:#F9A825,color:#000
    classDef external fill:#E1BEE7,stroke:#6A1B9A,color:#000
```
