# vishwajeetdabholkar/resume_parser_api architecture

> Architecture diagram of the GitHub repository vishwajeetdabholkar/resume_parser_api, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vishwajeetdabholkar/resume_parser_api
- Repository: https://github.com/vishwajeetdabholkar/resume_parser_api

## Overview

##### Project Type & Purpose
- This project is a full-stack backend API service built with FastAPI. Its main purpose is to process PDF resumes, perform OCR (leveraging Tesseract and Poppler), and extract structured information using AI (through OpenAI’s API) including text embeddings.

##### Analyzing the File Structure
- Notice the “app” folder that is organized into sub-modules:
- “api/routes/”: Contains the API endpoint definitions (resume parsing endpoints).
- “services/”: Contains core business logic. For instance, “pdf.py” is the PDF processing service and “ai.py” is the service managing OpenAI interactions.
- “core/”: Contains configuration, dependency management, and logging.
- “models/”: Contains data models and schemas.
- Top-level directories Tesseract-OCR and poppler-23.11.0 are used as bundled external dependencies for OCR and PDF processing.
- The project’s entry point is in “main.py”, and additional configuration is managed by a .env file.
- There are directories for logs and additional documentation.

##### Architectural Patterns & Technologies
- Modular Architecture: Each main function (PDF processing, AI processing, API routing) is encapsulated in its own module.
- Mention use of FastAPI as the framework handling routing and dependency injection.
- That the design is orchestrated with a pipeline pattern: from “PDF Upload” -> “PDF Processing/OCR” -> “Text Process & AI Extraction” -> “Final Structured Response”.
- External dependencies: Tesseract-OCR, Poppler, and OpenAI API.
- That configuration and logging are cross-cutting concerns managed centrally.

## Diagram (Mermaid)

```mermaid
flowchart TD
    entry("Project Entry Point"):::utility
    client("Client / PDF Upload"):::client
    api("API Routes"):::internal

    subgraph "Backend Services"
        pdf("PDF Service"):::internal
        textProc("Text Process & Embedding Generation"):::internal
        ai("AI Service"):::internal
        structure("Structure Generation & Response Formatting"):::internal
    end

    subgraph "External Dependencies"
        ocrTools("Tesseract-OCR"):::external
        pdfTools("poppler-23.11.0"):::external
        openai("External Service: OpenAI API"):::external
    end

    subgraph "Utilities"
        config("Configuration Management"):::utility
        dep("Dependency Management"):::utility
        schemas("Data Models & Schemas"):::utility
        logging("Logging"):::utility
    end

    %% Main flow
    entry -->|"entrypoint"| api
    client -->|"upload"| api
    api -->|"process"| pdf
    pdf -->|"OCR"| ocrTools
    pdf -->|"PDFTools"| pdfTools
    pdf -->|"ExtractedText"| textProc
    textProc -->|"ProcessedText"| ai
    ai -->|"EmbeddingRequest"| openai
    ai -->|"StructuredData"| structure
    structure -->|"Response"| api

    %% Utility Dependencies (dotted lines)
    api -.-> config
    api -.-> logging
    pdf -.-> config
    pdf -.-> dep
    pdf -.-> schemas
    pdf -.-> logging
    textProc -.-> config
    textProc -.-> logging
    ai -.-> config
    ai -.-> dep
    ai -.-> schemas
    ai -.-> logging

    %% Click Events
    click entry "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/main.py"
    click api "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/app/api/routes/resume.py"
    click pdf "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/app/services/pdf.py"
    click ai "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/app/services/ai.py"
    click config "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/app/core/config.py"
    click dep "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/app/core/dependencies.py"
    click schemas "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/app/models/schemas.py"
    click ocrTools "https://github.com/vishwajeetdabholkar/resume_parser_api/tree/main/Tesseract-OCR"
    click pdfTools "https://github.com/vishwajeetdabholkar/resume_parser_api/blob/main/poppler-23.11.0"

    %% Styles
    classDef client fill:#f9e79f,stroke:#000,stroke-width:2px;
    classDef internal fill:#aed6f1,stroke:#0d47a1,stroke-width:2px;
    classDef external fill:#a9dfbf,stroke:#2e7d32,stroke-width:2px;
    classDef utility fill:#d2b4de,stroke:#6a1b9a,stroke-width:2px;
```
